Here's an interesting programming puzzle (thanks Nige). The challenge is to write a (stateless?) control function for a warrior, and have it fight its way up the stairs to the next level. This is the level I'm stuck on:Level 6
The wall behind you feels a bit further away in this room. And you hear more cries for help.
Tip: You can walk backward by passing ':backward' as an argument to walk!. Same goes for feel, rescue! and attack!. --------
|C @ S aa|
--------
> = Stairs
@ = groo (20 HP)
C = Captive (1 HP)
S = Thick Sludge (24 HP)
a = Archer (7 HP)
Available Abilities:
warrior.walk!
Move in given direction (forward by default).
warrior.rest!
Gain 10% of max health back, but do nothing more.
warrior.feel
Returns a Space for the given direction (forward by default).
warrior.health
Returns an integer representing your health.
warrior.rescue!
Rescue a captive from his chains (earning 20 points) in given direction (forward by default).
warrior.attack!
Attack the unit in given direction (forward by default).
Give it a shot.
Agile Retroflection of the Day
-
Yves Hanoulle asks, “If you could change 1 thing today what would it be?” as
the first question in his Agile Retroflection of the Day project. Today
being ...
3 days ago

0 comments:
Post a Comment