Play Games In Terminal 21

Terminal

Play Games In Terminal

Hey

This is a very cool trick that enables you to play a couple of games within Terminal. They are only basic games such as pong, tetris and a few others. Its simple to do and only requires the use of Terminal and a little bit of know how.

The first step is to find what games you can play. This tip using an old unix program called emacs. I haven’t used to till now but it very popular with some programmers. First, open up Terminal (Applications > Utilities > Terminal) and type the following.

ls /usr/share/emacs/22.1/lisp/play

This navigates to the folder play and displays a list of the currently installed games. There will be 2 files for each game. They both do different things. The only thing you need to worry about is the name of the game. You can also find the name of the games by viewing hidden files. If you type the following it shows you all the hidden files on your system you can navigate to the required folder that way. Type FALSE instead of TRUE to reverse.

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Once as the list pops up we can open up emacs and get playing.


The next step is to type emacs into terminal. This will bring up the emacs interface. To enable the command line hold Esc + X. You can then type in the game name. Tetris is shown below.


If you want to play another game press Esc + X. To quit emacs press and hold Ctrl and then press x then c. This will close emacs.

The games are basic but they were designed to be run on older systems, not Core 2 Duo processors. Some of my favourite games are tetris, snake and gomoku. Pong doesn’t work so some reason.

If you have any more tips or tricks for emacs please post them below. I haven’t used this system much I am still learning my way around.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

21 Responses to “Play Games In Terminal”

  1. 1

    it’s 21.2, not 22.1

    Comment By Gust This Guy on February 26th, at 12:13 am

  2. 2

    Its 22.1 on my computrer. Try updating your emacs installation.

    Comment By James Powell on February 26th, at 8:32 am

  3. 3

    Pong Does Work. It’s supposed to be a badly designed multiplayer game, in which one user used up and down, and the PLAYER 2 uses left and right.

    Comment By Teaton on August 18th, at 5:05 am

  4. 4

    INSTEAD OF PING DO PONG PONG WILL WORK AND IT IS FUN

    l l
    l 0 l
    l l
    l l

    Comment By Bob on October 10th, at 2:40 am

  5. 5

    22.1 works on mine not 21.1 but i guess it doesnt really matter and the best game is *drum roll*

    / ) 0 /\/ G :)
    /__)
    /

    Comment By Bill Anderson on March 24th, at 1:02 am

  6. 6

    It has created a file called .DS_Store that is ugly on my desktop. I try to delete it and it reappears…

    Please help me,

    C

    Comment By C on March 25th, at 3:44 am

  7. 7

    defaults write com.apple.finder AppleShowAllFiles TRUE

    will make .ds)store files show up

    defaults write com.apple.finder AppleShowAllFiles FALSE

    will make them go away

    Comment By orta on April 4th, at 5:18 pm

  8. 8

    22.1 Worked for me, which I can’t say with the previous version. The most annoying thing, though, is the whole Esc+x thing. When I’m at the emacs interface, I try pressing the aforementioned keystrokes and it just brings me to the “;; This buffer is for notes you don’t want to save, and for Lisp evaluation.
    ;; If you want to create a file, visit that file with C-x C-f,
    ;; then enter the text in that file’s own buffer.” Thing. I they ctrl c, ctrl f and manage to type “tetris” at the bottom box, but all it does is starts a new free script page with it saved as “tetris”.

    Comment By Anonymous on April 17th, at 3:38 am

  9. 9

    Mud is very confusing like what are all the controls or phrases you can enter? >:(

    Comment By Bill Anderson on April 30th, at 10:56 pm

  10. 10

    .DS store is a log of what you have done that is invisible. If you change your settings in terminal to make invisible items viewable it will always be there.

    Comment By Kevin on June 4th, at 7:03 am

  11. 11

    Hello i try to press Esc+x when in emacs interface but it takes me to a text are and nothing happens please help me

    Comment By silentrock on August 7th, at 12:10 am

  12. 12

    I have the same problem, can someone help?

    Comment By Phill on August 9th, at 7:30 pm

  13. 13

    Same happened 2 me (the Esc+x not working) help!!!!

    Comment By Veer on August 18th, at 6:10 pm

  14. 14

    Once you press Esc+X you enter the game name

    Comment By Alexis on October 21st, at 5:18 pm

  15. 15

    Thanks a bunch. We spent hours only to look up this topic!

    Comment By Mail Entries on November 16th, at 10:13 am

  16. 16

    For pong, it’s a two player game with Up and Down arrow keys for player one, 4 and 6 for player 2

    Comment By James on January 4th, at 7:30 am

  17. 17

    Hey, great blog!. How do I subscribe to ensure I get notifed when you make new posts? Thanks

    Comment By miner game on January 31st, at 1:02 am

  18. 18

    IF YOU HAVE A MAC THAN READ THIS!
    for the ESC+x thing go into speech in system preferences then it will say turn speakable items on/off. TURN OFF! Then if it still doesn’t work go to the tab that says “text to speech” then uncheck the box that says “speak selected text when the key is pressed” or simply change the key to something you don’t use.

    Comment By Joe on February 4th, at 11:21 pm

  19. 19

    hey so i tried doing the thing to make .DS_store go away and it didnt work… i put in “defaults write com.apple.finder AppleShowAllFiles FALSE” and then it just ignored it… before when i tried the other method mentioned in the original (defaults write com.apple.finder AppleShowAllFiles False
killall Finder) i got this “2010-02-25 12:53:09.498 defaults[340:903] Unexpected argument Finder; leaving defaults unchanged.” its not that big od a deal but im kinda of freaking out here. I don’t really want to be spammed by this infernal document thing for the rest of my life.

    help anyone?

    Comment By Adri on February 25th, at 6:54 pm

  20. 20

    I personally like typing python in terminal and going at it :D

    Comment By es on February 27th, at 11:32 pm

  21. 21

    never mind some how it went away

    Comment By Adri on March 3rd, at 3:02 am

Leave a Reply

You can use: <a href> <h1 - h6> <acronym> <code> <em> <strike> <strong> <i> <b>