PDF download Download Article
Learn the basics of playing these fun terminal games and impress your friends with your tech skills
PDF download Download Article

The Terminal is an application inside all Macs that lets you access your computer’s command-line interface. It might be intimidating at first, because it's not as intuitive as the usual user interface, but it offers a lot of neat features, and you can use it do a lot of things that you would otherwise do manually on your system. This article will show you how to play old-school games in the Terminal. If you’re using a current version of macOS, you’ll probably need to install Emacs first.

Playing Games in Terminal

  • Before you can play games in Terminal, you’ll need to install Emacs. You can do this in Terminal if you have Homebrew installed.
  • To execute a game in Emacs, enter the command emacs -q --no-splash -f (name of game) .
  • Popular Emacs games include Tetris, Snake, and Gomoku.
Section 1 of 7:

Enabling Emacs

PDF download Download Article
  1. Unless you’re using an old version of macOS, you probably don’t have Emacs installed on your computer. This is an application you’ll need to play old-school games in Terminal. In order to get Emacs, first you need to install Homebrew, a package manager that allows you to make special modifications to your Mac. [1] To install it:
    • First, install Apple’s Command Line toolkit if you haven’t already done so. In Terminal, enter the command xcode-select --install and press Return .
      • If a window pops up asking if you want to install the Command Line, click Install . Follow the prompts to finish the installation process.
      • You’ll see an error message if you’ve already installed the Command Line toolkit in the past.
    • If you’re using macOS Catalina or later, switch to the bash shell before you continue. To do this, enter chsh -s /bin/bash , type in your Mac’s administrator password, and then restart Terminal.
    • Enter the following command and then press Return : /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh )"
      • When prompted, enter your administrator password and press Return , then press Return again. Wait for the installation to complete.
    Advertisement
  2. This will install Emacs on your Mac. This process may take several minutes. [2]
    • If you have an older Mac and you suspect you might have an outdated version of Emacs installed, run the following commands first to uninstall it: [3]
      • sudo rm /usr/bin/emacs
      • sudo rm -rf /usr/share/emacs
  3. Replace “(game)” with the name of the game you want to play (no parentheses). A new window will pop up with your game in it! [4]
  4. Advertisement
Section 2 of 7:

Tetris

PDF download Download Article
  1. Press Return to run the game. A window should appear, and Tetris blocks will start falling.
  2. You can move the blocks from side to side with the left and right arrows. Rotate them with the up and down arrows. Your score should be on the right side of your playing area, together with Rows and Shapes.
  3. Advertisement
Section 3 of 7:

Snake

PDF download Download Article
  1. A window will appear with a yellow “snake” made of blocks moving around inside it.
  2. Try to collect the beads that appear on the screen.
    • The objective of Snake is to guide your snake around the screen, collecting beads as they appear. The more you eat, the more your score rises, but the snake also gets longer.
    • Hitting the side of the screen or hitting your tail will kill your snake, and you will lose.
    • Other commands include n (to start a new game), p (to pause your game), and q (to end the game).
    • It can be a little tricky to switch to the new window quickly enough to start playing before your snake hits a wall. You may need to press n to start a new game.
  3. Advertisement
Section 4 of 7:

Gomoku

PDF download Download Article
  1. A window should appear with a screen full of dots.
  2. This will select who goes first (y will let the computer start, n will let you start).
  3. Try to make horizontal, vertical, or diagonal row of 5 X’s or O’s before the computer does.
    • Gomoku is like Connect 4, only you need 5 in a row to win.
  4. Advertisement
Section 5 of 7:

Pong

PDF download Download Article
  1. A window should appear with two yellow paddles on each side and a red ball bouncing around.
  2. Move the paddle on the left with the left and right arrows or the 4 and 6 keys , and the one on the right with the up and down arrows . The score is under the playing screen.
    • You might need to maximize the window to see both paddles.
    • The objective of pong is to send the ball into the opponent's area. The only defense they have is the paddle, which is used to re-send the ball to you.
  3. Advertisement
Section 6 of 7:

Doctor

PDF download Download Article
  1. Some text should appear saying "I am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice." You are now conversing with your Mac's inner doctor!
  2. Have fun with it, but beware––it will eventually get annoying.
    • This is a version of Eliza, one of the earliest chatbots. You can play with a version of the original Eliza here .
  3. Advertisement
Section 7 of 7:

More Games

PDF download Download Article
  1. There are lots of games available in Emacs. If you keep Emacs updated, new ones may be added. Explore a list of available games here . Some popular games include:
    • Solitaire
    • Dunnet
    • 5x5
    • Bubbles
  2. There are several add-on games available for Emacs, many of which are also listed in the Emacs Wiki . If you want to add a new game, visit the developer’s page and read their user documentation for instructions.
    • For example, to install Pacmacs (a Pacman-style game for Emacs), see the installation instructions in the developer’s ReadMe file on Github.
  3. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Video

      Tips

      • There are more games in more updated versions of the Mac Operating System.
      • For the games in emacs, capitalization might matter. For example, try tetris instead of Tetris.
      • To get a nicer-looking background in Terminal, select Shell > New Window > Pro . This will give you a black background. Other options will give you different colors.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Using the Terminal can be dangerous if you don't know what you are doing. Certain commands can destroy your whole computer or delete all your files. No commands in this article do any damage to your computer, but do be careful what you write!
      Advertisement

      About This Article

      Thanks to all authors for creating a page that has been read 145,097 times.

      Is this article up to date?

      Advertisement