Source

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

Full commit
module: doors

define method to_open(x :: <boolean>)
    if (x) "open" else "closed" end
end;

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, to_open(doors[x - 1]))
  end
end;

doors();