Copy and paste into the Arduino IDE the following code, (then control T, to align) If there is a problem, save, close, and reopen, (works best with Google Chrome):

/*This program embellishes on a program from my upcoming book
Coding the Arduino by Bob Dukish, coming soon to Apress.
It randomly picks a number from 1 to 100, and you bet if the next will be higher or lower.
The game is setup to cheat you, by repicking the number up to three times, to make you lose.
It displays information on the serial monitor, and uses a Hitachi standard 16 by 2 LCD display
and the LiquidCrystal library from the Arduino IDE, you can include it from the menu, or type in the code.
You can use one or the other, or both displays.*/

#include <LiquidCrystal.h> //LCD library
//match LCD pins to Arduino pins
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd (rs, en, d4, d5, d6, d7);
int randomNum1;
int randomNum2;
const int button = 10;
const int low = 11;
const int high = 12;
boolean lower;
boolean higher;
int start;
int counter;
int looping;
void setup () {
pinMode (button, INPUT_PULLUP);
pinMode (low, INPUT_PULLUP);
pinMode (high, INPUT_PULLUP);
randomSeed(analogRead(5));
Serial.begin (9600);
Serial.println ("Ground pin 10 to start ");
lcd.begin (16, 2); //sets columns and rows
lcd.setCursor (0,0);
lcd.print ("pin 11 - lower");
lcd.setCursor (0,1);
lcd.print ("pin 12 - higher");
delay(4000);
lcd.clear();
lcd.setCursor (0,0);
lcd.print ("pin 10, to start");
}
void loop () {
higher = 0;
lower = 0;
start = digitalRead(button);
if (start == LOW){ //game begins
lcd.clear(); //code from library to clear
randomNum1 = random (1, 100);
Serial.println (" ");
Serial.println ("_____________________");
Serial.println ("Playing between 1 and 99:");
delay (1500);
Serial.print ("The computer generated number is ");
Serial.println (randomNum1);
lcd.setCursor (0,0);
lcd.print ("1st number ");
lcd.print (randomNum1);
delay(2000);
Serial.println (" ");
Serial.println ("Do you think the next computer number will be higher or lower?");
delay(2000);
Serial.print (" (ground Pin 11 for Lower, or Pin 12 for Higher) ");
Serial.println (" ");
Serial.println (" ");
for (looping = 0; looping < 20000; looping++){
lower = digitalRead (low);
higher = digitalRead (high);
if ((lower == LOW) || (higher == LOW)){ //pipe symbol is under the backspace on the keyboard
break; //breaks out of delay if a choice is made
}
delay (10); //with looping causes a 200 sec delay to pick (3.3 minutes)
}
Rerun:
randomNum2 = random (1, 100);
counter = counter + 1;
if (counter % 4 !=0){ //so counter mod 4, not = 0, the cheat code runs (you are mod dividing randomNum2 counter by 4. This is explained in the notes)
if (higher == LOW && randomNum2 > randomNum1){
Serial.print ("cheated ");
Serial.print (counter);
Serial.println (" times");
goto Rerun; //repicks for a lower number up to 3 times to cheat
}
if (lower == LOW && randomNum2 < randomNum1){
Serial.print ("cheated ");
Serial.print (counter);
Serial.println (" times");
goto Rerun; //repicks the second number until it is higher
}
}//end of counter section
Serial.println (" ");
Serial.print("The Second number is "); //after 3 cheats if needed, gives real number
Serial.println (randomNum2);
lcd.setCursor (0,1);
lcd.print ("2nd ");
lcd.print (randomNum2);
Serial.println (" ");
Serial.println ("*****");
Serial.println (" ");
if (randomNum1 == randomNum2){
Serial.println ("It's a Draw___Play Again"); //the random numbers were equal
lcd.print (" Draw");
}
else if (higher == LOW && randomNum1 < randomNum2){
Serial.println("You WIN !!! ");
lcd.print (" You Win");
}
else if (lower == LOW && randomNum1 > randomNum2){
Serial.println("You WIN !!!");
lcd.print (" You WIN");
}
else {
Serial.println ("You Lose");
lcd.print (" You lose");
}
delay(2000);
Serial.println (" ");
Serial.println ("Ground pin 10 to play again ");
counter = 0; //reset variables
} //end of game
} //end of main loop


Notes:

In the cheating section the use of Modulus Division is a bit of overkill. Limiting the counter to, as many, as three trips around could have been done with the conditional statement: while (counter < 4) {
}
A "for condition" from 1 to 3, could also do the trick: for (counter = 1; counter < 4; counter++){ } But the next section in the book explains Mod Division, so that's why we used it. Mod Division only returns a remainder. The result will have no remainder when the dividend (top of the fraction) equals the divisor (bottom of the fraction), or for multiples. An example is 8/4 = 2 with no decimal remainder. An example for using Mod Division could be in an adult beverage factory producing 6-packs using Mod 6 Division. The counter could keep incrementing for the total can count, but the Mod 6 Division will only have a remainder of zero for each 6-pack produced. Look for the book to come out this Summer.