Skip to content

Instantly share code, notes, and snippets.

@logankilpatrick
Created January 2, 2022 15:31
Show Gist options
  • Select an option

  • Save logankilpatrick/9334e6f92539e4519a27b0ee20952796 to your computer and use it in GitHub Desktop.

Select an option

Save logankilpatrick/9334e6f92539e4519a27b0ee20952796 to your computer and use it in GitHub Desktop.
# Mad Libs in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
function play_mad_libs()
print("Enter a verb (action): ")
verb1 = readline()
print("Enter an adjective (descriptive word): ")
adj1 = readline()
print("Enter a noun (person place or thing): ")
noun1 = readline()
print("Enter another noun (person place or thing): ")
noun2 = readline()
print("Enter a catchphrase (something like 'hands up!'): ")
phrase1 = readline()
base_sentence = "John $verb1 down the street one night, playing with his $adj1 $noun1. When all of a /
sudden, a $noun2 jumped out at him and said $phrase1"
print("\n\n", base_sentence)
end
play_mad_libs()
@logankilpatrick
Copy link
Copy Markdown
Author

logankilpatrick commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment