100doors.frink

Download or view 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 "]


Download or view 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 20139 days, 7 hours, 6 minutes ago.