^ ^ ^ ^ ^ |######|#####|######|#####| # # # # # # # T T T T # # # # # ^ T T T T ^ | % | # %%% # # T T % T T # # % # # GGG # # T T GGGGG v T # # GGXGG # # t # ^ T T T T ^ | | # # # T T T T # # # # # # H N # ^ ^ H H ^ ^ |######|##H H##|######| @ * 2 * @ : turn 'key @ dup 'w = [ 'U %move done! ] ? dup 'a = [ 'L %move done! ] ? dup 's = [ 'D %move done! ] ? dup 'd = [ 'R %move done! ] ? drop ; * G * T : no-shovel? 'has-shovel @ '#nothing = [ "It's a grave.\n" %say done! ] ? ; : count-graves 'graves-dug @ dup '#nothing = [ drop 0 ] ? 1 + 'graves-dug =@ ; : dig-grave count-graves "You dig the\ngrave.\n" %say %remove ; : found-key? 'graves-dug @ 4 = [ "You found a key!\n" %say t 'grave-key =@ done! ] ? ; : touch no-shovel? dig-grave found-key? * X : no-key 'grave-key @ '#nothing = [ "It's the grave\n" %say "of rich man\n" %say "Jimothy. They\n" %say "say his tumb\n" %say "holds a fortune.\n" %say "The key is\n" %say "buried\n" %say "somewhere...\n" %say done! ] ? ; : has-key "The fortune is\n" %say "is yours!\n" %say "[You Win!]\n" %say %remove ; : touch no-key has-key ; * t : touch "You pick up a\n" %say "shovel\n" %say %remove 'yea 'has-shovel =@ ; * w