Here's some feedback on what you have done, and I've given you some code which will help refine your thinking.
First, I would change the way that your button is wired, so that pinMode is INPUT_PULLUP, and the switch is from the digital pin to ground. This will reverse the logic so that LOW is when the button is pressed. This is a safe, reliable way to use a push button and does not require an external pull down or pull up resistor.
I suggest that the way to cycle through your questions is with a switch/case tree. See https://www.arduino.cc/en/Reference/SwitchCase
Your lcd management will just be written within each case.
I have set the random selection to cycle through 10 questions without immediate repeats, but still a question can repeat. If you don't want any repeating questions in your cycle, you will need to replace the current approach with a "random shuffle".
Take a look at this. Refine your thinking on the presentation of the random questions and come back with another sketch for review.
// this constant won't change:
const int buttonPin = 6; // the pin that the pushbutton is attached to
const int ledPin = 13; // the pin that the LED is attached to
// Variables will change:
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
byte questionNumber; //variables for switch case
byte lastQuestionNumber;
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd2(12, 10, 5, 4, 3, 2);
void setup() {
// initialize the button pin as a input:
//pinMode(buttonPin, INPUT);
pinMode (buttonPin, INPUT_PULLUP);
// initialize the LED as an output:
pinMode(ledPin, OUTPUT);
// initialize serial communication:
Serial.begin(9600);
Serial.println("what?");
randomSeed(analogRead(A0));//randomize random number sequence
// set up the LCD's number of rows and columns:
lcd.begin(20, 4);
// Print a message to the LCD.
lcd.print("Player 1");
lcd2.begin(20, 4);
// Print a message to the LCD.
lcd2.print("PLayer 2");
}
void loop() {
// read the pushbutton input pin:
buttonState = digitalRead(buttonPin);
// compare the buttonState to its previous state
if (buttonState != lastButtonState) {
// if the state has changed, increment the counter
if (buttonState == LOW) { //reverse the logic
// if the current state is LOW then the button
// went from off to on:
//buttonPushCounter++;
//Serial.println("on");
//Serial.print("number of button pushes: ");
//Serial.print(buttonPushCounter);
Serial.println("Call Question Number");
//Serial.println(random(1,11));
questionNumber = random(1, 11);
if (questionNumber == lastQuestionNumber)
return;
} else {
// if the current state is LOW then the button
// wend from on to off:
Serial.println("off");
}
// Delay a little bit to avoid bouncing
delay(50);
}
// save the current state as the last state,
//for next time through the loop
lastButtonState = buttonState;
if (questionNumber != lastQuestionNumber)
{
lastQuestionNumber = questionNumber;//prevent constant looping before another question called
switch (questionNumber) {
case 1:
Serial.println("This is Question 1");
break;
case 2:
Serial.println("This is Question 2");
break;
case 3:
Serial.println("This is Question 3");
break;
case 4:
Serial.println("This is Question 4");
break;
case 5:
Serial.println("This is Question 5");
break;
case 6:
Serial.println("This is Question 6");
break;
case 7:
Serial.println("This is Question 7");
break;
case 8:
Serial.println("This is Question 8");
break;
case 9:
Serial.println("This is Question 9");
break;
case 10:
Serial.println("This is Question 10");
break;
}
}
}