100doors.frink

View or download 100doors.frink in plain text format


// Solution for the "100 doors" problem.
// http://rosettacode.org/wiki/100_doors

doors = new array[[101], false]
for pass=1 to 100
   for door=pass to 100 step pass
      doors@door = ! doors@door

print["Open doors:  "]
for door=1 to 100
   if doors@door
      print["$door "]


View or download 100doors.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 18014 days, 16 hours, 44 minutes ago.