Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created January 14, 2022 03:01
Show Gist options
  • Save codecademydev/69816e3c7f664303298826bb96662d5a to your computer and use it in GitHub Desktop.
Save codecademydev/69816e3c7f664303298826bb96662d5a to your computer and use it in GitHub Desktop.
Codecademy export
public class MadLibs {
/*
This program generates a mad libbed story.
Author: Murii
Date: 01/13/2022
*/
public static void main(String[] args){
String name1 = "Emily";
String name2 = "Alex";
String adjective1 = "happy";
String adjective2 = "great";
String adjective3 = "mad";
String verb1 = "shout";
String noun1 ="vegans";
String noun2 ="bananas";
String noun3 ="beat";
String noun4 = "bosses";
String noun5 = "snow";
String noun6 = "apes";
String place1 = "Russia";
int number = 2100;
//The template for the story
String story = "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.";
System.out.println(story);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment