Terminal 101: Playing Games with Emacs
Posted 05/28/2012 at 1:22pm
| by Cory Bohon
Every Monday, we'll show you how to do something new and simple with Apple's built-in command line application. You don't need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type 'em out!
With the Terminal 101 column, we’ve shown a lot of productive uses for the command line in OS X, but Terminal doesn’t have to be all about work. Today we'll show you how to use Emacs (Unix-based text editors) to play over 50 games, including classic Pong and Tetris. So, fire up the command line and for some good ol' fashioned text-based game fun.
The first step to playing games with Emacs is to figure out which games your version of Emacs shipped with. To do this, type the following command into Terminal:
cd /usr/share/emacs/

Type "ls" and then enter, and jot down the version number listed in Terminal (for example, in OS X Lion 10.7.4, it’s 22.1). Next, type the following command into Terminal:
cd /usr/share/emacs/VERSION/lisp/play
Replace “VERSION” with the version number of Emacs that you found earlier. This time, when you use the “ls” command after typing the above command, you will be presented with a listing of all the games that your version of Emacs comes standard with.

Open a new Terminal window by pressing Command + N. In the new window, we’ll open Emacs by typing emacs and pressing enter, and then to run the games, press the Esc key on your keyboard, followed by the X key. Next, type in the name of one of the file names found in the directory listing of the games. No need to type the file extension, just the name before the dot. After doing this, your game will load and you'll be able to play.

Cory Bohon is a freelance technology writer, indie Mac and iOS developer, and amateur photographer. Follow this article's author, Cory Bohon on Twitter.