Source

dylan-programs / dylan-programs / hello / doors.dylan

Full commit
module: doors

define method doors()
  let doors = make(<vector>, fill: #f, size: 100);
  for (x from 0 below 100)
    for (y from x below 100 by x + 1)
      doors[y] := ~doors[y]
    end
  end;
  for (x from 1 to 100) 
      format-out("door %d %s\n", x, if (doors[x - 1]) "open" else "closed" end)
  end
end;

doors();