Data Sheet

86 : circuit 4c
CODE TO NOTE
ARRAY OF STRINGS:
const char* array_name [array_
length] =
{“string1”, “string2”...};
Makes an array of strings. The strings are stored
as constants, so they can’t be changed once the
program starts.
ROUNDING FUNCTION:
round(value_to_round);
This math function rounds a number up or down to
the nearest whole number.
RANDOM FUNCTION:
random(min, max);
This function takes a set of numbers and generates
a pseudo-random number from that set.
BUTTON DEBOUNCE:
delay(500);
This 500 millisecond delay at the end of the loop
adds button debounce so that erroneous button
presses are not detected by the RedBoard.
USER FUN FUNCTIONS TO NOTE
CTIONS
generateRandomOrder();
Makes an array that is a random ordering of the
numbers from 1–25. This is used to display words
for the game in a random order.
showStartSequence();
Shows the category of words on the LCD, then
displays a countdown before the game starts.
gameOver();
Plays a sound and shows the text “Game Over”
along with the player’s final score.
winner();
Shows the text “YOU WIN!” and
plays a winning sound.