I started by declaring a function which returns an enum:
HazardType check_for_hazards(uint8_t room_idx) { if (room_idx == bat1_room || room_idx == bat2_room) { return BAT; } else if (room_idx == pit1_room || room_idx == pit2_room) { return PIT; } else if (room_idx == wumpus_room) { return WUMPUS; } else { return NONE; } }
Hunt_The_Wumpus:-1: error: 'HazardType' does not name a type
enum HazardType { NONE=0, BAT=1, PIT=2, WUMPUS=4 }; HazardType check_for_hazards(uint8_t room_idx);
#include "Hunt_The_Wumpus.h"
void read_button_clicks() { static uint8_t last_buttons = 0; uint8_t buttons = lcd.readButtons(); clicked_buttons = (last_buttons ^ buttons) & (~buttons); last_buttons = buttons; }