Created
August 8, 2015 20:30
-
-
Save freshcutdevelopment/0528b325aec0e06b31b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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