Skip to content

Instantly share code, notes, and snippets.

@freshcutdevelopment
Created August 8, 2015 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freshcutdevelopment/0528b325aec0e06b31b3 to your computer and use it in GitHub Desktop.
Save freshcutdevelopment/0528b325aec0e06b31b3 to your computer and use it in GitHub Desktop.
open System
type story = {verb:string;noun:string;adjective:string;adverb:string}
let getResponse choice =
match choice with
| "yes" -> "That's hilarious. \n"
| "no" -> "That sucks. \n"
| _ -> "I don't even know how to respond to that. \n"
[<EntryPoint>]
let main argv =
"Verb:" |> Console.WriteLine
let verb = Console.ReadLine()
"Noun:" |> Console.WriteLine
let noun = Console.ReadLine()
"Adjective" |> Console.WriteLine
let adjective = Console.ReadLine()
"Adverb" |> Console.WriteLine
let adverb = Console.ReadLine()
"Do you like comedy?" |> Console.WriteLine
let choice = Console.ReadLine()
let myStory = {verb =verb; noun=noun; adjective=adjective; adverb=adverb}
let message = sprintf "Do you %s your %s %s %s? \n" myStory.verb myStory.adjective myStory.noun myStory.adverb
let response = getResponse choice
printf "%s%s" message response
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment