Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created June 23, 2019 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/552a71bc5fa0ff7dc5d7747c8db2390f to your computer and use it in GitHub Desktop.
Save codecademydev/552a71bc5fa0ff7dc5d7747c8db2390f to your computer and use it in GitHub Desktop.
Codecademy export
public class MadLibs {
/*
This program generates a Mad Libbed Story.
Author: Paul
Date: 05/19/2019
*/
public static void main(String[] args){
//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.";
String name1= "Paul";
String adjective1= "brave";
String adjective2= "crazy";
String adjective3= "amazing";
String verb1 = "running";
String noun1 = "army";
String noun2 = "communication";
String noun3 = "wealth";
String noun4 = "religion";
String noun5 = "village";
String noun6 = "city";
String name2= "Roger";
int number= 69;
String place1= "New York City";
System.out.println(story);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment