thecodingidiot.com

f01-the-terminal

The Terminal

Rogue, 1980

Rogue[1] appeared in 1980 on BSD[2] Unix. It was among the first games to generate its dungeon procedurally — every run a different layout, every descent into the unknown genuinely unknown. It had no graphics. Your character was @. A dog was d. A dragon was D. The walls were # and the doors were + and the gold was *. The terminal was not a window into a game engine running somewhere else. The terminal was the renderer, the I/O layer, and the display, all at once. Every frame was a text buffer written to a screen.

Rogue — North American box art
Rogue — In-game screenshot

NetHack[3][4][5] is Rogue's direct descendant. First released in 1987. It is still actively maintained today. It runs in any modern terminal — the same kind of terminal you are about to open for the first time.

NetHack 3.4.3 — Tile mode screenshot

This chapter ends with you installing NetHack and playing for ten minutes. Not as a reward. As a demonstration. The terminal is not a chore you clear on the way to the real work. It is the environment that ran the first procedurally generated game, and it still does. Learn it for what it is.

The implementation pages take you through the same environment, one skill at a time — the shell prompt, navigation, files, permissions, search, pipelines, text tools, processes, the shell environment, scripting, and Vim. Each page builds on the last. By the end you will have a working command-line setup and NetHack installed. Start at Setup.

Implementation

Setup

Begin Implementation
  1. 0Setup
  2. 1The Shell Prompt
  3. 2Moving Around
  4. 3Creating and Manipulating Files
  5. 4Who Owns What
  6. 5Finding Things
  7. 6The Unix Philosophy
  8. 7Shaping Output
  9. 8Running and Stopping Things
  10. 9The Shell's Memory
  11. 10Writing Your First Script
  12. 11Surviving Vim
  13. 12NetHack

Footnotes

  1. Rogue (video game) - Wikipedia

  2. Berkeley Software Distribution - Wikipedia

  3. NetHack Home Page

  4. NetHack - Wikipedia

  5. GitHub - NetHack/NetHack: Official NetHack Git Repository

  6. POSIX - Wikipedia