Created
December 22, 2013 02:43
-
-
Save JohnEarnest/8077858 to your computer and use it in GitHub Desktop.
A text adventure game framework written in Loko-compatible Logo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to command | |
local 'x readlist | |
unless word? first :x | |
[pr [?] output command] | |
output first :x | |
end | |
to select :verb :ops :default | |
if empty? :ops [default :verb stop] | |
if equal? first :ops :verb | |
[run first butfirst :ops stop] | |
select :verb butfirst butfirst | |
:ops :default | |
end | |
to balk :verb | |
pr [I do not understand.] | |
end | |
to choose :ops | |
select command :ops :balk | |
end | |
to play | |
room play | |
end | |
to northroom | |
pr [The north room... exit south.] | |
choose [ | |
s [make 'room :startroom] | |
] | |
end | |
to eastroom | |
pr [The east room... exit west.] | |
choose [ | |
w [make 'room :startroom] | |
] | |
end | |
to startroom | |
pr [You are in a small room.] | |
pr [Exits lead north and east.] | |
choose [ | |
n [make 'room :northroom] | |
e [make 'room :eastroom ] | |
] | |
end | |
to adventure | |
local 'room :startroom | |
pr [Welcome to the Adventure!] | |
play | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment