Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created June 2, 2023 09:37
Show Gist options
  • Save codecademydev/ada956d258c505b9ac949b5093dd278d to your computer and use it in GitHub Desktop.
Save codecademydev/ada956d258c505b9ac949b5093dd278d to your computer and use it in GitHub Desktop.
Codecademy export
public class MadLibs {
/*T his program generates a mad libbed story. Author: Sara Date: 2/19/2021 */
public static void main(String[] args){
String name1 = "Lucy";
String adjective1 = "tranquility";
String adjective2 = "amazing";
String adjective3 = "interesting";
String verb1 = "sway";
String noun1 = "tree";
String noun2 = "birds";
String noun3 = "snow";
String noun4 = "picnic";
String noun5 = "lake";
String noun6 = "fairie";
String name2 = "fairy";
int number = 2040;
String place1 = "Jupitor";
//The template for the story
System.out.println ("This morning "+name1+" woke up feeling "+adjective1+". 'It is going to be a "+adjective2+" day!' Outside, a bunch of "+noun1+"s were protesting to keep "+noun2+" in stores. They began to "+verb1+" to the rhythm of the "+noun3+", which made all the "+noun4+"s very "+adjective3+". Concerned, "+name1+" texted "+name2+", who flew "+name1+" to "+place1+" and dropped "+name1+" in a puddle of frozen "+noun5+". "+name1+" woke up in the year "+number+", in a world where "+noun6+"s ruled the world.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment