<<set $link = "[["+passage()+"]]">>\n//examining...//\n''a deck of cards'', dog-eared and held together with a rubber band that's about to snap\n\n<<if $loc is "edge of the cliff">>[[chuck it|goodbye][$inv.splice($inv.indexOf($link), 1)]]<<endif>>\n\n<<if previous() is "inv">>[[close|inv]] <<else>>[[take it|previous()][$inv.push($link); $pile.splice($pile.indexOf($link), 1);$new++]] or [[leave it|previous()]]<<endif>>
<<set $link = "[["+passage()+"]]">>\n//examining...//\n''a set of lost keys'', worn and shiny\n\n<<if $loc is "edge of the cliff">>[[chuck it|goodbye][$inv.splice($inv.indexOf($link), 1); $trash.push($link)]]<<endif>>\n\n<<if previous() is "inv">>[[close|inv]] <<else>>[[take it|previous()][$inv.push($link); $pile.splice($pile.indexOf($link), 1);$new++]] or [[leave it|previous()]]<<endif>>
<<set $link = "[["+passage()+"]]">>\n//examining...//\n''some crumpled bills'', that might be enough to get you a cup of coffee\n\n<<if $loc is "edge of the cliff">>[[chuck it|goodbye][$inv.splice($inv.indexOf($link), 1)]]<<endif>>\n\n<<if previous() is "inv">>[[close|inv]] <<else>>[[take it|previous()][$inv.push($link); $pile.splice($pile.indexOf($link), 1);$new++]] or [[leave it|previous()]]<<endif>>
<<set $link = "[["+passage()+"]]">>\n//examining...//\n''a broken watch'', that doesn't really tell you anything\n\n<<if $loc is "edge of the cliff">>[[chuck it|goodbye][$inv.splice($inv.indexOf($link), 1)]]<<endif>>\n\n<<if previous() is "inv">>[[close|inv]] <<else>>[[take it|previous()][$inv.push($link); $pile.splice($pile.indexOf($link), 1);$new++]] or [[leave it|previous()]]<<endif>>
<<set $link = "[["+passage()+"]]">>\n<<if $fruit == 0>><<$inv.splice($inv.indexOf($link),1 )>><<endif>>\n//examining...//\n''<<if $fruit == 1>>a piece<<else>><<$fruit>> pieces<<endif>> of fruit'', from the tree that grows a little ways back from the cliff\n\n<<if $loc is "edge of the cliff">>[[chuck some|goodbye][$fruit--]]<<endif>>\n\n[[close|inv]]
a sandbox
//--[[about]]//
[[@modgethanc|http://twitter.com/modgethanc]]
[[inventory|inv]]<<if $new > 0>>(+<<$new>>)<<endif>>\n<<if not visited("under the tree")>><<else>>location: \n[[$loc]]<<endif>>
movement_test_items.tw
body, nav, #sidebar, #storyTitle, #storySubtitle {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}
this is a sandbox for building a world model in twee. \n\nmain features are inventory, location tracking, object interactions.\n\nobjects have context-sensitive actions that depend on your location.\n\n[[close|previous()]]
<<silently>>\n<<set $new = 0>>\n<<if ($fruit < 1) and ($inv.indexOf("[[fruit]]") != -1)>><<$inv.splice($inv.indexOf("[[fruit]]"),1 )>><<endif>>\n<<endsilently>>\n\n//inventory://\n<<if $inv.length == 0>>nothing.<<endif>>\s\n<<print $inv.join(", ")>>\n\n[[close|$loc]]
<<nobr>>\n<<set $inv = []>>\n<<set $loc = passage()>>\n<<set $pile = ["[[deck of cards]]", "[[lost keys]]", "[[crumpled bill]]", "[[broken watch]]"]>>\n<<set $fruit = 0>>\n<<set $fruitRemaining = 8>>\n<<endnobr>>\nhey, you.\n\nlet's try something[[...|under the tree]]
<<set $loc = passage()>>\n<<if $pile.length > 0>>under the fruit tree, there is a [[pile of objects]]. <<else>>it's neat and tidy under the fruit tree.<<endif>>\n\n<<if $fruitRemaining > 0>><<set $item = "[[fruit]]">>if you want, you can <<if $fruit == 0>>[[pick some fruit|passage()][$inv.push($item);$fruit++;$fruitRemaining--;$new++]].<<else>>[[pick some fruit|passage()][$fruit++;$fruitRemaining--;$new++]].<<endif>><<else>>the fruit tree is bare.<<endif>>\n\nthese sorts of things might prepare you to go to the [[edge of the cliff]].
<<if $pile.length > 0>> //examining...//\n\na pile of objects:\n<<set $item= "[[deck of cards]]">><<if $pile.indexOf($item) != -1>>* <<print $item>><<endif>>\s\n<<set $item= "[[lost keys]]">><<if $pile.indexOf($item) != -1>>* <<print $item>><<endif>>\s\n<<set $item= "[[crumpled bill]]">><<if $pile.indexOf($item) != -1>>* <<print $item>><<endif>>\s\n<<set $item= "[[broken watch]]">><<if $pile.indexOf($item) != -1>>* <<print $item>><<endif>>\s\n<<else>>//not much to do here...//<<endif>>\n[[close|$loc]]
<<set $trash = []>>\n<<set $loc = passage()>>\nthere's nothing of great interest at the edge of the cliff, so you might as well go back to standing [[under the tree]].\n\nif there's anything you want to throw away, though, this is a good place to [[do it|inv]].
<<if $inv.length > 1>>out into the abyss it goes. hope you weren't planning on getting it back.<<else>>with a quiet sigh of relief, you pitch the last thing you're holding into the abyss.<<endif>>\n\n<<if (previous() == "fruit") and ($fruit > 0)>>[[...|fruit]]<<else>>[[...|inv]]<<endif>>