|| :: play a guessing game from 1 to 100 | :: play a guessing game from $min to $max | :: . pick a number from $min to $max . begin game loop | :: begin game loop | :print: enter a guess :: . read a number . compare guess with target . decide on next step | :: pick a number from $min to $max | :target: $n :@js: "$n = Math.floor(Math.random() * (100 - 1) + 1)" | :: read a number | :comment: replacing this with a hardcoded number because i can't figure js out :guess: 48 | :: compare guess with target :guess: $n :target: $n | :state: win | :: compare guess with target :guess: $n :target: $m | :state: $state :target: $m :@js: " if tonumber($n) < tonumber($m) then $state = "too low" else $state = "too high" end " | :: decide on next step :state: "win" | :print: "you win!" | :: decide on next step :state: $s | :print: $s :: begin game loop