123456789101112131415161718 |
- open System
-
- let r = Random()
- let secretNum = r.Next(1, 100)
- printfn "Secret Num is between 1-100"
- let mutable found = false
- while (not found) do
- printfn "Enter a guess:"
- let guess_s = Console.ReadLine()
- let guess = Convert.ToInt32(guess_s)
- match guess with
- | guess when secretNum = guess ->
- printfn "You guessed correctly!"
- found <- true
- | guess when guess > secretNum ->
- printfn "Lower"
- | _ ->
- printfn "Higher"
|