fixes #1838
This commit is contained in:
parent
b5a8e34ae7
commit
9d0ae03918
4 changed files with 30 additions and 7 deletions
18
tests/iter/timplicit_auto.nim
Normal file
18
tests/iter/timplicit_auto.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# bug #1838
|
||||
|
||||
type State = enum Empty, Tree, Fire
|
||||
|
||||
const
|
||||
disp: array[State, string] = [" ", "\e[32m/\\\e[m", "\e[07;31m/\\\e[m"]
|
||||
|
||||
proc univ(x, y: int): State = Tree
|
||||
|
||||
var w, h = 30
|
||||
|
||||
iterator fields(a = (0,0), b = (h-1,w-1)) =
|
||||
for y in max(a[0], 0) .. min(b[0], h-1):
|
||||
for x in max(a[1], 0) .. min(b[1], w-1):
|
||||
yield (y,x)
|
||||
|
||||
for y,x in fields():
|
||||
stdout.write disp[univ(x, y)]
|
||||
Loading…
Add table
Add a link
Reference in a new issue