diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-13 19:41:58 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-13 19:41:58 -0700 |
| commit | bccfe9d8e12ba024c745cd533f73987439c76499 (patch) | |
| tree | c2df6f49a9a6ddae962140848da02fd446b50d4b /examples/sample_game.nom | |
| parent | 56f014a4884d7df387ff2ffa34fa95f1cc8b1f16 (diff) | |
Changed tokenizing to treat symbols as their own things.
Diffstat (limited to 'examples/sample_game.nom')
| -rw-r--r-- | examples/sample_game.nom | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/sample_game.nom b/examples/sample_game.nom index 3698fb4..a6a792d 100644 --- a/examples/sample_game.nom +++ b/examples/sample_game.nom @@ -30,7 +30,7 @@ with secrets: | return t; |end}); - rule [inventory] =: dict: + rule [inventory] =: dict (..) [%inv's "key", dict (%entry for %entry in (entries in (%inv's "value")))] ..for %inv in (entries in (secret %inventory)) @@ -207,16 +207,16 @@ propose: rule [vote for %candidate] =: for %c in (secret %candidates): if (%c == %candidate): - go to %candidate-is-legit + go to %candidate_is_legit error ".." |Invalid candidate: \(%candidate) - -> %candidate-is-legit + -> %candidate_is_legit (secret %votes)->(you) =: %candidate - %vote-percent = ((number of (votes for %candidate)) / (number of (everyone))) + %vote_percent = ((number of (votes for %candidate)) / (number of (everyone))) say ".." - |Vote cast. \(%candidate) now has \(100 * %vote-percent)% of the votes. - if (%vote-percent > 0.5): + |Vote cast. \(%candidate) now has \(100 * %vote_percent)% of the votes. + if (%vote_percent > 0.5): secret %winner = %candidate after winning a fair election do (secret %action) close the election |
