1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-10 05:17:43 +00:00

Updare examples. Delete ugly iterator example.

This commit is contained in:
Calvin Rose
2018-11-26 22:09:12 -05:00
parent f860b950fc
commit ea4465f58e
5 changed files with 12 additions and 125 deletions

View File

@@ -25,11 +25,8 @@
[state x1 y1 x2 y2]
(def cellset @{})
(loop [cell :in state] (put cellset cell true))
(loop [:before (print "+" (string.repeat "--" (inc (- y2 y1))) "+")
:after (print "+" (string.repeat "--" (inc (- y2 y1))) "+")
x :range [x1 (+ 1 x2)]
:before (file.write stdout "|")
:after (file.write stdout "|\n")
(loop [x :range [x1 (+ 1 x2)]
:after (print)
y :range [y1 (+ 1 y2)]]
(file.write stdout (if (get cellset (tuple x y)) "X " ". ")))
(print))