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 17592 days, 6 hours, 32 minutes ago.