RCRPG/Ruby: Difference between revisions

Content added Content deleted
(Created page with '{{collection|RCRPG}} This Ruby version of RCRPG implements a text interface. ==Language Idioms== This program illustrates some of the interesting aspects of Ruby: * obj…')
 
Line 18: Line 18:
Direction commands:<pre>north, south, east, west, up, down</pre>Type these in order to go in a certain direction. There must be a hole in the wall in that direction. All directions are aliased by their first letter (ie. you can go south by just typing s). In order to go up, you must have a ladder in your current room. In order to go down, the room below you must have a ladder in it.
Direction commands:<pre>north, south, east, west, up, down</pre>Type these in order to go in a certain direction. There must be a hole in the wall in that direction. All directions are aliased by their first letter (ie. you can go south by just typing s). In order to go up, you must have a ladder in your current room. In order to go down, the room below you must have a ladder in it.


Attack:<pre>attack &lt;<i>direction</i>&gt;</pre>Break a hole in the wall in the specified direction. You must have a sledge equipped to do this.
Attack:<pre>attack &lt;''direction''&gt;</pre>Break a hole in the wall in the specified direction. You must have a sledge equipped to do this.


Take/Drop:<pre>take &lt;<i>item</i>&gt;
Take/Drop:<pre>take &lt;item&gt;
drop &lt;<i>item</i>&gt;</pre>Pick up an item in the room, or drop an item from your inventory.
drop &lt;item&gt;</pre>Pick up an item in the room, or drop an item from your inventory.


View Inventory:<pre>inventory</pre>
View Inventory:<pre>inventory</pre>


Equip an item:<pre>equip &lt;<i>item</i>&gt;</pre>
Equip an item:<pre>equip &lt;item&gt;</pre>


Create an alias:<pre>alias &lt;<i>old command</i>&gt; &lt;<i>new command</i>&gt;</pre>Make it so that whenever you type <i>new command</i> it means the same thing as <i>old command</i>.
Create an alias:<pre>alias &lt;old command&gt; &lt;new command&gt;</pre>Make it so that whenever you type <i>new command</i> it means the same thing as <i>old command</i>.


==Code==
==Code==