Skip to content

Instantly share code, notes, and snippets.

@vinnitu
Created September 27, 2013 15:34
Show Gist options
  • Save vinnitu/6730541 to your computer and use it in GitHub Desktop.
Save vinnitu/6730541 to your computer and use it in GitHub Desktop.
topic: ~INTRODUCTIONS ()
?: () $$question = ?
u: (\[ _* \] _*) # grab params and main sentence
# sample sentence [ location:6 space:5 ] This is my input
# a param looks like location:100
@0 = ^burst('_0 " ") # get all variable assigns as facts
loop
{
$$tmp = first(@0subject) # pick off next param
_2 = ^burst($$tmp ":" ) # split word and value
_2 = ^join($ _2) # create variable
^_2 = _3 # do assignment onto variable
}
input('_1 $$question)
fail(sentence) # do sentence without params
u: (_*) _0 ^keep() ^repeat()
your position is ($x, $y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment