let f (output:string) = stdout.WriteLine output let result = stdin.ReadLine() result = "locked" [0 .. 999] |> List.map(sprintf "%03d") |> List.takeWhile(f)