Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment