Professional Documents
Culture Documents
{
lcd.clear();
lcd.print("How much in a bakers dozen?");
delay(1000);
for (int positionCounter = 0; positionCounter < 38; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("12");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("18");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("13");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("1");
delay(500);
lcd.clear();
delay(500);
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_C) //if answer C is chosen, print Correct
{
lcd.print("Correct");
}
else //else print Incorrect
{
lcd.print("Incorrect");
}
delay(2000);
lcd.clear();
}
{
lcd.clear();
lcd.print("How many quarts in a gallon?");
delay(1000);
for (int positionCounter = 0; positionCounter < 64; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("2");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("4");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("17");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("3");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_B)
{
lcd.print("Correct");
}
else
{
lcd.print("Incorrect");
}
delay(2000);
lcd.clear();
}
{
lcd.clear();
lcd.print("What sound do cows make?");
delay(1000);
for (int positionCounter = 0; positionCounter < 64; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("Milk");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("Oink");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("Neigh");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("Moo");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_D)
{
lcd.print("Correct");
}
else
{
lcd.print("Incorrect");
}
delay(2500);
lcd.clear();
}
}
void loop() {
lcd.print("Welcome to MLG JEOPARDY!!!");
for (int positionCounter = 0; positionCounter < 19; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
questionAsked = (random(10)); //generate a random number between 0 and 4
if (questionAsked = 1) //if the number generated is 1, then run the following code
{
lcd.clear();
lcd.print("What is the dankest meme?");
delay(1000);
for (int positionCounter = 0; positionCounter < 64; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("Pepe");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("Doge");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("Xx_Illuminati_xX");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("Ur mum");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_A)
{
lcd.print("Ur not dumb");
}
else
{
lcd.print("Ur trash m8!!!");
}
delay(2000);
lcd.clear();
}
if(questionAsked = 0);{
lcd.clear();
lcd.print("What is a meme?");
delay(1000);
for (int positionCounter = 0; positionCounter < 60; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("2 much dank");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("Pic w/ caption");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("Savagrey");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("MLG roasts");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_A)
{
lcd.print("Ur not dumb");
}
else
{
lcd.print("Ur dumb m8!!!");
}
delay(2000);
lcd.clear();
}
if (questionAsked = 2)
{
lcd.clear();
lcd.print("Who was the original dank meme?");
delay(1000);
for (int positionCounter = 0; positionCounter < 64; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("Troll");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("Roflcopter");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("u mad bro");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("Alfred E. Neuman");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_D)
{
lcd.print("Ur not trash");
}
else
{
lcd.print("Ur dumb m8!!!");
}
delay(2000);
lcd.clear();
}
if (questionAsked = 3)
{
lcd.clear();
lcd.print("What sound do cows make?");
delay(1000);
for (int positionCounter = 0; positionCounter < 64; positionCounter++) {
lcd.scrollDisplayLeft();
delay(275);
}
delay(2500);
lcd.clear();
lcd.print("A.");
lcd.setCursor(0,1);
lcd.print("Milk");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("B.");
lcd.setCursor(0,1);
lcd.print("Oink");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("C.");
lcd.setCursor(0,1);
lcd.print("Neigh");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("D.");
lcd.setCursor(0,1);
lcd.print("Moo");
delay(500);
lcd.clear();
delay(500);
int i, duration;
for (i = 0; i < songLength; i++)
{
duration = beats[i] * tempo;
if (notes[i] == ' ')
{
delay(duration);
}
else
{
tone(buzzerPin, frequency(notes[i]), duration);
delay(duration);
}
delay(tempo/10);
}
delay(750);
if (checkButton() == CHOICE_A)
{
lcd.print("Ur not dumb");
}
else
{
lcd.print("Ur trash m8!!!");
}
delay(2000);
lcd.clear();
}
}