RCRPG/Julia: Difference between revisions

m
no edit summary
(Created page with "To use the color text feature, run within the Julia REPL. <lang julia>using Crayons struct Point x::Int y::Int z::Int end const obstacles = (wall = '\u2592', per...")
 
mNo edit summary
Line 1:
ToThis use[[Julia]] theversion colorof [[RCRPG]] implements a text feature,interface. When run within the Julia's command line REPL.,
it will display many of the game items in color.
 
==Language Idioms==
 
This program illustrates some of the interesting aspects of Julia:
* dynamic and optional data types
* multiple function dispatch used to select function behavior by data type
* built-in data structures including named tuples, vectors, matrices, and Dicts (hashes)
* functional programming with map and other functions using anonymous functions on arrays
 
== Objective ==
The objective of the game is to find your way to the treasure room, which is located in the upper left corner on level 5
(centered at (1, 1, 5)), and then to exit the game by ascending above level 1.
 
==Commands==
 
Direction commands:<pre>north, south, east, west, up, down</pre>Type the first letter of these commands
in order to go in a certain direction (n, s, e, w, u, d).
 
To exit a room, you must use the sledge to create a hole through the room wall, ceiling, or floor.
Make a hole by e(q)uipping a sledge (equip with q), and (a)ttacking the obstacle (attack with a).
 
To go down, there must be a pit in the floor where you are standing. Create a pit by (a)ttacking (d)own.
 
In order to go up, there must be a skylight in the ceiling where you are standing and you must have a ladder equipped.
Create a skylight with the sledge (attack up).
 
A sledge can be used indefinitely without losing it, but you lose your equipped ladder when you go up using that ladder.
 
Attack (dig with the sledgehammer) with the letter a. You must have a sledge equipped (equip with letter q) to do this.
 
Take gold and other items from room floor by standing over the item and then (t)aking with letter t.
 
Remove items with letter r for (r)emove. Removing equipped items will move to inventory,
removing inventory drops them on the dungeon floor.
 
Rooms for each a level remain only while you are on that level. Levels generate new rooms each time you renter them.
 
View inventory: Letter i.
 
Current r(o)om information: Letter o.
 
Help: Letter h.
 
==Code==
<lang julia>using Crayons
 
4,102

edits