Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created November 17, 2020 10:47
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/ed35a98a3a0e118a4c59bbf954a730a1 to your computer and use it in GitHub Desktop.
Save codecademydev/ed35a98a3a0e118a4c59bbf954a730a1 to your computer and use it in GitHub Desktop.
Codecademy export
using System;
namespace MadLibs
{
class Program
{
static void Main(string[] args)
{
/*
This program Mad Libs word game! Mad Libs are short stories with blanks for the player to fill in that represent different parts of speech
Author: atifG
*/
// Let the user know that the program is starting:
Console.WriteLine("_________Mad Lib Game has begun!_________");
// Give the Mad Lib a title:
string title = "Title: Mad Lib";
Console.WriteLine(title);
// Define user input and variables:
//Asking for user's name
Console.Write("Enter a name: ");
string name = Console.ReadLine();
//Asking user for 3 adjectives words
Console.Write("Please enter 3 adjectives in the following 3 lines");
Console.Write("\nEnter 1st adjective: ");
string adjective1 = Console.ReadLine();
Console.Write("\nEnter 2nd adjective: ");
string adjective2 = Console.ReadLine();
Console.Write("\nEnter 3rd adjective: ");
string adjective3 = Console.ReadLine();
//Asking a verb from user
Console.Write("\nEnter one verb: ");
string verb1 = Console.ReadLine();
//Asking user for 2 noun words
Console.Write("\nEnter 1st noun: ");
string noun1 = Console.ReadLine();
Console.Write("\nEnter 2nd noun: ");
string noun2 = Console.ReadLine();
//Asking user for 2 noun words
Console.Write("\nDear user please enter few more details for us from the following questions (your likes or dislikes)");
Console.Write("\nEnter name of an animal: ");
string animal = Console.ReadLine();
Console.Write("\nEnter name of food: ");
string food = Console.ReadLine();
Console.Write("\nEnter name of a fruit: ");
string fruit = Console.ReadLine();
Console.Write("\nEnter name of a superhero: ");
string superhero = Console.ReadLine();
Console.Write("\nEnter name of a country: ");
string country = Console.ReadLine();
Console.Write("\nEnter name of a dessert: ");
string dessert = Console.ReadLine();
Console.Write("\nEnter year number: ");
string year = Console.ReadLine();
// The template for the story:
string story = $"This morning {name} woke up feeling {adjective1}. 'It is going to be a {adjective2} day!' Outside, a bunch of {animal}s were protesting to keep {food} in stores. They began to {verb1} to the rhythm of the {noun1}, which made all the {fruit}s very {adjective3}. Concerned, {name} texted {superhero}, who flew {name} to {country} and dropped {name} in a puddle of frozen {dessert}. {name} woke up in the year {year}, in a world where {noun2}s ruled the world.";
// Print the story:
Console.WriteLine(story);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment