Fix some bugs

This commit is contained in:
Neale Pickett 2019-10-19 23:17:06 -06:00
parent 7474cbd60d
commit b5786f568b
2 changed files with 16 additions and 8 deletions

View File

@ -1,7 +1,7 @@
BOARD = --board esp8266:esp8266:nodemcuv2
verify: hello.ino
verify: badge.ino
arduino --verify $(BOARD) $<
install: hello.ino
install: badge.ino
arduino --upload $(BOARD) $<

View File

@ -30,6 +30,11 @@ char *badges[][4] = {
"Cybersecurity Educator",
"Los Alamos National Laboratory",
},
{
"Neale", "Pickett",
"Los Alamos National Laboratory",
"",
},
{
"Neale", "Pickett",
"",
@ -86,7 +91,7 @@ struct Room rooms[] = {
"into the forest to the east. In one corner of\n"
"the house there is a small window which is open."
),
1, 4, 7, 2,
1, 4, 12, 2,
},
{
// 4
@ -214,7 +219,7 @@ struct Room rooms[] = {
},
{
// 15
"Neale Pickett",
"--== Neale Pickett ==--",
(
"YOU ARE LIKELY TO BE\n"
"EATEN BY A GRUE\n"
@ -305,18 +310,21 @@ void loop()
next = rooms[where].west;
break;
case 2: // center
if (where == 14) {
// Easter egg!
next = start;
} else {
if (where == start) {
// Cycle through badges
badgeno += 1;
if (badges[badgeno][0] == NULL) {
badgeno = 0;
}
showBadge();
} else if (where == 14) {
// Easter egg!
next = start;
} else {
// Show whatever badge was last shown
where = start;
next = -1;
showBadge();
}
break;
case 3: // right