Game entry for the Game Programming Contest sponsored by OutrageousCircuits.com (RETRO Game Console)

Dependencies:   mbed

Fork of Official_RETRO by GHI Electronics

Committer:
Rogerup
Date:
Sun Mar 01 09:34:29 2015 +0000
Revision:
4:2d41b942a823
Game Entry

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rogerup 4:2d41b942a823 1 #include "Game.h"
Rogerup 4:2d41b942a823 2
Rogerup 4:2d41b942a823 3 void Game::initTable()
Rogerup 4:2d41b942a823 4 {
Rogerup 4:2d41b942a823 5 if( oldLevel == L_INTRO ) {
Rogerup 4:2d41b942a823 6 if( level == L_INTRO ) return;
Rogerup 4:2d41b942a823 7
Rogerup 4:2d41b942a823 8 disp.clear();
Rogerup 4:2d41b942a823 9 disp.drawString(133, TITY, "NOKO", MAGENT, BLACK);
Rogerup 4:2d41b942a823 10 disp.drawString(134, TITY+10, "BAM!", RED, BLACK);
Rogerup 4:2d41b942a823 11 disp.drawString(130, LEVY, "LEVEL", YELLOW, BLACK);
Rogerup 4:2d41b942a823 12 disp.drawString(133, BESY, "BEST", YELLOW, BLACK);
Rogerup 4:2d41b942a823 13 disp.drawString(136, YOUY, "YOU", YELLOW, BLACK);
Rogerup 4:2d41b942a823 14 disp.drawString(130, MOVY, "MOVES", YELLOW, BLACK);
Rogerup 4:2d41b942a823 15 }
Rogerup 4:2d41b942a823 16 oldLevel = level;
Rogerup 4:2d41b942a823 17
Rogerup 4:2d41b942a823 18 levelCompleted = false;
Rogerup 4:2d41b942a823 19 moves = 0;
Rogerup 4:2d41b942a823 20
Rogerup 4:2d41b942a823 21 disp.fillRect( 0, 112, 160, 16, 0 );
Rogerup 4:2d41b942a823 22 fillTable( 0, 0, TABH, TABW, WALL );
Rogerup 4:2d41b942a823 23
Rogerup 4:2d41b942a823 24 switch( level ) {
Rogerup 4:2d41b942a823 25 case L_INTRO:
Rogerup 4:2d41b942a823 26 disp.clear();
Rogerup 4:2d41b942a823 27
Rogerup 4:2d41b942a823 28 disp.drawString( 28, 9, "NOKO", MAGENT, BLACK, 2 );
Rogerup 4:2d41b942a823 29 disp.drawString( 88, 9, "BAM!", RED, BLACK, 2 );
Rogerup 4:2d41b942a823 30
Rogerup 4:2d41b942a823 31 disp.drawString( 24, 32, "MOVE THE BALLS >", YELLOW, BLACK );
Rogerup 4:2d41b942a823 32 disp.drawString( 24, 42, "TO THEIR PLACES >", YELLOW, BLACK );
Rogerup 4:2d41b942a823 33
Rogerup 4:2d41b942a823 34 disp.drawString( 36, 58, "TRY LESS MOVES", GREEN, BLACK );
Rogerup 4:2d41b942a823 35
Rogerup 4:2d41b942a823 36 //disp.drawString( 30, 61, "ARROWS = MOVE", YELLOW, BLACK );
Rogerup 4:2d41b942a823 37 disp.drawString( 30, 74, "SQUARE = LEVEL ++", YELLOW, BLACK );
Rogerup 4:2d41b942a823 38 disp.drawString( 30, 84, "CIRCLE = LEVEL --", YELLOW, BLACK );
Rogerup 4:2d41b942a823 39 disp.drawString( 30, 94, "LEFT + UP = CLEAR", YELLOW, BLACK );
Rogerup 4:2d41b942a823 40
Rogerup 4:2d41b942a823 41 disp.drawString( 30, 111, "HAVE A GOOD TIME!", RED, BLACK );
Rogerup 4:2d41b942a823 42
Rogerup 4:2d41b942a823 43 showImage( 132, 32, BLACK, BLUE, 0x1051,0x0175, 0x1651, 0 );
Rogerup 4:2d41b942a823 44 showImage( 132, 42, GRAY, WHITE, 0x3311, 0 );
Rogerup 4:2d41b942a823 45 break;
Rogerup 4:2d41b942a823 46
Rogerup 4:2d41b942a823 47 case L_START: // 1 (1.0)
Rogerup 4:2d41b942a823 48 fillTableV( FREE, 0x4566, 0 );
Rogerup 4:2d41b942a823 49 fillTableV( MARK, 0x4912, 0 );
Rogerup 4:2d41b942a823 50 fillTableV( BALL, 0x9511, 0x9811, 0 );
Rogerup 4:2d41b942a823 51 best = 9;
Rogerup 4:2d41b942a823 52 break;
Rogerup 4:2d41b942a823 53
Rogerup 4:2d41b942a823 54 case L_FIRSTBAM: // 2 (1.0)
Rogerup 4:2d41b942a823 55 fillTableV( BONG, 0x4468, 0 );
Rogerup 4:2d41b942a823 56 fillTableV( FREE, 0x4566, 0 );
Rogerup 4:2d41b942a823 57 fillTableV( WALL, 0x6411, 0 );
Rogerup 4:2d41b942a823 58 fillTableV( MARK, 0x9512, 0 );
Rogerup 4:2d41b942a823 59 fillTableV( BALL, 0x4811, 0x4A11,0 );
Rogerup 4:2d41b942a823 60 best = 9;
Rogerup 4:2d41b942a823 61 break;
Rogerup 4:2d41b942a823 62
Rogerup 4:2d41b942a823 63 case L_ZIGZAG: // 3 (1.0)
Rogerup 4:2d41b942a823 64 fillTableV( FREE, 0x4631, 0x4741, 0x5841, 0x6941, 0x7A41, 0x8B41, 0x9C31, 0 );
Rogerup 4:2d41b942a823 65 fillTableV( MARK, 0x9C11, 0xBC11, 0 );
Rogerup 4:2d41b942a823 66 fillTableV( BALL, 0x4611, 0x6611,0 );
Rogerup 4:2d41b942a823 67 best = 11;
Rogerup 4:2d41b942a823 68 break;
Rogerup 4:2d41b942a823 69
Rogerup 4:2d41b942a823 70 case L_FIRSTPOS: // 4 (1.0)
Rogerup 4:2d41b942a823 71 fillTableV( FREE, 0x4566, 0 );
Rogerup 4:2d41b942a823 72 fillTableV( WALL, 0x9711, 0 );
Rogerup 4:2d41b942a823 73 fillTableV( MAR1, 0x5A11, 0x4A11, 0 );
Rogerup 4:2d41b942a823 74 fillTableV( BAL1, 0x9911, 0x9A11, 0 );
Rogerup 4:2d41b942a823 75 best = 13;
Rogerup 4:2d41b942a823 76 break;
Rogerup 4:2d41b942a823 77
Rogerup 4:2d41b942a823 78 case L_MANYBOX: // 41 (1.0)
Rogerup 4:2d41b942a823 79 fillTableV( FREE, 0x1133, 0x1513, 0x1931, 0x1B31, 0x2611, 0x2913, 0x3513, 0 );
Rogerup 4:2d41b942a823 80 fillTableV( FREE, 0x5232, 0x5532, 0x6923, 0 );
Rogerup 4:2d41b942a823 81 fillTableV( FREE, 0x9133, 0x9533, 0x9933, 0 );
Rogerup 4:2d41b942a823 82 fillTableV( WALL, 0x9711, 0xA211, 0xA611, 0xAA11, 0xB911, 0 );
Rogerup 4:2d41b942a823 83 fillTableV( MARK, 0x3311, 0x3711, 0x3B11, 0x7311, 0x7711, 0x7B11, 0xB311, 0xB711, 0xBB11, 0 );
Rogerup 4:2d41b942a823 84 fillTableV( BALL, 0x1111, 0x1511, 0x1911, 0x5211, 0x5511, 0x6911, 0x9111, 0x9511, 0x9911, 0 );
Rogerup 4:2d41b942a823 85 best = 9;
Rogerup 4:2d41b942a823 86 break;
Rogerup 4:2d41b942a823 87
Rogerup 4:2d41b942a823 88 /*
Rogerup 4:2d41b942a823 89 case L_NOBACK: // 470 (1.8)
Rogerup 4:2d41b942a823 90 fillTableV( FREE, 0x03DD, 0 );
Rogerup 4:2d41b942a823 91 fillTableV( WALL, 0x0321, 0xA411, 0xAE11, 0xB511, 0xCD11, 0 );
Rogerup 4:2d41b942a823 92 fillTableV( BONG, 0x0111, 0x041C, 0x152B, 0x3011, 0x366A, 0xB617, 0 );
Rogerup 4:2d41b942a823 93 fillTableV( MARK, 0x1111, 0x3111, 0 );
Rogerup 4:2d41b942a823 94 fillTableV( BALL, 0x1111, 0x3111, 0 );
Rogerup 4:2d41b942a823 95 fillTableV( MAR1, 0xCF11, 0xBF11, 0xCC11, 0 );
Rogerup 4:2d41b942a823 96 fillTableV( BAL1, 0x1411, 0x3511, 0x2311, 0 );
Rogerup 4:2d41b942a823 97 best = 26;
Rogerup 4:2d41b942a823 98 break;
Rogerup 4:2d41b942a823 99 */
Rogerup 4:2d41b942a823 100
Rogerup 4:2d41b942a823 101 case L_FEWMOVES: // 44 2.1
Rogerup 4:2d41b942a823 102 fillTableV( FREE, 0x23AA, 0 );
Rogerup 4:2d41b942a823 103 fillTableV( WALL, 0x3712, 0x6518, 0x8831, 0 );
Rogerup 4:2d41b942a823 104 fillTableV( MARK, 0x9611, 0x9A11, 0 );
Rogerup 4:2d41b942a823 105 fillTableV( BALL, 0x5611, 0x5A11, 0 );
Rogerup 4:2d41b942a823 106 best = 18;
Rogerup 4:2d41b942a823 107 break;
Rogerup 4:2d41b942a823 108
Rogerup 4:2d41b942a823 109 case L_LABYRINTH: // 59 2.5
Rogerup 4:2d41b942a823 110 fillTableV( FREE, 0x0511, 0x1016, 0x1A16, 0x2311, 0x2F11, 0x3014, 0x3917, 0x4011, 0x4614, 0 );
Rogerup 4:2d41b942a823 111 fillTableV( FREE, 0x5012, 0x5611, 0x5B15, 0x6111, 0x6612, 0x6913, 0x6F41, 0x7012, 0x7313, 0 );
Rogerup 4:2d41b942a823 112 fillTableV( FREE, 0x7731, 0x7931, 0x7D13, 0x8011, 0x8311, 0x8541, 0x8B41, 0x8D11, 0x9014, 0 );
Rogerup 4:2d41b942a823 113 fillTableV( FREE, 0x9713, 0x9B13, 0xB016, 0xB723, 0xBB15, 0xC011, 0xCF11, 0xD010, 0 );
Rogerup 4:2d41b942a823 114 fillTableV( MAR1, 0x0011, 0x0B11, 0x0F11, 0x411, 0 );
Rogerup 4:2d41b942a823 115 fillTableV( BAL1, 0xD614, 0 );
Rogerup 4:2d41b942a823 116 best = 98;
Rogerup 4:2d41b942a823 117 break;
Rogerup 4:2d41b942a823 118
Rogerup 4:2d41b942a823 119 case L_FACEFOUR: // 69 3.1
Rogerup 4:2d41b942a823 120 fillTableV( FREE, 0x23AA, 0 );
Rogerup 4:2d41b942a823 121 fillTableV( WALL, 0x4511, 0x4A11, 0x9712, 0 );
Rogerup 4:2d41b942a823 122 fillTableV( MAR1, 0x5611, 0x5911, 0x8712, 0 );
Rogerup 4:2d41b942a823 123 fillTableV( BAL1, 0x9A11, 0x9511, 0x5811, 0x5711, 0 );
Rogerup 4:2d41b942a823 124 best = 50;
Rogerup 4:2d41b942a823 125 break;
Rogerup 4:2d41b942a823 126
Rogerup 4:2d41b942a823 127 case L_MANYBAM: // 101 (3.2)
Rogerup 4:2d41b942a823 128 fillTableV( FREE, 0x23AA, 0 );
Rogerup 4:2d41b942a823 129 fillTableV( WALL, 0x6611, 0x6911, 0xB411, 0 );
Rogerup 4:2d41b942a823 130 fillTableV( BONG, 0x2516, 0x2CA1, 0x3391, 0x4611, 0x4813, 0x6511, 0x7641, 0x7941, 0 );
Rogerup 4:2d41b942a823 131 fillTableV( BONG, 0x8431, 0x8B41, 0 );
Rogerup 4:2d41b942a823 132 fillTableV( MAR1, 0x6712, 0 );
Rogerup 4:2d41b942a823 133 fillTableV( BAL1, 0x5911, 0x5511, 0 );
Rogerup 4:2d41b942a823 134 best = 28;
Rogerup 4:2d41b942a823 135 break;
Rogerup 4:2d41b942a823 136
Rogerup 4:2d41b942a823 137 case L_CHANGEPOS: // 8 (3.7)
Rogerup 4:2d41b942a823 138 fillTableV( FREE, 0x2691, 0x2891, 0 );
Rogerup 4:2d41b942a823 139 fillTableV( MAR1, 0x3711, 0x5711, 0x7711, 0x9711, 0 );
Rogerup 4:2d41b942a823 140 fillTableV( BAL1, 0x9711, 0x7711, 0x5711, 0x3711, 0 );
Rogerup 4:2d41b942a823 141 best = 22;
Rogerup 4:2d41b942a823 142 break;
Rogerup 4:2d41b942a823 143
Rogerup 4:2d41b942a823 144 case L_ONLYTWO: // 73 (3.9)
Rogerup 4:2d41b942a823 145 fillTableV( FREE, 0x117E, 0x831B, 0x913F, 0xC11C, 0xCE12, 0 );
Rogerup 4:2d41b942a823 146 fillTableV( BONG, 0x9F11, 0xA111, 0 );
Rogerup 4:2d41b942a823 147 fillTableV( MARK, 0x8011, 0 );
Rogerup 4:2d41b942a823 148 fillTableV( BALL, 0x8F11, 0 );
Rogerup 4:2d41b942a823 149 fillTableV( MAR1, 0x1111, 0x8E11, 0 );
Rogerup 4:2d41b942a823 150 fillTableV( BAL1, 0x9011, 0x8011, 0 );
Rogerup 4:2d41b942a823 151 best = 50;
Rogerup 4:2d41b942a823 152 break;
Rogerup 4:2d41b942a823 153
Rogerup 4:2d41b942a823 154 case L_NUMBLOCKS: // 94 (4.0)
Rogerup 4:2d41b942a823 155 fillTableV( FREE, 0x0211, 0x03E4, 0x09E4, 0x2F11, 0x3083, 0x3D83, 0xB011, 0xDD11, 0 );
Rogerup 4:2d41b942a823 156 fillTableV( MAR1, 0x1E11, 0xCE11, 0x1F11, 0xDE11, 0x2522, 0 );
Rogerup 4:2d41b942a823 157 fillTableV( BAL1, 0xA922, 0x1111, 0x0111, 0xC012, 0 );
Rogerup 4:2d41b942a823 158 best = 54;
Rogerup 4:2d41b942a823 159 break;
Rogerup 4:2d41b942a823 160
Rogerup 4:2d41b942a823 161 case L_SEPARATED: // 14 10 (4.6)
Rogerup 4:2d41b942a823 162 fillTableV( FREE, 0x4166, 0x4966, 0 );
Rogerup 4:2d41b942a823 163 fillTableV( WALL, 0x5311, 0 );
Rogerup 4:2d41b942a823 164 fillTableV( BONG, 0x4211, 0x4A11, 0x5611, 0x5E11, 0x6411, 0x7911, 0x7B11, 0x8111, 0x8E11, 0x9611, 0 );
Rogerup 4:2d41b942a823 165 fillTableV( MARK, 0x7511, 0x8A11, 0 );
Rogerup 4:2d41b942a823 166 fillTableV( BALL, 0x8311, 0x8B11, 0 );
Rogerup 4:2d41b942a823 167 best = 17;
Rogerup 4:2d41b942a823 168 break;
Rogerup 4:2d41b942a823 169
Rogerup 4:2d41b942a823 170 case L_NUMBERMIX: // 15 79 (4.7)
Rogerup 4:2d41b942a823 171 fillTableV( FREE, 0x11CE, 0 );
Rogerup 4:2d41b942a823 172 fillTableV( WALL, 0x5321, 0x5C21, 0 );
Rogerup 4:2d41b942a823 173 fillTableV( MAR1, 0x8D11, 0x7D11, 0x2D11, 0x5D11, 0x4D11, 0x1D11, 0x6D11, 0x3D11, 0 );
Rogerup 4:2d41b942a823 174 fillTableV( BAL1, 0xCE11, 0xCD11, 0xCC11, 0xCB11, 0xCA11, 0xC911, 0xC811, 0xC711, 0 );
Rogerup 4:2d41b942a823 175 best = 47;
Rogerup 4:2d41b942a823 176 break;
Rogerup 4:2d41b942a823 177
Rogerup 4:2d41b942a823 178 case L_STEPS: // 16 381 (5.0)
Rogerup 4:2d41b942a823 179 fillTableV( FREE, 0x2361, 0x2561, 0x2761, 0x2961, 0x2B61, 0x834A, 0 );
Rogerup 4:2d41b942a823 180 fillTableV( WALL, 0x541C, 0 );
Rogerup 4:2d41b942a823 181 fillTableV( MAR1, 0x2411, 0x2611, 0x2811, 0x2A11, 0x2C11, 0 );
Rogerup 4:2d41b942a823 182 fillTableV( BAL1, 0x6311, 0x6511, 0x6711, 0x6911, 0x6B11, 0 );
Rogerup 4:2d41b942a823 183 best = 48;
Rogerup 4:2d41b942a823 184 break;
Rogerup 4:2d41b942a823 185
Rogerup 4:2d41b942a823 186 case L_BAMPOS: // 17 6 (5.7)
Rogerup 4:2d41b942a823 187 fillTableV( BONG, 0x3488, 0 );
Rogerup 4:2d41b942a823 188 fillTableV( FREE, 0x4566, 0 );
Rogerup 4:2d41b942a823 189 fillTableV( WALL, 0x5911, 0 );
Rogerup 4:2d41b942a823 190 fillTableV( MAR1, 0x6811, 0x4A11, 0 );
Rogerup 4:2d41b942a823 191 fillTableV( BAL1, 0x4A11, 0x6811, 0 );
Rogerup 4:2d41b942a823 192 best = 15;
Rogerup 4:2d41b942a823 193 break;
Rogerup 4:2d41b942a823 194
Rogerup 4:2d41b942a823 195 case L_CHESS: // 18 25 (5.7)
Rogerup 4:2d41b942a823 196 fillTableV( FREE, 0x24A1, 0x26A1, 0x28A1, 0x2AA1, 0x2CA1, 0 );
Rogerup 4:2d41b942a823 197 fillTableV( FREE, 0x3711, 0x3B11, 0x4511, 0x4911, 0x5711, 0x5B11, 0 );
Rogerup 4:2d41b942a823 198 fillTableV( FREE, 0x8511, 0x8911, 0x9711, 0x9B11, 0xA511, 0xA911, 0 );
Rogerup 4:2d41b942a823 199 fillTableV( BONG, 0x2511, 0x2911, 0x6511, 0x6911, 0x7711, 0x7B11, 0xB711, 0xBB11, 0 );
Rogerup 4:2d41b942a823 200 fillTableV( MAR1, 0x2D11, 0x4D11, 0x6D11, 0x8D11, 0xAD11, 0 );
Rogerup 4:2d41b942a823 201 fillTableV( BAL1, 0xB311, 0x9311, 0x7311, 0x5311, 0x3311, 0 );
Rogerup 4:2d41b942a823 202 best = 46;
Rogerup 4:2d41b942a823 203 break;
Rogerup 4:2d41b942a823 204
Rogerup 4:2d41b942a823 205 case L_HAMMER: // 19 464 (6.3)
Rogerup 4:2d41b942a823 206 fillTableV( FREE, 0x0015, 0x0913, 0x0D13, 0x1041, 0x1616, 0x1F31, 0x222C, 0x422B, 0 );
Rogerup 4:2d41b942a823 207 fillTableV( FREE, 0x612E, 0x824C, 0x9051, 0x9F51, 0xC612, 0xD015, 0xD917, 0 );
Rogerup 4:2d41b942a823 208 fillTableV( MARK, 0x4F11, 0x5623, 0x7721, 0 );
Rogerup 4:2d41b942a823 209 fillTableV( BALL, 0x0612, 0x4F11, 0x6021, 0x6F21, 0xD612, 0 );
Rogerup 4:2d41b942a823 210 best = 50; // (Possible 37)
Rogerup 4:2d41b942a823 211 break;
Rogerup 4:2d41b942a823 212
Rogerup 4:2d41b942a823 213 case L_CAREMOVES: // 20 128 (6.5)
Rogerup 4:2d41b942a823 214 fillTableV( FREE, 0x11CE, 0xB031, 0 );
Rogerup 4:2d41b942a823 215 fillTableV( WALL, 0x1A51, 0x3521, 0x3B12, 0x711A, 0x8631, 0x9841, 0xA231, 0xC711, 0 );
Rogerup 4:2d41b942a823 216 fillTableV( BONG, 0x1911, 0x1B24, 0x3411, 0x4611, 0x5911, 0x5B11, 0x6111, 0x7B11, 0 );
Rogerup 4:2d41b942a823 217 fillTableV( BONG, 0x8441, 0x9211, 0x9B11, 0xBD22, 0xC611, 0xC911, 0 );
Rogerup 4:2d41b942a823 218 fillTableV( MAR1, 0x1122, 0 );
Rogerup 4:2d41b942a823 219 fillTableV( BAL1, 0xC021, 0xD111, 0xC111, 0 );
Rogerup 4:2d41b942a823 220 best = 248;
Rogerup 4:2d41b942a823 221 break;
Rogerup 4:2d41b942a823 222
Rogerup 4:2d41b942a823 223 case L_FLUTE: // 21 126 (6.9)
Rogerup 4:2d41b942a823 224 fillTableV( FREE, 0x00E0, 0 );
Rogerup 4:2d41b942a823 225 fillTableV( WALL, 0x0021, 0x0231, 0x0441, 0x0651, 0x0861, 0x0A71, 0x0C81, 0x0E91, 0xA311, 0 );
Rogerup 4:2d41b942a823 226 fillTableV( BONG, 0x3111, 0x4311, 0x5511, 0x6711, 0x7911, 0x8B11, 0x9D11, 0 );
Rogerup 4:2d41b942a823 227 fillTableV( MAR1, 0x0F71, 0 );
Rogerup 4:2d41b942a823 228 fillTableV( BAL1, 0x0111, 0x0311, 0x0511, 0x0711, 0x0911, 0x0B11, 0x0D11, 0 );
Rogerup 4:2d41b942a823 229 best = 118;
Rogerup 4:2d41b942a823 230 break;
Rogerup 4:2d41b942a823 231
Rogerup 4:2d41b942a823 232 case L_CROSS: // 22 136 (7.0)
Rogerup 4:2d41b942a823 233 fillTableV( FREE, 0x12CC, 0 );
Rogerup 4:2d41b942a823 234 fillTableV( WALL, 0x1712, 0x6221, 0x6D21, 0xC712, 0 );
Rogerup 4:2d41b942a823 235 fillTableV( BONG, 0x6722, 0 );
Rogerup 4:2d41b942a823 236 fillTableV( MAR1, 0x5611, 0x5911, 0x8911, 0x8611, 0 );
Rogerup 4:2d41b942a823 237 fillTableV( BAL1, 0x9A11, 0x9511, 0x4511, 0x4A11, 0 );
Rogerup 4:2d41b942a823 238 best = 70;
Rogerup 4:2d41b942a823 239 break;
Rogerup 4:2d41b942a823 240
Rogerup 4:2d41b942a823 241 case L_DIAGONAL: // 23 445 (7.1)
Rogerup 4:2d41b942a823 242 fillTableV( FREE, 0x00E0, 0 );
Rogerup 4:2d41b942a823 243 fillTableV( WALL, 0x0111, 0x2113, 0x4313, 0x6513, 0x8713, 0xA913, 0xCB13, 0x2A21, 0 );
Rogerup 4:2d41b942a823 244 fillTableV( BONG, 0x2411, 0x5711, 0x8A11, 0xBD11, 0 );
Rogerup 4:2d41b942a823 245 fillTableV( MARK, 0x0B25, 0x2E22, 0 );
Rogerup 4:2d41b942a823 246 fillTableV( BALL, 0x0011, 0x1111, 0x2211, 0x3311, 0x4411, 0x5511, 0x6611, 0 );
Rogerup 4:2d41b942a823 247 fillTableV( BALL, 0x7711, 0x8811, 0x9911, 0xAA11, 0xBB11, 0xCC11, 0xDD11, 0 );
Rogerup 4:2d41b942a823 248 best = 78;
Rogerup 4:2d41b942a823 249 break;
Rogerup 4:2d41b942a823 250
Rogerup 4:2d41b942a823 251 case L_LASTSIX: // 24 239 (7.2)
Rogerup 4:2d41b942a823 252 fillTableV( FREE, 0x00E0, 0 );
Rogerup 4:2d41b942a823 253 fillTableV( WALL, 0x501D, 0 );
Rogerup 4:2d41b942a823 254 fillTableV( MARK, 0x0020, 0 );
Rogerup 4:2d41b942a823 255 fillTableV( BALL, 0x6012, 0x6813, 0x7211, 0x7711, 0x8311, 0x8611, 0x9412, 0 );
Rogerup 4:2d41b942a823 256 fillTableV( BALL, 0x8F11, 0x9E12, 0xAD13, 0xBC14, 0xCB15, 0xDA16, 0 );
Rogerup 4:2d41b942a823 257 best = 119;
Rogerup 4:2d41b942a823 258 break;
Rogerup 4:2d41b942a823 259
Rogerup 4:2d41b942a823 260 case L_FORTYTWO: // 24 106 (4.2)
Rogerup 4:2d41b942a823 261 fillTableV( BONG, 0x00E0, 0 );
Rogerup 4:2d41b942a823 262 fillTableV( FREE, 0x11CE, 0 );
Rogerup 4:2d41b942a823 263 fillTableV( WALL, 0x2234, 0x5521, 0x2914, 0x3C11, 0x4914, 0x5911, 0x6914, 0 );
Rogerup 4:2d41b942a823 264 fillTableV( MARK, 0xA323, 0xC312, 0 );
Rogerup 4:2d41b942a823 265 fillTableV( BALL, 0x2322, 0x3A12, 0x5A12, 0 );
Rogerup 4:2d41b942a823 266 best = 42;
Rogerup 4:2d41b942a823 267 break;
Rogerup 4:2d41b942a823 268
Rogerup 4:2d41b942a823 269 case L_ALEXAND: // 25 7 (7.4)
Rogerup 4:2d41b942a823 270 fillTableV( FREE, 0x23AA, 0 );
Rogerup 4:2d41b942a823 271 fillTableV( WALL, 0x3411, 0x6611, 0xAB11, 0 );
Rogerup 4:2d41b942a823 272 fillTableV( MAR1, 0x2311, 0x4511, 0x4811, 0x8611, 0 );
Rogerup 4:2d41b942a823 273 fillTableV( BAL1, 0x5911, 0x8711, 0x2C11, 0x7311, 0 );
Rogerup 4:2d41b942a823 274 best = 23;
Rogerup 4:2d41b942a823 275 break;
Rogerup 4:2d41b942a823 276
Rogerup 4:2d41b942a823 277 case L_CALCULATE: // 26 123 (7.5)
Rogerup 4:2d41b942a823 278 fillTableV( FREE, 0x3574, 0x6114, 0x7311, 0 );
Rogerup 4:2d41b942a823 279 fillTableV( WALL, 0x3711, 0x9611, 0 );
Rogerup 4:2d41b942a823 280 fillTableV( MAR1, 0x5633, 0 );
Rogerup 4:2d41b942a823 281 fillTableV( BAL1, 0x8111, 0x4211, 0x5111, 0x9111, 0x8311, 0x9211, 0x4311, 0x9311, 0x4111, 0 );
Rogerup 4:2d41b942a823 282 best = 76;
Rogerup 4:2d41b942a823 283 break;
Rogerup 4:2d41b942a823 284
Rogerup 4:2d41b942a823 285 case L_MANYBALLS: // 27 9 (8.0)
Rogerup 4:2d41b942a823 286 fillTable( 0, 0, TABH, TABW, FREE );
Rogerup 4:2d41b942a823 287 fillTable( 0, 0, 2, TABW, MARK );
Rogerup 4:2d41b942a823 288 fillTable( TABH-2, 0, 2, TABW, BALL );
Rogerup 4:2d41b942a823 289 fillTable( TABH/2-1, TABW/2-1, 2, 2, WALL );
Rogerup 4:2d41b942a823 290 best = 26;
Rogerup 4:2d41b942a823 291 break;
Rogerup 4:2d41b942a823 292
Rogerup 4:2d41b942a823 293 case L_SPIDERBAM: // 28 110 8.1
Rogerup 4:2d41b942a823 294 fillTableV( FREE, 0x00E8, 0x0841, 0x0931, 0x0A21, 0x0B11, 0x0D21, 0x1C21, 0x2B21, 0 );
Rogerup 4:2d41b942a823 295 fillTableV( FREE, 0x3A21, 0x4921, 0x5841, 0x8921, 0x9A21, 0xAB21, 0xBC21, 0xCD21, 0 );
Rogerup 4:2d41b942a823 296 fillTableV( FREE, 0xA841, 0xB931, 0xCA21, 0xDB11, 0 );
Rogerup 4:2d41b942a823 297 fillTableV( BONG, 0x0821, 0x1511, 0x2611, 0x3122, 0x3711, 0x6111, 0x6311, 0x6511, 0x6711, 0 );
Rogerup 4:2d41b942a823 298 fillTableV( BONG, 0x0821, 0x1511, 0x2611, 0x3122, 0x3711, 0x6111, 0x6311, 0x6511, 0x6711, 0 );
Rogerup 4:2d41b942a823 299 fillTableV( BONG, 0x7011, 0x7211, 0x7411, 0x7611, 0x7811, 0x9122, 0xA711, 0xB611, 0xC511, 0xC821, 0 );
Rogerup 4:2d41b942a823 300 fillTableV( MARK, 0x1011, 0xC011, 0 );
Rogerup 4:2d41b942a823 301 fillTableV( BALL, 0x0E11, 0xDE11, 0 );
Rogerup 4:2d41b942a823 302 best = 65;
Rogerup 4:2d41b942a823 303 break;
Rogerup 4:2d41b942a823 304
Rogerup 4:2d41b942a823 305 case L_CONFUSE: // 29 135 (8.5)
Rogerup 4:2d41b942a823 306 fillTableV( FREE, 0x11CE, 0 );
Rogerup 4:2d41b942a823 307 fillTableV( WALL, 0x2212, 0x4B11, 0x5C11, 0x6D11, 0xA611, 0xCB11, 0 );
Rogerup 4:2d41b942a823 308 fillTableV( BONG, 0x1511, 0x1A11, 0x3311, 0x4711, 0x5211, 0x5911, 0x7121, 0x7A21, 0 );
Rogerup 4:2d41b942a823 309 fillTableV( BONG, 0x8611, 0x9C11, 0xA121, 0xC611, 0xC911, 0xCD11, 0 );
Rogerup 4:2d41b942a823 310 fillTableV( MARK, 0xBE11, 0 );
Rogerup 4:2d41b942a823 311 fillTableV( MAR1, 0xCE11, 0xBD11, 0xAC11, 0 );
Rogerup 4:2d41b942a823 312 fillTableV( BALL, 0x1611, 0 );
Rogerup 4:2d41b942a823 313 fillTableV( BAL1, 0x4411, 0x6611, 0x5511, 0 );
Rogerup 4:2d41b942a823 314 best = 37;
Rogerup 4:2d41b942a823 315 break;
Rogerup 4:2d41b942a823 316
Rogerup 4:2d41b942a823 317 case L_PRECISE: // 30 142 (8.8)
Rogerup 4:2d41b942a823 318 fillTableV( FREE, 0x0614, 0x1631, 0x4687, 0 );
Rogerup 4:2d41b942a823 319 fillTableV( WALL, 0x8842, 0 );
Rogerup 4:2d41b942a823 320 fillTableV( BONG, 0x1812 ,0x4581, 0x4714, 0x5C71, 0x7811, 0x9731, 0x9A31, 0 );
Rogerup 4:2d41b942a823 321 fillTableV( MAR1, 0xB611, 0xBB11, 0 );
Rogerup 4:2d41b942a823 322 fillTableV( BAL1, 0x5911, 0x5811, 0 );
Rogerup 4:2d41b942a823 323 best = 61;
Rogerup 4:2d41b942a823 324 break;
Rogerup 4:2d41b942a823 325
Rogerup 4:2d41b942a823 326 case L_ORDER: // 31 113 (9.8)
Rogerup 4:2d41b942a823 327 fillTableV( FREE, 0x4715, 0x5711, 0x5B41, 0x8A11, 0 );
Rogerup 4:2d41b942a823 328 fillTableV( BONG, 0x5A11, 0 );
Rogerup 4:2d41b942a823 329 fillTableV( MAR1, 0x6713, 0x7713, 0x8713, 0 );
Rogerup 4:2d41b942a823 330 fillTableV( BAL1, 0x8911, 0x8711, 0x7711, 0x6711, 0x6911, 0x7811, 0x7911, 0x6811, 0x8811, 0 );
Rogerup 4:2d41b942a823 331 best = 50;
Rogerup 4:2d41b942a823 332 break;
Rogerup 4:2d41b942a823 333
Rogerup 4:2d41b942a823 334 case L_GRANDMAST: // 32 143 (10.0)
Rogerup 4:2d41b942a823 335 fillTableV( FREE, 0x00E0, 0 );
Rogerup 4:2d41b942a823 336 fillTableV( WALL, 0x0541, 0x1742, 0x2043, 0x3D33, 0x5314, 0x5814, 0x6911, 0x6C11, 0 );
Rogerup 4:2d41b942a823 337 fillTableV( WALL, 0x7211, 0x7611, 0x7A11, 0x8411, 0x8811, 0x8E11, 0x9713, 0 );
Rogerup 4:2d41b942a823 338 fillTableV( WALL, 0xA013, 0xA41C, 0xB313, 0xC611, 0xC814, 0xD014, 0xD914, 0 );
Rogerup 4:2d41b942a823 339 fillTableV( BONG, 0x1911, 0x1B11, 0x1D11, 0x1F11, 0x2831, 0x3231, 0x3B21, 0 );
Rogerup 4:2d41b942a823 340 fillTableV( BONG, 0x4111, 0x5C11, 0x6611, 0x9A11, 0xA714, 0xB411, 0xB611, 0 );
Rogerup 4:2d41b942a823 341 fillTableV( BONG, 0xC511, 0xCC11, 0 );
Rogerup 4:2d41b942a823 342 fillTableV( MARK, 0xDB11, 0 );
Rogerup 4:2d41b942a823 343 fillTableV( MAR1, 0xDD11, 0xDF11, 0xDE11, 0x2021, 0x2111, 0x8C11, 0x9611, 0x9E11, 0 );
Rogerup 4:2d41b942a823 344 fillTableV( BALL, 0xDA11, 0 );
Rogerup 4:2d41b942a823 345 fillTableV( BAL1, 0xC211, 0xC012, 0x4E12, 0x3F11, 0x5011, 0x8311, 0x6B11, 0 );
Rogerup 4:2d41b942a823 346 best = 299;
Rogerup 4:2d41b942a823 347 break;
Rogerup 4:2d41b942a823 348 }
Rogerup 4:2d41b942a823 349
Rogerup 4:2d41b942a823 350 if( level != L_INTRO ) {
Rogerup 4:2d41b942a823 351 showNumber( LEVY, level );
Rogerup 4:2d41b942a823 352 showNumber( BESY, best );
Rogerup 4:2d41b942a823 353 showNumber( YOUY, your[level] );
Rogerup 4:2d41b942a823 354 showNumber( MOVY, moves );
Rogerup 4:2d41b942a823 355 }
Rogerup 4:2d41b942a823 356
Rogerup 4:2d41b942a823 357 led1 = 0; led2 = 0;
Rogerup 4:2d41b942a823 358 pwm = 0; pwm.period_ms(1);
Rogerup 4:2d41b942a823 359 }