Text-based games suggestions?
May 7, 2004 10:07 AM   Subscribe

What are some good text-based (ala BASIC and Lunar Lander, etc) games that would be fun to OOP? Something little kids could enjoy, but more importantly, dad could learn to program without going into GUIs.
posted by grefo to Sports, Hobbies, & Recreation (11 answers total)
Tetris can be done with just text...a 10x40 array of chars can represent the playing board.

Snake games work well with text too.
posted by skwm at 10:17 AM on May 7, 2004

Tic-Tac-Toe is a good place to start.
posted by falconred at 10:18 AM on May 7, 2004

If you want to be limited to text, you might be interested in writing interactive fiction (aka "text adventures"). There are some special-purpose languages designed for this task; Inform and TADS are the most popular, and both of them let you concentrate on programming the game world rather than worrying about messy business like parsing the input. Both are quite object-oriented in nature. Whether or not little kids could enjoy the games probably depends on the value of "little".

If you want to stick with action-type games, I don't see much of a compelling reason to shy away from programming with graphics. If you use a nice library such as SDL or pygame, you will only need to generate simple commands like "draw this image in that location." It's not really much more difficult than the analogous text command: "draw this character in that location." In other words, using text is not a huge simplification over using graphics, and it limits your possibilities a lot.
posted by Galvatron at 10:35 AM on May 7, 2004

i remember writing frogger with display as a bunch of strings. ah, the nostalgia...
chess can be played using a simple text notation (e2-e4), but maybe that's better left 'til your second project.
posted by andrew cooke at 11:22 AM on May 7, 2004

Galvatron: yeah, but you have to create the images to begin with, right?
posted by bingo at 11:36 AM on May 7, 2004

True, you do need to create (or perhaps borrow) some images. But a game on the order of Lunar Lander can have awfully simple graphics--maybe an hour or two worth of effort.
posted by Galvatron at 12:40 PM on May 7, 2004

Hunt the Wumpus!
posted by ulotrichous at 1:17 PM on May 7, 2004

Hangman. You could have each letter be an object, and then ask it whether it should be shown or not after each guess. :)
posted by smackfu at 4:19 PM on May 7, 2004

I wrote Tetris and Pacman in object oriented Pascal back in college. As long as you can tell your compiler to make a square with certain coordinates, you shouldn't need a GUI interface.
posted by PrinceValium at 6:30 PM on May 7, 2004

Back in the day (am I old now?), I taught myself to program from books like David H. Ahl's Basic Computer Games (online scans of entire book). The programs are short and simple enough that you should be able to translate them to whatever language you are working with.

The harder part would be coming up with something that could hold the attention of modern kids.
posted by D.C. at 7:53 PM on May 7, 2004

From D.C.'s link, I'd say that Animal can hold the attention of modern kids.
posted by vacapinta at 9:54 PM on May 7, 2004

« Older How can I check remotely whether the garage door...   |   Netscreen FR114P Firewall Newer »
This thread is closed to new comments.