Peter Cooper : UK Web 2.0 and Ruby on Rails consultant
Recent Posts
»Jay-Z: From Brooklyn to the Boardroom
»Prank Caller Submits Girl To Sexual Torture By Proxy
>Full archive
Other Posts
« Electricity Bill (or Our Resources)German Forklift Video »

Write a text adventure in Ruby in minutes


As a demo of how agile Ruby is when dealing with objects, I've knocked up a quick text adventure. The source code is here. Every location is an object, and it's easy to extend.

And then I've followed up with a slightly more complex version which implements items and lets you pick them up and drop them in different locations. Some of the Ruby isn't as compact as it could be, but it's designed for Ruby newcomers to get a feel for how objects and the basic control structures work.




April 11, 2006 | Posted by peter | Comments (1)
Comments

excellent stuff. thats exactly what i was looking for (i'm playing around with writing a menu driven Ruby app).

what would be even nicer would be an ncurses version - theres an ncurses ruby extension available here:

http://ncurses-ruby.berlios.de/

Posted by: justin at April 12, 2006 12:33 PM

Return to the homepage.
Privacy Policy