#include //Enables writes to flesh #include //AVRs interrupt library #include //AVRs delays (They don't use timers) /* DS1302 IO pins */ #define RTC_CLK 18 #define RTC_IO 17 #define RTC_CE 16 /*Uesfull RTC registers*/ #define STATUS_READ 0xC1 #define STATUS_WRITE 0xC0 #define STAT_READ 0xC3 #define STAT_WRITE 0xC2 #define HOUR_READ 0x85 #define HOUR_WRITE 0x84 /* shift register IO pins */ #define LatchPin 10 #define DataPin 11 #define ClockPin 13 /* buttons pins */ #define B_U_R 5 #define B_U_L 8 #define B_D_R 6 #define B_D_L 7 /* piezzo pin */ #define PIEZZO 19 /*Stats places in the stats array*/ #define HLT 0 #define WGT 1 #define HPN 2 #define HNR 3 #define AGE 4 /* This is the frames for the tamagotchi, they are stored in flesh ie program memory to not waste the RAM*/ prog_uchar frames[155][16][2] PROGMEM = { {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010010,0b01001000},{0b00010001,0b10001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//0 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010010,0b01001000},{0b00010001,0b10001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//1 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010100,0b00101000},{0b00010011,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//2 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010100,0b00101000},{0b00010011,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//3 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//4 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//5 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010100,0b00101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//6 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010100,0b00101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//7 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010010,0b01001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010100,0b00101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//8 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010100,0b00101000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//9 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b11101000},{0b00010000,0b01001000},{0b00010110,0b11101000},{0b00010110,0b00001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//10 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11001000},{0b00010111,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//11 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010100,0b00101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010100,0b00001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//12 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010111,0b11101000},{0b00010100,0b00001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//13 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010101,0b10101000},{0b00010001,0b10001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//14 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b00101000},{0b00010100,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//15 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010010,0b10101000},{0b00010101,0b01001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//16 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010001,0b10001000},{0b00010010,0b01001000},{0b00010001,0b10001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//17 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010011,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//18 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010011,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//19 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010001,0b10001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010011,0b11001000},{0b00010000,0b00001000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//20 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00101001,0b00010100},{0b00100100,0b00100100},{0b00100011,0b11000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//21 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00101001,0b00010100},{0b00100100,0b00100100},{0b00100011,0b11000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//22 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101000,0b00010100},{0b00100111,0b11100100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//23 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101000,0b00010100},{0b00100111,0b11100100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//24 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//25 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//26 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00101000,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//27 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00101000,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//28 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100010,0b01000100},{0b00100110,0b01100100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00101000,0b00010100},{0b00101000,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//29 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00101000,0b00010100},{0b00101000,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//30 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b11110100},{0b00100000,0b01000100},{0b00100100,0b00100100},{0b00101110,0b11110100},{0b00100100,0b00000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//31 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11000100},{0b00100111,0b11000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//32 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101000,0b00010100},{0b00101100,0b00110100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00101010,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//33 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00101010,0b00010100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//34 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00101010,0b01010100},{0b00100010,0b01000100},{0b00100001,0b10000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//35 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100011,0b00000100},{0b00100100,0b10010100},{0b00101000,0b01100100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//36 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b00000100},{0b00101010,0b01110100},{0b00101110,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100010,0b00100100},{0b00100101,0b01010100},{0b00100000,0b10000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//37 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100001,0b10000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100001,0b10000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//38 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00101010,0b01010100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00100111,0b11100100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//39 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101110,0b01110100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100111,0b11100100},{0b00100111,0b11100100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//40 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00100000,0b00000100},{0b00101010,0b01010100},{0b00100100,0b00100100},{0b00101010,0b01010100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00101111,0b11110100},{0b00100101,0b00000100},{0b00100110,0b00000100},{0b00100000,0b00000100},{0b00111111,0b11111100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//41 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00101010,0b00000100},{0b00101110,0b11100100},{0b00010000,0b10101000},{0b00001111,0b11110000},{0b00000000,0b00000000}},//42 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00101010,0b00000100},{0b00101110,0b11100100},{0b00010000,0b10101000},{0b00001111,0b11110000},{0b00000000,0b00000000}},//43 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b00001111,0b11110000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//44 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b00001111,0b11110000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//45 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//46 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//47 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//48 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//49 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000100,0b00100000},{0b00001100,0b00110000},{0b00010100,0b00101000},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//50 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00000000,0b00000000},{0b00000000,0b00000000}},//51 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000001,0b11100000},{0b00000000,0b10000000},{0b00000000,0b01000000},{0b00000001,0b11100000},{0b00001100,0b00000000},{0b00011110,0b00000000},{0b00011110,0b00000000},{0b00001100,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//52 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b10000000},{0b00011111,0b10000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//53 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00100000,0b00000100},{0b00110000,0b00001100},{0b00101000,0b00010100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00101010,0b00000100},{0b00000100,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//54 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00101010,0b00000100},{0b00000100,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//55 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b01001010,0b10000010},{0b00001010,0b10000000},{0b00001000,0b10000000},{0b00000111,0b00000000}},//56 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000110,0b00000100},{0b00001001,0b00001000},{0b00010000,0b10010000},{0b00100000,0b01100000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//57 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00111100},{0b00111100,0b00111100},{0b00111100,0b00100100},{0b00000000,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001000,0b10001000},{0b00010101,0b01010100},{0b00100010,0b00100010},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//58 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000011,0b11000000},{0b00000100,0b00100000},{0b00001000,0b00010000},{0b00010011,0b11001000},{0b00010011,0b11001000},{0b00001000,0b00010000},{0b00000100,0b00100000},{0b00000011,0b11000000}},//59 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00100100,0b00100100},{0b00100100,0b00100100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//60 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111100,0b00111100},{0b00111100,0b00111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//61 {{0b00000000,0b00000000},{0b01000100,0b00100010},{0b00101000,0b00010100},{0b00010000,0b00001000},{0b00101000,0b00010100},{0b01000100,0b00100010},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111100},{0b00010101,0b00000000},{0b00010001,0b00000000},{0b00001110,0b00000000},{0b00000000,0b00000000}},//62 {{0b00001111,0b11100000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000111,0b11000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000111,0b11000000},{0b00000100,0b01000000},{0b00000110,0b01000000},{0b00000100,0b01000000},{0b00000110,0b01000000},{0b00000100,0b01000000},{0b00000111,0b11000000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000001,0b00000000}},//63 {{0b00001111,0b11100000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000111,0b11000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000111,0b11000000},{0b00000100,0b01000000},{0b00000110,0b01000000},{0b00000100,0b01000000},{0b00000111,0b11000000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000001,0b00000000}},//64 {{0b00001111,0b11100000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000111,0b11000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000101,0b01000000},{0b00000111,0b11000000},{0b00000100,0b01000000},{0b00000111,0b11000000},{0b00000001,0b00000000},{0b00000001,0b00000000},{0b00000001,0b00000000}},//65 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//66 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000011,0b11000000},{0b00000011,0b11000000},{0b00000011,0b11000000},{0b00011111,0b11111000},{0b00011111,0b11111000},{0b00011111,0b11111000},{0b00011111,0b11111000},{0b00000011,0b11000000},{0b00000011,0b11000000},{0b00000011,0b11000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//67 {{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b11111111,0b11111111},{0b11111111,0b11111111},{0b11111111,0b11111111},{0b11111111,0b11111111},{0b11111111,0b11111111},{0b11111111,0b11111111},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000},{0b00000111,0b11100000}},//68 {{0b00000000,0b00000000},{0b00000001,0b10000000},{0b00000010,0b01000000},{0b00000100,0b00100000},{0b00001000,0b00010000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00001100,0b00110000},{0b00000011,0b11000000},{0b00000000,0b00000000}},//69 {{0b00000000,0b00000000},{0b00000001,0b10000000},{0b00000010,0b01000000},{0b00000100,0b00100000},{0b00001000,0b01110000},{0b00011100,0b01001000},{0b00010100,0b00001000},{0b00100010,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00011000,0b01101000},{0b00010000,0b00111000},{0b00001101,0b00110000},{0b00000011,0b11000000},{0b00000000,0b00000000}},//70 {{0b00000000,0b00000000},{0b00000001,0b10000000},{0b00000010,0b01000000},{0b00000111,0b00100000},{0b00001001,0b00010000},{0b00011100,0b01111000},{0b00010100,0b01001000},{0b00100011,0b01100100},{0b00100100,0b00101100},{0b00101001,0b01001100},{0b00100111,0b01010100},{0b00011000,0b01001000},{0b00010001,0b00101000},{0b00001101,0b10110000},{0b00000011,0b11000000},{0b00000000,0b00000000}},//71 {{0b00000011,0b11100000},{0b00001111,0b11110000},{0b00011111,0b11111000},{0b00011111,0b11111100},{0b00011111,0b11111100},{0b00011111,0b11111100},{0b00011111,0b11111100},{0b00001111,0b11111000},{0b00001111,0b11111000},{0b00000111,0b11110000},{0b00000011,0b11100000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000010,0b00100000},{0b00000010,0b10100000},{0b00000001,0b01000000}},//72 {{0b00000001,0b01000000},{0b00000010,0b10100000},{0b00000010,0b00100000},{0b00000001,0b01000100},{0b00011111,0b01011100},{0b00011111,0b11111100},{0b00011111,0b11111100},{0b00001111,0b11111000},{0b00001111,0b11111000},{0b00000111,0b11110000},{0b00000011,0b11100000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000010,0b00100000},{0b00000010,0b10100000},{0b00000001,0b01000000}},//73 {{0b00000001,0b01000000},{0b00000010,0b10100000},{0b00000010,0b00100000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00001001,0b01000000},{0b00001001,0b01000000},{0b00001101,0b11011000},{0b00000111,0b11110000},{0b00000011,0b11100000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000010,0b00100000},{0b00000010,0b10100000},{0b00000001,0b01000000}},//74 {{0b00000001,0b01000000},{0b00000010,0b10100000},{0b00000010,0b00100000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000001,0b01000000},{0b00000010,0b00100000},{0b00000010,0b10100000},{0b00000001,0b01000000}},//75 {{0b00000000,0b00000000},{0b00011100,0b00000000},{0b00011110,0b00000000},{0b00000111,0b00000000},{0b00000111,0b10000000},{0b00000001,0b10000000},{0b00001110,0b01110000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b00001001,0b10010000},{0b00000110,0b01100000}},//76 {{0b00000000,0b00000000},{0b00011100,0b00000000},{0b00011110,0b00000000},{0b00000111,0b00000000},{0b00000111,0b10000000},{0b00000001,0b10000000},{0b00001110,0b01110000},{0b00010000,0b00001000},{0b00001000,0b00000100},{0b00000100,0b00000100},{0b00000010,0b00000100},{0b00000010,0b00000100},{0b00011100,0b00000100},{0b00010000,0b00001000},{0b00001001,0b10010000},{0b00000110,0b01100000}},//77 {{0b00000000,0b00000000},{0b00011100,0b00000000},{0b00011110,0b00000000},{0b00000111,0b00000000},{0b00000111,0b10000000},{0b00000001,0b10000000},{0b00001110,0b01110000},{0b00010000,0b00011000},{0b00001000,0b00010000},{0b00000100,0b00100000},{0b00000010,0b00100000},{0b00000010,0b00100000},{0b00011100,0b00100000},{0b00010000,0b00100000},{0b00001001,0b10010000},{0b00000110,0b01100000}},//78 {{0b00000000,0b00000000},{0b00011100,0b00000000},{0b00011110,0b00000000},{0b00000111,0b00000000},{0b00000111,0b10000000},{0b00000001,0b10000000},{0b00001110,0b01110000},{0b00000011,0b11000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000001,0b10000000},{0b00000011,0b10000000},{0b00000110,0b01100000}},//79 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000111,0b11100000},{0b01001001,0b10010010},{0b01101010,0b01010110},{0b01011011,0b11011010},{0b01011011,0b11011010},{0b01101010,0b01010110},{0b01001001,0b10010010},{0b00000111,0b11100000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//80 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000111,0b11100000},{0b00001101,0b11110000},{0b00001000,0b11110000},{0b00001101,0b11110000},{0b00001111,0b11110000},{0b00001111,0b10110000},{0b00001111,0b11110000},{0b00000111,0b11100000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//81 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001000,0b00000000},{0b00001100,0b10010000},{0b00001111,0b11110000},{0b00000111,0b11100000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//82 {{0b00000000,0b00000000},{0b00000001,0b11000000},{0b00000011,0b11100000},{0b00000011,0b11100000},{0b00000011,0b11100000},{0b00000011,0b11100000},{0b00000001,0b11000000},{0b00000001,0b11000000},{0b00000001,0b11000000},{0b00000001,0b11000000},{0b00000000,0b10000000},{0b01000000,0b00000010},{0b10000000,0b10000001},{0b01000001,0b11000010},{0b00000000,0b10000000},{0b00000000,0b00000000}},//83 {{0b00000000,0b00000000},{0b00011111,0b11100000},{0b00010000,0b00110000},{0b00010000,0b00111000},{0b00010101,0b11001000},{0b00010000,0b00001000},{0b00010101,0b11101000},{0b00010000,0b00001000},{0b00010101,0b10001000},{0b00010000,0b00001000},{0b00010101,0b11101000},{0b01010000,0b00001010},{0b10010101,0b11101001},{0b01010000,0b00001010},{0b00011111,0b11111000},{0b00000000,0b00000000}},//84 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000100,0b01001000},{0b00000100,0b11001100},{0b00000100,0b11001100},{0b00000100,0b11111100},{0b00000100,0b01111000},{0b00000100,0b00110000},{0b00000100,0b00110000},{0b00001110,0b00110000},{0b00001110,0b00110000},{0b01001110,0b00110010},{0b10001110,0b00110001},{0b01001110,0b00110010},{0b00000100,0b00110000},{0b00000000,0b00000000}},//85 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000111,0b11100000},{0b00001001,0b10010000},{0b00010000,0b00001000},{0b00100000,0b00100100},{0b00100000,0b01000100},{0b00110111,0b10001100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b01001001,0b10010010},{0b10000111,0b11100001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b00000000,0b00000000}},//86 {{0b00000000,0b00000000},{0b00000001,0b10000000},{0b00000010,0b01000000},{0b00000100,0b00100000},{0b00001000,0b00010000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00010000,0b00001000},{0b01010000,0b00001010},{0b10001100,0b00110001},{0b01000011,0b11000010},{0b00000000,0b00000000},{0b00000000,0b00000000}},//87 {{0b00000011,0b11000000},{0b00000010,0b01000000},{0b00000010,0b01000000},{0b00011110,0b01111000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00011110,0b01111000},{0b01000010,0b01000010},{0b10000010,0b01000001},{0b01000011,0b11000010},{0b00000000,0b00000000},{0b11111111,0b11111111},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b11111111,0b11111111}},//88 {{0b00011000,0b00011000},{0b00011000,0b00011000},{0b00011100,0b00111000},{0b00111111,0b11111100},{0b00111111,0b11111100},{0b00011100,0b00111000},{0b00011000,0b00011000},{0b01011000,0b00011010},{0b10000000,0b00000001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b11111111,0b11111111},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b11111111,0b11111111}},//89 {{0b00000111,0b11100000},{0b00001000,0b00010000},{0b00010000,0b00001000},{0b00010110,0b01101000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010100,0b00101000},{0b01010011,0b11001010},{0b10001000,0b00010001},{0b01000111,0b11100010},{0b00000000,0b00000000},{0b11111111,0b11111111},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b11111111,0b11111111}},//90 {{0b00000001,0b11111000},{0b00100111,0b11111100},{0b01011111,0b11111100},{0b00100111,0b11111100},{0b01011111,0b11111100},{0b00100111,0b11111100},{0b00000011,0b11111000},{0b01000001,0b11110010},{0b10000000,0b00000001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b11111111,0b11111111},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b11111111,0b11111111}},//91 {{0b00000000,0b00000000},{0b00011111,0b11110000},{0b00001000,0b00100000},{0b00000111,0b11000000},{0b00000011,0b10000000},{0b00000001,0b00000000},{0b00000010,0b10000000},{0b01000101,0b01000010},{0b10001011,0b10100001},{0b01011111,0b11110010},{0b00000000,0b00000000},{0b11111111,0b11111111},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b10000000,0b00000001},{0b11111111,0b11111111}},//92 {{0b00000000,0b00000000},{0b00011011,0b01000000},{0b00011011,0b01100000},{0b00011011,0b01110000},{0b00011011,0b01111000},{0b00011111,0b01111000},{0b00011111,0b01111000},{0b00001110,0b01111000},{0b00001110,0b01111000},{0b00001110,0b01110000},{0b00001110,0b01110000},{0b01001110,0b01110010},{0b10001110,0b01110001},{0b01001110,0b01110010},{0b00000100,0b00100000},{0b00000000,0b00000000}},//93 {{0b00000000,0b00000000},{0b00011100,0b00000000},{0b00100011,0b00000000},{0b01000001,0b00000000},{0b10011111,0b11111000},{0b00100000,0b00000100},{0b00101001,0b10010100},{0b00111100,0b00101100},{0b00101000,0b00010100},{0b00100000,0b00000100},{0b00011111,0b11111000},{0b01000000,0b00000010},{0b10000000,0b00000001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b00000000,0b00000000}},//94 {{0b00000000,0b00000000},{0b00000011,0b11000000},{0b00001111,0b11110000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00001000,0b00010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b01001010,0b01010010},{0b10001010,0b01010001},{0b01001000,0b00010010},{0b00001111,0b11110000},{0b00000000,0b00000000}},//95 {{0b00000111,0b11110000},{0b00000000,0b10000000},{0b00000000,0b10000000},{0b00000011,0b11100000},{0b00000010,0b10100000},{0b00000010,0b10100000},{0b00000011,0b11100000},{0b00000010,0b00100000},{0b00000011,0b00100000},{0b00000010,0b00100000},{0b00000011,0b00100000},{0b01000010,0b00100010},{0b10000011,0b11100001},{0b01000000,0b10000010},{0b00000000,0b10000000},{0b00000000,0b10000000}},//96 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000010,0b00000000},{0b00000011,0b01100000},{0b00000001,0b01000000},{0b00001011,0b01100000},{0b00011010,0b00101000},{0b00110000,0b00101000},{0b00100000,0b10101000},{0b00110001,0b10001000},{0b00010001,0b11101000},{0b00000011,0b11110000},{0b00000111,0b11110000},{0b00011111,0b11111000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//97 {{0b00000100,0b10000000},{0b00010100,0b10100000},{0b00010010,0b00100000},{0b00001001,0b10000000},{0b00000011,0b11000000},{0b00000001,0b10000000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00001000,0b00010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001000,0b00010000},{0b00001111,0b11110000}},//98 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000011,0b11000000},{0b00001111,0b11110000},{0b00000000,0b00000000},{0b00001111,0b11110000},{0b00001000,0b00010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001010,0b01010000},{0b00001000,0b00010000},{0b00001111,0b11110000}},//99 {{0b00000111,0b11000000},{0b00011111,0b11100000},{0b00111111,0b11110000},{0b00111111,0b11111000},{0b00111111,0b11111000},{0b00111111,0b11111000},{0b00111111,0b11111000},{0b00011111,0b11110000},{0b00011111,0b11110000},{0b00001111,0b11100000},{0b00000111,0b11000000},{0b01000010,0b10000010},{0b10000010,0b10000001},{0b01000100,0b01000010},{0b00000101,0b01000000},{0b00000010,0b10000000}},//100 {{0b00000110,0b00000000},{0b00000011,0b00000000},{0b00000001,0b00000000},{0b00000110,0b11100000},{0b00001000,0b00010000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b00010000,0b00001000},{0b01001001,0b10010010},{0b10000110,0b01100001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b00000000,0b00000000}},//101 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000111,0b11100000},{0b01001001,0b10010010},{0b01101010,0b01010110},{0b01011011,0b11011010},{0b01011011,0b11011010},{0b01101010,0b01010110},{0b01001001,0b10010010},{0b00000111,0b11100000},{0b01000000,0b00000010},{0b10000000,0b00000001},{0b01000000,0b00000010},{0b00000000,0b00000000},{0b00000000,0b00000000}},//102 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//103 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000010},{0b00000000,0b00000010},{0b00000000,0b00000010},{0b00000000,0b00000000}},//104 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000110},{0b00000000,0b00000110},{0b00000000,0b00000110},{0b00000000,0b00000000}},//105 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00001110},{0b00000000,0b00001110},{0b00000000,0b00001110},{0b00000000,0b00000000}},//106 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00011110},{0b00000000,0b00011110},{0b00000000,0b00011110},{0b00000000,0b00000000}},//107 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00111110},{0b00000000,0b00111110},{0b00000000,0b00111110},{0b00000000,0b00000000}},//108 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b01111110},{0b00000000,0b01111110},{0b00000000,0b01111110},{0b00000000,0b00000000}},//109 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b11111110},{0b00000000,0b11111110},{0b00000000,0b11111110},{0b00000000,0b00000000}},//110 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000001,0b11111110},{0b00000001,0b11111110},{0b00000001,0b11111110},{0b00000000,0b00000000}},//111 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000011,0b11111110},{0b00000011,0b11111110},{0b00000011,0b11111110},{0b00000000,0b00000000}},//112 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000111,0b11111110},{0b00000111,0b11111110},{0b00000111,0b11111110},{0b00000000,0b00000000}},//113 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001111,0b11111110},{0b00001111,0b11111110},{0b00001111,0b11111110},{0b00000000,0b00000000}},//114 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00011111,0b11111110},{0b00011111,0b11111110},{0b00011111,0b11111110},{0b00000000,0b00000000}},//115 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00111111,0b11111110},{0b00111111,0b11111110},{0b00111111,0b11111110},{0b00000000,0b00000000}},//116 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b01111111,0b11111110},{0b01111111,0b11111110},{0b01111111,0b11111110},{0b00000000,0b00000000}},//117 {{0b00000000,0b00010000},{0b00000000,0b00101000},{0b00000000,0b00010000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00001000,0b00000000},{0b00010100,0b00000000},{0b00001000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b01000000},{0b00000000,0b10100000},{0b00000000,0b01000000},{0b00100000,0b00000000},{0b01010000,0b00000010},{0b00100000,0b00000101},{0b00000000,0b00000010}},//118 {{0b00000000,0b00000000},{0b00100000,0b00000000},{0b01010000,0b00000000},{0b00100000,0b00000000},{0b00000100,0b00000000},{0b00001010,0b00000000},{0b00000100,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00001000},{0b00000000,0b00010100},{0b00000000,0b00001000},{0b00000000,0b00000000},{0b00001000,0b00000000},{0b00010100,0b00000000},{0b00001000,0b00000000},{0b00000000,0b00000000}},//119 {{0b00000000,0b00000000},{0b00001000,0b00000100},{0b00010100,0b00001010},{0b00001000,0b00000100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000001,0b00000000},{0b00000010,0b10000000},{0b00000001,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00100000},{0b00000000,0b01010000},{0b00000000,0b00100000},{0b00100000,0b00000000},{0b01010000,0b00000000},{0b00100000,0b00000000}},//120 {{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b01000000,0b00000010},{0b10000000,0b00000001},{0b01000000,0b00000010},{0b00000000,0b00000000}},//121 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00011100,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//122 {{0b00001000,0b00111000},{0b00001100,0b01000100},{0b00001010,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00111110,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//123 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00010000,0b01000100},{0b00001000,0b01000100},{0b00000100,0b01000100},{0b00000010,0b01000100},{0b00000010,0b01000100},{0b00111110,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//124 {{0b00011110,0b00111000},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00011110,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00011110,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//125 {{0b00100010,0b00111000},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00111110,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//126 {{0b00111110,0b00111000},{0b00000010,0b01000100},{0b00000010,0b01000100},{0b00000010,0b01000100},{0b00000100,0b01000100},{0b00011000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100010,0b01000100},{0b00011100,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//127 {{0b00011100,0b00111000},{0b00000010,0b01000100},{0b00000010,0b01000100},{0b00000010,0b01000100},{0b00011110,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00011100,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//128 {{0b00111110,0b00111000},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00010000,0b01000100},{0b00010000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b01000100},{0b00001000,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//129 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00011100,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00011100,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//130 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00100010,0b01000100},{0b00111100,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00100000,0b01000100},{0b00011100,0b00111000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//131 {{0b00011100,0b00010000},{0b00100010,0b00011000},{0b00100010,0b00010100},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//132 {{0b00001000,0b00010000},{0b00001100,0b00011000},{0b00001010,0b00010100},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00111110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//133 {{0b00011100,0b00010000},{0b00100010,0b00011000},{0b00100000,0b00010100},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00010000,0b00010000},{0b00001000,0b00010000},{0b00000100,0b00010000},{0b00000010,0b00010000},{0b00000010,0b00010000},{0b00111110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//134 {{0b00011110,0b00010000},{0b00100000,0b00011000},{0b00100000,0b00010100},{0b00100000,0b00010000},{0b00011110,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00011110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//135 {{0b00100010,0b00010000},{0b00100010,0b00011000},{0b00100010,0b00010100},{0b00100010,0b00010000},{0b00111110,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//136 {{0b00111110,0b00010000},{0b00000010,0b00011000},{0b00000010,0b00010100},{0b00000010,0b00010000},{0b00000100,0b00010000},{0b00011000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100010,0b00010000},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//137 {{0b00011100,0b00010000},{0b00000010,0b00011000},{0b00000010,0b00010100},{0b00000010,0b00010000},{0b00011110,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//138 {{0b00111110,0b00010000},{0b00100000,0b00011000},{0b00100000,0b00010100},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00010000,0b00010000},{0b00010000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b00010000},{0b00001000,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//139 {{0b00011100,0b00010000},{0b00100010,0b00011000},{0b00100010,0b00010100},{0b00100010,0b00010000},{0b00011100,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00100010,0b00010000},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//140 {{0b00011100,0b00010000},{0b00100010,0b00011000},{0b00100010,0b00010100},{0b00100010,0b00010000},{0b00111100,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00100000,0b00010000},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//141 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100010,0b01000000},{0b00100010,0b01000000},{0b00100010,0b01000000},{0b00100010,0b00100000},{0b00100010,0b00010000},{0b00100010,0b00001000},{0b00100010,0b00000100},{0b00100010,0b00000100},{0b00011100,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//142 {{0b00001000,0b00111000},{0b00001100,0b01000100},{0b00001010,0b01000000},{0b00001000,0b01000000},{0b00001000,0b01000000},{0b00001000,0b00100000},{0b00001000,0b00010000},{0b00001000,0b00001000},{0b00001000,0b00000100},{0b00001000,0b00000100},{0b00111110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//143 {{0b00011100,0b00111000},{0b00100010,0b01000100},{0b00100000,0b01000000},{0b00100000,0b01000000},{0b00100000,0b01000000},{0b00010000,0b00100000},{0b00001000,0b00010000},{0b00000100,0b00001000},{0b00000010,0b00000100},{0b00000010,0b00000100},{0b00111110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//144 {{0b00011110,0b00111000},{0b00100000,0b01000100},{0b00100000,0b01000000},{0b00100000,0b01000000},{0b00011110,0b01000000},{0b00100000,0b00100000},{0b00100000,0b00010000},{0b00100000,0b00001000},{0b00100000,0b00000100},{0b00100000,0b00000100},{0b00011110,0b01111100},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000},{0b00000000,0b00000000}},//145 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//146 {{0b01111110,0b01111110},{0b10000001,0b11111111},{0b10000001,0b11100111},{0b10000001,0b11000011},{0b10000001,0b11000011},{0b10000001,0b11100111},{0b10000001,0b11111111},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//147 {{0b01111110,0b01111110},{0b11111111,0b10000001},{0b11100111,0b10000001},{0b11000011,0b10000001},{0b11000011,0b10000001},{0b11100111,0b10000001},{0b11111111,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//148 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b11111111},{0b10000001,0b11100111},{0b10000001,0b11000011},{0b10000001,0b11000011},{0b10000001,0b11100111},{0b10000001,0b11111111},{0b01111110,0b01111110}},//149 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b11111111,0b10000001},{0b11100111,0b10000001},{0b11000011,0b10000001},{0b11000011,0b10000001},{0b11100111,0b10000001},{0b11111111,0b10000001},{0b01111110,0b01111110}},//150 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10011001},{0b10000001,0b10111101},{0b10000001,0b10111101},{0b10000001,0b10011001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//151 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10011001,0b10000001},{0b10111101,0b10000001},{0b10111101,0b10000001},{0b10011001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//152 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10011001},{0b10000001,0b10111101},{0b10000001,0b10111101},{0b10000001,0b10011001},{0b10000001,0b10000001},{0b01111110,0b01111110}},//153 {{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110},{0b01111110,0b01111110},{0b10000001,0b10000001},{0b10011001,0b10000001},{0b10111101,0b10000001},{0b10111101,0b10000001},{0b10011001,0b10000001},{0b10000001,0b10000001},{0b01111110,0b01111110}} //154 }; const char PET_STATS_NEW[5] = {14,6,7,7,0}; // The starting stats of a new pet volatile unsigned char display_buffer[16][2]; // This is the display array, what ever in it is displayed unsigned char row_cnt = 0; // Display row counter volatile char PET_STATS[5]; // The pets stats unsigned char HLT_LVL_CAP; // The health level cap unsigned char HPN_LVL_CAP; // The happines level cap unsigned char time,day,age; // Time data stored here unsigned char sleep = 0,sick = 0,dead = 0, poop = 0; // Effects like sleep, sickness,bowl movment and death const int anim_blink[4] = {4000,250,300,150}; // The binking animation, normal pet look const int anim_sleep[2] = {1000,1000}; // Sleeping animation has only 2 states const int anim_poop[3] = {750,750,750}; // Poop particals long previousMillis = 0; // Used for timing the blink and sleep animations long previousMillis_poop = 0; // Used for timing the poop animation unsigned char screen_state; // The main screen state is stored here unsigned char anim_turn; // animation state for blink and sleep unsigned char poop_turn; // animation state for poop unsigned char anim_add,poop_add; // values that choose what frame to use according to the animation turn void setup() { unsigned char i; //A simple val for some loops /*Setting the shift registers IOs as outputs*/ pinMode(ClockPin,OUTPUT); pinMode(LatchPin,OUTPUT); pinMode(DataPin,OUTPUT); /*Setting the RTC IOs as outputs*/ pinMode(RTC_CLK,OUTPUT); pinMode(RTC_IO,OUTPUT); pinMode(RTC_CE,OUTPUT); digitalWrite(RTC_CE,LOW); //Make sure the CE line is LOW (No communication with the RTC) /*Setting the piezzo IO as output*/ pinMode(PIEZZO,OUTPUT); /*Setting the buttons IOs as inputs*/ pinMode(B_U_R,INPUT); pinMode(B_U_L,INPUT); pinMode(B_D_R,INPUT); pinMode(B_D_L,INPUT); /*Enableing Pull-up on the input pins*/ digitalWrite(B_D_L,HIGH); digitalWrite(B_D_R,HIGH); digitalWrite(B_U_L,HIGH); digitalWrite(B_U_R,HIGH); setupSPI(); //setup the SPI module for the shift register timer0_setup(); //setup timer0 for the display refreshing sei(); //enable global intterupts RTC_Write(0x80,0x00); // make sure the RTC is ON by setting the seconds to 0x00 if( RTC_Read(STATUS_READ) == 0xAA) // read the "status" register to know if there is a pet already alive { for(i = 0; i < 5 ; i++) // Update the pets stats from memory(incase of a power dowm) PET_STATS[i] = RTC_Read(STAT_READ + (i*2)); } else { new_pet(); //If there is no pet already alive make on } time = RTC_Read(HOUR_READ); //Read the time day = RTC_Read(0x89); //read the day of the month age = RTC_Read(STAT_READ + 10); // read the age of the pet } void loop() { int a; // some val for loops if((RTC_Read(HOUR_READ) >= 0x08) && (RTC_Read(HOUR_READ) < 0x23)) // check for sleeping time between 23:00 and 8:00 { sleep = 0; //If it's day the pets is awake if(time != RTC_Read(HOUR_READ)) //cuase a stat update every hour by looking for a change in the hours { PET_STATS[HNR]--; //Every hour the hunger bar goes down by one if(PET_STATS[HNR] < 7) //The wight will go down only if the pet is under 7 hunger PET_STATS[WGT]--; if( ( 15 + ((PET_STATS[HLT]/3) * 10) - ((poop/0xFF) * 10) ) < random(65)) //calc if the guy gets sick based of health and poop state { switch(PET_STATS[HLT]/3) //Calc the pets health and the chance of getting sick { case 0: sick = random(1,4); break; case 1: sick = random(1,3); break; case 2: sick = random(1,3); break; case 4: sick = 1; break; //Low health the pet will always be sick } } PET_STATS[HLT] -= sick; //The sickness will "drain" the health accoring to the sickness streangth if(random(100) < 33) // 1/3 chance of pooping this turn poop = 0xFF; //Poop state update time = RTC_Read(HOUR_READ); // update the time /* over flow checks( can't have a negative stats)*/ if(PET_STATS[HLT] < 0) PET_STATS[HLT] = 0; if(PET_STATS[HNR] < 0) PET_STATS[HNR] = 0; if(PET_STATS[WGT] < 0) PET_STATS[WGT] = 0; } if((PET_STATS[HLT] <= 0) || (PET_STATS[HNR] <= 0) || (PET_STATS[HPN] <= 0)) // check main states dead = 1; // dies if: sad,low health or very hungry if(day != RTC_Read(0x89)) //Check for day change { age++; //Every day the pet gets older if(age > 126) //The pet lives until the age of 126 days dead = 1; //The pet is dead of old age PET_STATS[AGE] = age / 9; //Adjust for the status bar (ONLY 14 bars) day = RTC_Read(0x89); //Update day } /*Level cap calculations*/ /*Health is set by hunger,wiegth and age*/ HLT_LVL_CAP = (PET_STATS[HNR] / 3) + (PET_STATS[WGT] / 10) + (PET_STATS[AGE] / 10) + 7; if(PET_STATS[HLT] > HLT_LVL_CAP) PET_STATS[HLT] = HLT_LVL_CAP; /*Hapiness is set by hunger,health and wieght*/ HPN_LVL_CAP = (PET_STATS[HNR] / 3) + (PET_STATS[HLT] / 5) + (PET_STATS[WGT] / 10) + 7; if(PET_STATS[HPN] > HPN_LVL_CAP) PET_STATS[HPN] = HPN_LVL_CAP; /*Save the pets stats in the DS1302's memory*/ for(a = 0; a < 5 ; a++) RTC_Write(STAT_WRITE + (a*2),PET_STATS[a]); RTC_Write(STAT_WRITE + 10,age); } else sleep = 1; //If it's time to sleep update the sleep stat if(digitalRead(B_U_R) == LOW) //check for the the menu button press { beep_0(); //make a beeping sound menu(); //Open the main menu } /*This is the main sreen update logic with all of theanimations*/ if(sleep == 0) //Check if the pet is awake if so do the normal animation { if(millis() - previousMillis > anim_blink[anim_turn]) //wait for the correct time to pass (animation timing) { anim_turn++; //Go to the next aniamtion turn if(anim_turn > 3) // Check if to reset the animation anim_turn = 0; //Reset the animation if((anim_turn == 0) || (anim_turn == 2)) //set the next animation value anim_add = 0; else anim_add = 1; previousMillis = millis(); //Update the timer value } } else //The pet is asleep, make the sleeping animation { if(millis() - previousMillis > anim_sleep[anim_turn]) //Same logic as with the normal aniamtion { anim_turn++; if(anim_turn > 1) anim_turn = 0; anim_add = anim_turn; previousMillis = millis(); } } if(millis() - previousMillis_poop > anim_poop[poop_turn]) //The poop animation, this animation is overlayed on the regular animation { poop_turn++; if(poop_turn > 2) poop_turn = 0; previousMillis_poop = millis(); } /*This is the screen state logic i.e. how to update the screen to show the pets stats*/ if(dead == 0) //The pet is alive { if(sleep == 0) //The pet is awake { if(sick == 0) //Pet isn't sick screen_state = (8 + ((PET_STATS[AGE] / 5) * 21)) - (2*(PET_STATS[HPN]/3)) + anim_add; //The display is set by the age,mood and animation state of the pet else //The pet is sick screen_state = (13 + ((PET_STATS[AGE] / 5) * 21)) + sick; } else //The pet is sleeping screen_state = (10 + ((PET_STATS[AGE] / 5) * 21)) + anim_add; //The display is set by the age and animation state of the pet } else //The pet is dead screen_state = (20 + ((PET_STATS[AGE] / 5) * 21)); //The display is set by age only for(a=0;a<16;a++) // update the screen to show the pets state { display_buffer[a][0] = pgm_read_byte(&(frames[screen_state][a][0])) | (pgm_read_byte(&(frames[118 + poop_turn][a][1])) & poop); //First 8 bits of the display, select the right frame and overlay display_buffer[a][1] = pgm_read_byte(&(frames[screen_state][a][1])) | (pgm_read_byte(&(frames[118 + poop_turn][a][1])) & poop); //Last 8 bits of the display, select the right frame and overlay } } /*This is the main menu function from here you select what to do*/ void menu() { unsigned char list = 83; //I used the frame posions as a counter unsigned char a,next_act = 0; //Value for loops and menu positions for(a=0;a<16;a++) //Setting the main menu first icon on screen { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } while(digitalRead(B_U_R) == LOW); //Wait for the menu button to go HIGH i.e. no press _delay_ms(250); while(next_act == 0) //Go to the main menu loop { if(digitalRead(B_U_R) == LOW) //If the menu button is pressed go to the seleted option { beep_0(); //Make a beeping sound switch(list) { case 83: next_act = actions(); break; //Go to actions menu case 84: next_act = stats(); break; //Go to stats menu case 85: next_act = settings(); break; //Go to settings menu } _delay_ms(50); } if(digitalRead(B_D_R) == LOW) //Check for a right button press and go to the next menu item { list++; //next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) //Check for a left button press and go to the prev. menu item { list--; //prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) //Check if the back button is pressed and exit the main menu { next_act = 2; //back to main screen _delay_ms(50); beep_0(); } /*Looping menu i.e. checking for overflows in the lists*/ if(list == 86) list = 83; if(list == 82) list = 85; for(a=0;a<16;a++) //Upadate the screen to show the right icon { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } } } /*Same as the main menu function but gives diffrent oprions*/ unsigned char actions() { unsigned char list = 93,a,next_state = 0; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(next_state == 0) { if(digitalRead(B_D_R) == LOW) { list++;//next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) { list--;//prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_R) == LOW) { next_state = 1; _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) { next_state = 2; //back to menu screen _delay_ms(50); beep_0(); } if(list == 97) list = 93; if(list == 92) list = 96; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } } if(next_state == 1) { switch(list) { case 93:foods(); break; //Go to the foods menu case 94:simon_game(); break; //Go to the simon game case 95:if(poop != 0) { animation(97,3); //poop cleaning :D poop = 0; //stats effects } else animation(17 + ((PET_STATS[AGE]) / 5),3); //Make a silly face break; case 96:animation(63,6); //give the guy his meds if(sick == 0) // if not sick take damage { PET_STATS[HLT] -= 2; if(PET_STATS[HLT] < 0) PET_STATS[HLT] = 0; } else sick = 0; //stats effects PET_STATS[HPN] -= 3; //well he hates taking that shot if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; break; } return 1; } else return 0; } /*Stats menu, very simple looks just like the main menu function*/ unsigned char stats() { unsigned char list = 88,a,next_state = 0; /*Upadte the screen, the screen made of the icon and the overlayed progress bar*/ for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0]))| pgm_read_byte(&(frames[103 + PET_STATS[0]][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1]))| pgm_read_byte(&(frames[103 + PET_STATS[0]][a][1])); } while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(next_state == 0) { if(digitalRead(B_D_R) == LOW) { list++;//next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) { list--;//prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_R) == LOW) { next_state = 1; _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) { next_state = 2; //back to menu screen _delay_ms(50); beep_0(); } if(list == 93) list = 88; if(list == 87) list = 92; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])) | pgm_read_byte(&(frames[103 + PET_STATS[list-88]][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])) | pgm_read_byte(&(frames[103 + PET_STATS[list-88]][a][1])); } } return 0; } /*Settings menu, again same as the main menu part*/ unsigned char settings() { unsigned char list = 86,a,next_state = 0; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(next_state == 0) { if(digitalRead(B_D_R) == LOW) { list++;//next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) { list--;//prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_R) == LOW) { next_state = 1; _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) { next_state = 2; //back to menu screen _delay_ms(50); beep_0(); } if(list == 88) list = 86; if(list == 85) list = 87; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } } if(next_state == 1) { switch(list) { case 86: set_time(); break; //Go to the set time function case 87: new_pet(); break; //Create a new pet } return 1; } else return 0; } /*Foods menu looks like the main menu function*/ void foods() { unsigned char list = 100,a,next_state = 0; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(next_state == 0) { if(digitalRead(B_D_R) == LOW) { list++;//next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) { list--;//prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_R) == LOW) { next_state = 1; _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) { next_state = 2; //back to menu screen _delay_ms(50); beep_0(); } if(list == 103) list = 100; if(list == 99) list = 102; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[list][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[list][a][1])); } } if(next_state == 1) { switch(list) { case 100:animation(72,4); // meat and all of it's effects PET_STATS[HNR] += 3; if(PET_STATS[HNR] > 14) { PET_STATS[HNR] = 14; PET_STATS[HPN] -= 2; if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; } else { PET_STATS[WGT] += 2; if(PET_STATS[WGT] > 14) { PET_STATS[WGT] = 14; PET_STATS[HLT]--; if(PET_STATS[HLT] < 0) PET_STATS[HLT] = 0; } PET_STATS[HPN]++; if(PET_STATS[HPN] > HPN_LVL_CAP) PET_STATS[HPN] = HPN_LVL_CAP; } break; case 101:animation(76,4); // apple and all of it's effects PET_STATS[HNR] += 2; if(PET_STATS[HNR] > 14) { PET_STATS[HNR] = 14; PET_STATS[HPN] -= 2; if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; } else { PET_STATS[HPN] -= 2; if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; PET_STATS[HLT] += 1; if(PET_STATS[HLT] > HLT_LVL_CAP) PET_STATS[HLT] = HLT_LVL_CAP; } break; case 102:animation(80,4); //candy and all of it's effects PET_STATS[HNR] += 1; if(PET_STATS[HNR] > 14) { PET_STATS[HNR] = 14; PET_STATS[HPN] -= 2; if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; } else { PET_STATS[WGT] += 4; if(PET_STATS[WGT] > 14) { PET_STATS[WGT] = 14; PET_STATS[HLT]--; } PET_STATS[HPN] += 4; if(PET_STATS[HPN] > HPN_LVL_CAP) PET_STATS[HPN] = HPN_LVL_CAP; PET_STATS[HLT] -= 2; if(PET_STATS[HPN] < 0) PET_STATS[HPN] = 0; } break; } } } /*This functoin goes over N number of frames (stored in frames_num) starting with the "starting_frame"*/ void animation(unsigned char starting_frame,unsigned char frames_num) { unsigned char a,b; for(b = 0; b < frames_num ; b++) { for(a=0;a<16;a++) //simple display updaing loop { display_buffer[a][0] = pgm_read_byte(&(frames[starting_frame +b][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[starting_frame + b][a][1])); } _delay_ms(750); } } /*This function creates a new pet*/ void new_pet() { unsigned char a; //reset all flags sick = 0; poop = 0; dead = 0; age = 0; animation(69,3); RTC_Write(STATUS_WRITE,0xAA); //updata ROM for(a = 0; a < 5; a++) //update all stats to the staring ones { RTC_Write(STAT_WRITE + (a*2),PET_STATS[a]); PET_STATS[a] = PET_STATS_NEW[a]; } RTC_Write(STAT_WRITE + 10,0x00); //Set the age to zero } /*This function sets the time*/ void set_time() { char hour; unsigned char a,next_state = 0; hour = RTC_Read(HOUR_READ); //Read the current hour hour = (((hour & 0xF0)>>4)*10) + (hour & 0x0F); //from BCD to decimal number for(a=0;a<16;a++) //Show the time, the image is made of to images: time and the overlay { display_buffer[a][0] = pgm_read_byte(&(frames[121][a][0])) | pgm_read_byte(&(frames[122 + hour][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[121][a][1])) | pgm_read_byte(&(frames[122 + hour][a][1])); } while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(digitalRead(B_U_R) == LOW); _delay_ms(250); while(next_state == 0) { if(digitalRead(B_D_R) == LOW) { hour++;//next state _delay_ms(50); beep_0(); } if(digitalRead(B_D_L) == LOW) { hour--;//prev state _delay_ms(50); beep_0(); } if(digitalRead(B_U_R) == LOW) { next_state = 1;//set new time _delay_ms(50); beep_0(); } if(digitalRead(B_U_L) == LOW) { next_state = 2;//back to menu screen _delay_ms(50); beep_0(); } if(hour == 24) hour = 0; if(hour == -1) hour = 23; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[121][a][0])) | pgm_read_byte(&(frames[122 + hour][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[121][a][1])) | pgm_read_byte(&(frames[122 + hour][a][1])); } } if(next_state == 1) { hour = ((hour / 10) << 4) | (hour % 10); //decimal to BCD RTC_Write(HOUR_WRITE,hour); //hour = set hour RTC_Write(0x82,0x00); //minute = 0 RTC_Write(0x80,0x00); //second = 0 } } /*This function writes to the RTC just some SPI bit-banging*/ void RTC_Write(unsigned char RTC_ADD,unsigned char RTC_DATA) { unsigned char a; pinMode(RTC_IO,OUTPUT); //make sure the IO pin is set as an output digitalWrite(RTC_CE,HIGH); //Chip Enable HIGH to enable communication for(a = 0; a < 8 ; a++) //Goes over the RTC_ADD byte { digitalWrite(RTC_CLK,LOW); //Clears the CLK line if((RTC_ADD & (1 << a)) == 0) //Checks the state of each bit in the RTC_ADD byte and sets the IO line accordingly(LSB first) digitalWrite(RTC_IO,LOW); else digitalWrite(RTC_IO,HIGH); _delay_us(10); //A small delay so that the RTC will have time to read the IO state digitalWrite(RTC_CLK,HIGH); //sets the CLK line and by so shifts the data in to the RTC } for(a = 0; a < 8 ; a++) //Goes over the RTC_DATA byte { digitalWrite(RTC_CLK,LOW); //Clears the CLK line if((RTC_DATA & (1 << a)) == 0) //Checks the state of each bit in the RTC_ADD byte and sets the IO line accordingly(LSB first) digitalWrite(RTC_IO,LOW); else digitalWrite(RTC_IO,HIGH); _delay_us(10); //A small delay so that the RTC will have time to read the IO state digitalWrite(RTC_CLK,HIGH); //sets the CLK line and by so shifts the data in to the RTC } digitalWrite(RTC_CLK,LOW); digitalWrite(RTC_CE,LOW); //Chip Enable goes LOW and by so ending the communicatin with the RTC } /*This function reads from the RTC just some SPI bit-banging*/ unsigned char RTC_Read(unsigned char RTC_ADD) { unsigned char a; unsigned char DATA = 0; pinMode(RTC_IO,OUTPUT); //make sure the IO pin is set as an output digitalWrite(RTC_CE,HIGH); //Chip Enable HIGH to enable communication for(a = 0; a < 8 ; a++) //Goes over the RTC_ADD byte { digitalWrite(RTC_CLK,LOW); //Clears the CLK line if((RTC_ADD & (1 << a)) == 0) //Checks the state of each bit in the RTC_ADD byte and sets the IO line accordingly(LSB first) digitalWrite(RTC_IO,LOW); else digitalWrite(RTC_IO,HIGH); _delay_us(10); //A small delay so that the RTC will have time to read the IO state digitalWrite(RTC_CLK,HIGH); //sets the CLK line and by so shifts the data in to the RTC } pinMode(RTC_IO,INPUT); for(a = 0; a < 8 ; a++) //Reads the byte from the RTC { digitalWrite(RTC_CLK,LOW); //Clears the CLK line (Gets the data from the RTC) _delay_us(10); //Small delay to let the RTC time to react DATA |= digitalRead(RTC_IO) << a; //Reads the bit and puts it in the right place digitalWrite(RTC_CLK,HIGH); _delay_us(10); //Small delay to let the RTC time to react } digitalWrite(RTC_CLK,LOW); digitalWrite(RTC_CE,LOW); //Chip Enable goes LOW and by so ending the communicatin with the RTC return DATA; //returns the DATA from the RTC } /*This is the main timer interrupt the updates the display*/ ISR(TIMER2_COMPA_vect) { PORTB &= ~0x04; // latch off, enables shift register updating(I didn't use the digital Write function because it's slow) spi_transfer((1 << row_cnt)&0x00FF); // send the LOW ROW position spi_transfer(((1 << row_cnt)&0xFF00)>>8);// send the HIGH ROW position spi_transfer(display_buffer[row_cnt][1]);// send the HIGH column data spi_transfer(display_buffer[row_cnt][0]);// send the LOW column data PORTB |= 0x04; // latch on the new data row_cnt++; // increase the row counter if(row_cnt == 16) // check if the display finished updating and if so reset the row counter row_cnt = 0; } /*This functin sets up the timer and it's interrupt*/ void timer0_setup() { TCCR2A = 0x02; //Use Timer0 in CTC(Clear Timer On Compare Match) mode TCCR2B = 0x07; //Use the system clock(16MHz) with a prescaler of 1024 OCR2A = 10; //Set the match value (10 gives a delay of 640uS) TIMSK2 = 0x02; //Enables the CTC A interrupt } /*This is the simon game*/ void simon_game() { unsigned char pattern[32]; unsigned char a,b,game_state = 1,turn = 1,player = 1,moves,select; for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[146][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[146][a][1])); } randomSeed(analogRead(0)); //Create a random seed by reading a free analog pin for(a = 0; a < 32 ; a++) //fill the main array with random valeus from 1 to 4 pattern[a] = random(1,5); _delay_ms(1000); while(game_state) //main game loop { for(a = 0; a < turn; a++) //This loops goes over the pattern you need to follow, gets longer by one with every good turn { for(b=0;b<16;b++) //Display the position { display_buffer[b][0] = pgm_read_byte(&(frames[146+pattern[a]][b][0])); display_buffer[b][1] = pgm_read_byte(&(frames[146+pattern[a]][b][1])); } switch(pattern[a]) //make the right sound { case 1: beep_0(); break; case 2: beep_1(); break; case 3: beep_2(); break; case 4: beep_3(); break; } _delay_ms(250); for(b=0;b<16;b++) { display_buffer[b][0] = pgm_read_byte(&(frames[146][b][0])); display_buffer[b][1] = pgm_read_byte(&(frames[146][b][1])); } _delay_ms(250); } moves = 0; while(player) //This loops waits for an input from the player { select = 0; if(digitalRead(B_U_R) == LOW) { select = 2; beep_1(); } if(digitalRead(B_U_L) == LOW) { select = 1; beep_0(); } if(digitalRead(B_D_R) == LOW) { select = 4; beep_3(); } if(digitalRead(B_D_L) == LOW) { select = 3; beep_2(); } if(select != 0) { for(a=0;a<16;a++) { display_buffer[a][0] = pgm_read_byte(&(frames[150 + select][a][0])); display_buffer[a][1] = pgm_read_byte(&(frames[150 + select][a][1])); } _delay_ms(250); for(b=0;b<16;b++) { display_buffer[b][0] = pgm_read_byte(&(frames[146][b][0])); display_buffer[b][1] = pgm_read_byte(&(frames[146][b][1])); } if(select == pattern[moves]) //check if the selected input is correct { moves++; //Inc the move counter if(moves == turn) //Exit the loop if all of the inputs are correct player = 0; } else //If the player got it wrong end the game { player = 0; game_state = 0; } } } turn++; player = 1; _delay_ms(500); if(turn == 33) // yay you done them all game_state = 0; } if(turn < 5) // you didn't do so good PET_STATS[HPN] -= 2; //-2 the pet is sad with your preformence if( (turn >= 5) && (turn < 10) ) //not bad PET_STATS[HPN] += 1; //+1 hpn if( (turn >= 10) && (turn < 15) ) // good PET_STATS[HPN] += 2; //+2 hpn if(turn >= 15) //very nice PET_STATS[HPN] += 3; //+3 hpn /*check for over flow or "underflow"(have no idea if this is a real term)*/ if(PET_STATS[HPN] > HPN_LVL_CAP) PET_STATS[HPN] = HPN_LVL_CAP; if(PET_STATS[HPN] <= 0) PET_STATS[HPN] = 0; } /*Beeping functions with diffrent pitches*/ void beep_0() { int a; for(a = 0; a < 300; a++) { digitalWrite(PIEZZO,HIGH); _delay_us(300); digitalWrite(PIEZZO,LOW); _delay_us(300); } } void beep_1() { int a; for(a = 0; a < 250; a++) { digitalWrite(PIEZZO,HIGH); _delay_us(400); digitalWrite(PIEZZO,LOW); _delay_us(400); } } void beep_2() { int a; for(a = 0; a < 200; a++) { digitalWrite(PIEZZO,HIGH); _delay_us(500); digitalWrite(PIEZZO,LOW); _delay_us(500); } } void beep_3() { int a; for(a = 0; a < 150; a++) { digitalWrite(PIEZZO,HIGH); _delay_us(600); digitalWrite(PIEZZO,LOW); _delay_us(600); } } /*SPI settings*/ void setupSPI() { SPCR |= ( (1<