repl.it
@log4code/

F#_guessing_02_GameLoop

F#

Second iteration of the game loop to use sequences instead of recursion

fork
loading
Files
  • main.fs
  • FSharp.Core.dll
  • main.exe
main.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
open System

let printPrompt () = 
    Console.Write "guess:>"

let getLine = fun _ -> 
    printPrompt ()
    System.Console.ReadLine ()

let writeResponse (s:string) =
    printfn "You typed: %s" s

let progLoop () =
    let lines = Seq.initInfinite getLine
    Seq.iter writeResponse lines

[<EntryPoint>]
let main argv = 
    progLoop () |> ignore
    0
Fetching token
?