Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.27 KB | None | 0 0
  1. // Learn more about F# at http://fsharp.org
  2.  
  3. open System
  4.  
  5.     let rec askForFoodSize (isFirst: bool) =
  6.         if(isFirst) then printfn "Please select small, medium or large"
  7.         let input = Console.ReadLine()
  8.         match input with
  9.         | "small" ->
  10.             printfn "okay, tiny bitch"
  11.         | "medium" ->
  12.             printfn "fair enough"
  13.         | "large" ->
  14.             printfn "phat ass bitch"
  15.         | _ ->
  16.             printfn "try again"
  17.             askForFoodSize (false)
  18.  
  19.        let rec askForFoodChoice () =
  20.         printfn "please choose one of the options"
  21.         let input = Console.ReadLine()
  22.         match input with
  23.         | "salad" ->
  24.             printfn "Healthy choice"
  25.             askForFoodSize (true)
  26.         | "sandwich" ->
  27.             printfn "good enough"
  28.             askForFoodSize (true)
  29.         | "cake" ->
  30.             printfn "naughty bitch"
  31.             askForFoodSize (true)
  32.         | _ ->
  33.             printfn "try again"
  34.             askForFoodChoice ()
  35.  
  36.  
  37. [<EntryPoint>]
  38. let main argv =
  39.     printfn "We have:"
  40.     printfn "Salad"
  41.     printfn "Sandwich"
  42.     printfn "Cake"
  43.     askForFoodChoice ()
  44.  
  45.     printfn "Press any key to exit"
  46.     Console.ReadKey() |> ignore
  47.     0 // return an integer exit code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement