3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
7 # SEE: <http://rosettacode.org/wiki/100_doors>
9 # Generic unoptimized version.
13 var doors
= new Array[Bool].filled_with
(false, n
)
17 doors
[j
] = not doors
[j
]
23 if doors
[i
] then s
= "open" else s
= "closed"
24 print
"Door {i} is {s}."