Solution: Interactive Fiction Display
Understand the solution to the “Interactive Fiction Display” challenge.
We'll cover the following...
We'll cover the following...
Solution
Let's execute the following solution code and see how it works.
Press + to interact
def describe (cell)if cell.links.count == 1return "This is a dead-end."elsif cell.links.empty?return "There are no exits from this room"end%i( north south east west ).each do |direction|if cell.linked?(cell.send(direction))return "A passage goes #{direction}"endendputsend
...