Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
CrossyChicken/CrossyChicken.cpp@12:a0e0939a498f, 2020-05-13 (annotated)
- Committer:
- el19tb
- Date:
- Wed May 13 03:04:45 2020 +0000
- Revision:
- 12:a0e0939a498f
- Parent:
- 11:cc5861abfca5
- Child:
- 13:cd6d2f999057
created a sprite class, made the car objects and lanes more structured
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el19tb | 2:86cef2afa648 | 1 | #include "CrossyChicken.h" |
| el19tb | 2:86cef2afa648 | 2 | #include "Menu.h" |
| el19tb | 3:648c9d5001be | 3 | #include "GraphicEngine.h" |
| el19tb | 3:648c9d5001be | 4 | #include <vector> |
| el19tb | 3:648c9d5001be | 5 | #include <stdio.h> |
| el19tb | 3:648c9d5001be | 6 | #include <cstddef> |
| el19tb | 2:86cef2afa648 | 7 | |
| el19tb | 5:6e3afee7eac3 | 8 | // start from the top (height) |
| el19tb | 2:86cef2afa648 | 9 | Gamepad gamepad; |
| el19tb | 2:86cef2afa648 | 10 | |
| el19tb | 3:648c9d5001be | 11 | //create three class: CAR LANE, SAFETY LANE, OBSTACLE LANE(water) |
| el19tb | 3:648c9d5001be | 12 | //random |
| el19tb | 3:648c9d5001be | 13 | //algoritmic way of generating lanes |
| el19tb | 3:648c9d5001be | 14 | |
| el19tb | 2:86cef2afa648 | 15 | //size of each each tile in the game |
| el19tb | 4:aae7f8d4ab78 | 16 | int grid = 4; |
| el19tb | 2:86cef2afa648 | 17 | |
| el19tb | 3:648c9d5001be | 18 | //make one object of chicken |
| el19tb | 3:648c9d5001be | 19 | //use this to move around the lcd |
| el19tb | 6:e285eaf8bdcd | 20 | Chicken chicken((84/2)-grid/2, 48-grid, grid); |
| el19tb | 3:648c9d5001be | 21 | Chicken *chickenptr= &chicken; |
| el19tb | 3:648c9d5001be | 22 | |
| el19tb | 3:648c9d5001be | 23 | //there will be multiple cars |
| el19tb | 5:6e3afee7eac3 | 24 | Car firstLane[2]; |
| el19tb | 5:6e3afee7eac3 | 25 | Car secondLane[2]; |
| el19tb | 5:6e3afee7eac3 | 26 | Car thirdLane[3]; |
| el19tb | 7:1dce07fd0867 | 27 | Car fourthLane[3]; |
| el19tb | 7:1dce07fd0867 | 28 | Car log1Lane[2]; |
| el19tb | 7:1dce07fd0867 | 29 | Car lo[2]; |
| el19tb | 7:1dce07fd0867 | 30 | Car logger[2]; |
| el19tb | 9:d210eede4a1b | 31 | Car vop[2]; |
| el19tb | 3:648c9d5001be | 32 | |
| el19tb | 8:52794de935b2 | 33 | int screenW = 84; |
| el19tb | 8:52794de935b2 | 34 | int screenH = 48; |
| el19tb | 8:52794de935b2 | 35 | |
| el19tb | 3:648c9d5001be | 36 | //class that whill show objects |
| el19tb | 3:648c9d5001be | 37 | GraphicEngine graphics(chickenptr); |
| el19tb | 2:86cef2afa648 | 38 | |
| el19tb | 8:52794de935b2 | 39 | bool frogLog = false; |
| el19tb | 8:52794de935b2 | 40 | bool frogDie = false; // whenever the frog is above safety lane in the middle |
| el19tb | 8:52794de935b2 | 41 | bool attach = false; |
| el19tb | 8:52794de935b2 | 42 | |
| el19tb | 11:cc5861abfca5 | 43 | CrossyChicken::CrossyChicken(Level *level) |
| el19tb | 11:cc5861abfca5 | 44 | { |
| el19tb | 11:cc5861abfca5 | 45 | this->local_level = level; |
| el19tb | 11:cc5861abfca5 | 46 | } |
| el19tb | 11:cc5861abfca5 | 47 | |
| el19tb | 2:86cef2afa648 | 48 | //main function that starts the game |
| el19tb | 3:648c9d5001be | 49 | void CrossyChicken::start(){ |
| el19tb | 2:86cef2afa648 | 50 | //game setup |
| el19tb | 3:648c9d5001be | 51 | graphics.init(); |
| el19tb | 3:648c9d5001be | 52 | graphics.contrast(); |
| el19tb | 3:648c9d5001be | 53 | graphics.backLightOn(); |
| el19tb | 2:86cef2afa648 | 54 | gamepad.init(); |
| el19tb | 4:aae7f8d4ab78 | 55 | |
| el19tb | 5:6e3afee7eac3 | 56 | //first lane of left racers |
| el19tb | 5:6e3afee7eac3 | 57 | firstLane[0].setSeperation(0); |
| el19tb | 7:1dce07fd0867 | 58 | firstLane[1].setSeperation(20); |
| el19tb | 5:6e3afee7eac3 | 59 | firstLane[0].setRow(2); |
| el19tb | 5:6e3afee7eac3 | 60 | firstLane[1].setRow(2); |
| el19tb | 4:aae7f8d4ab78 | 61 | |
| el19tb | 5:6e3afee7eac3 | 62 | secondLane[0].setSeperation(0); |
| el19tb | 7:1dce07fd0867 | 63 | secondLane[1].setSeperation(20); |
| el19tb | 5:6e3afee7eac3 | 64 | secondLane[0].setRow(3); |
| el19tb | 5:6e3afee7eac3 | 65 | secondLane[1].setRow(3); |
| el19tb | 5:6e3afee7eac3 | 66 | |
| el19tb | 7:1dce07fd0867 | 67 | thirdLane[0].setSeperation(0); |
| el19tb | 7:1dce07fd0867 | 68 | thirdLane[1].setSeperation(20); |
| el19tb | 7:1dce07fd0867 | 69 | thirdLane[2].setSeperation(40); |
| el19tb | 5:6e3afee7eac3 | 70 | thirdLane[0].setRow(4); |
| el19tb | 5:6e3afee7eac3 | 71 | thirdLane[1].setRow(4); |
| el19tb | 5:6e3afee7eac3 | 72 | thirdLane[2].setRow(4); |
| el19tb | 7:1dce07fd0867 | 73 | |
| el19tb | 7:1dce07fd0867 | 74 | fourthLane[0].setSeperation(10); |
| el19tb | 7:1dce07fd0867 | 75 | fourthLane[1].setSeperation(30); |
| el19tb | 7:1dce07fd0867 | 76 | fourthLane[2].setSeperation(50); |
| el19tb | 7:1dce07fd0867 | 77 | fourthLane[0].setRow(5); |
| el19tb | 7:1dce07fd0867 | 78 | fourthLane[1].setRow(5); |
| el19tb | 7:1dce07fd0867 | 79 | fourthLane[2].setRow(5); |
| el19tb | 7:1dce07fd0867 | 80 | |
| el19tb | 7:1dce07fd0867 | 81 | // log lane 1 |
| el19tb | 7:1dce07fd0867 | 82 | log1Lane[0].setSeperation(0); |
| el19tb | 7:1dce07fd0867 | 83 | log1Lane[1].setSeperation(20); |
| el19tb | 7:1dce07fd0867 | 84 | log1Lane[0].setRow(7); |
| el19tb | 7:1dce07fd0867 | 85 | log1Lane[1].setRow(7); |
| el19tb | 7:1dce07fd0867 | 86 | |
| el19tb | 7:1dce07fd0867 | 87 | // log lane 2 |
| el19tb | 7:1dce07fd0867 | 88 | lo[0].setSeperation(10); |
| el19tb | 7:1dce07fd0867 | 89 | lo[1].setSeperation(30); |
| el19tb | 7:1dce07fd0867 | 90 | lo[0].setRow(8); |
| el19tb | 7:1dce07fd0867 | 91 | lo[1].setRow(8); |
| el19tb | 7:1dce07fd0867 | 92 | |
| el19tb | 7:1dce07fd0867 | 93 | // log lane 3 |
| el19tb | 7:1dce07fd0867 | 94 | logger[0].setSeperation(0); |
| el19tb | 7:1dce07fd0867 | 95 | logger[1].setSeperation(20); |
| el19tb | 7:1dce07fd0867 | 96 | logger[0].setRow(9); |
| el19tb | 7:1dce07fd0867 | 97 | logger[1].setRow(9); |
| el19tb | 9:d210eede4a1b | 98 | |
| el19tb | 9:d210eede4a1b | 99 | // log lane 3 |
| el19tb | 9:d210eede4a1b | 100 | vop[0].setSeperation(0); |
| el19tb | 9:d210eede4a1b | 101 | vop[1].setSeperation(20); |
| el19tb | 9:d210eede4a1b | 102 | vop[0].setRow(10); |
| el19tb | 9:d210eede4a1b | 103 | vop[1].setRow(10); |
| el19tb | 5:6e3afee7eac3 | 104 | |
| el19tb | 2:86cef2afa648 | 105 | //keep reading and processing user input |
| el19tb | 3:648c9d5001be | 106 | while(1) { |
| el19tb | 3:648c9d5001be | 107 | graphics.clear(); |
| el19tb | 8:52794de935b2 | 108 | |
| el19tb | 8:52794de935b2 | 109 | for(int i = 0; i < 2; i++){ |
| el19tb | 5:6e3afee7eac3 | 110 | moveCar(&firstLane[i], 2, (-2)); // change x position (moving) |
| el19tb | 5:6e3afee7eac3 | 111 | } |
| el19tb | 5:6e3afee7eac3 | 112 | |
| el19tb | 5:6e3afee7eac3 | 113 | for(int x = 0; x < 2; x++){ |
| el19tb | 5:6e3afee7eac3 | 114 | moveCar(&secondLane[x], 1, 1); |
| el19tb | 5:6e3afee7eac3 | 115 | } |
| el19tb | 5:6e3afee7eac3 | 116 | |
| el19tb | 5:6e3afee7eac3 | 117 | for(int t = 0; t < 3; t++){ |
| el19tb | 5:6e3afee7eac3 | 118 | moveCar(&thirdLane[t], 2, 1); |
| el19tb | 7:1dce07fd0867 | 119 | } |
| el19tb | 7:1dce07fd0867 | 120 | |
| el19tb | 7:1dce07fd0867 | 121 | for(int c = 0; c < 3; c++){ |
| el19tb | 7:1dce07fd0867 | 122 | moveCar(&fourthLane[c], 2, 1); |
| el19tb | 7:1dce07fd0867 | 123 | } |
| el19tb | 7:1dce07fd0867 | 124 | |
| el19tb | 7:1dce07fd0867 | 125 | for(int v = 0; v < 2; v++){ |
| el19tb | 8:52794de935b2 | 126 | moveCar(&log1Lane[v], 1, 1); |
| el19tb | 7:1dce07fd0867 | 127 | } |
| el19tb | 7:1dce07fd0867 | 128 | |
| el19tb | 7:1dce07fd0867 | 129 | for(int b = 0; b < 2; b++){ |
| el19tb | 7:1dce07fd0867 | 130 | moveCar(&lo[b], 2, 1); |
| el19tb | 9:d210eede4a1b | 131 | // moveCar(&logger[b], 2, 2); |
| el19tb | 9:d210eede4a1b | 132 | moveCar(&vop[b], 1, 2); |
| el19tb | 5:6e3afee7eac3 | 133 | |
| el19tb | 5:6e3afee7eac3 | 134 | } |
| el19tb | 5:6e3afee7eac3 | 135 | |
| el19tb | 5:6e3afee7eac3 | 136 | graphics.showCar(firstLane); |
| el19tb | 5:6e3afee7eac3 | 137 | graphics.showCar(secondLane); |
| el19tb | 5:6e3afee7eac3 | 138 | graphics.showCar(thirdLane); |
| el19tb | 7:1dce07fd0867 | 139 | graphics.showCar(fourthLane); |
| el19tb | 7:1dce07fd0867 | 140 | graphics.showCar(log1Lane); |
| el19tb | 7:1dce07fd0867 | 141 | graphics.showCar(lo); |
| el19tb | 9:d210eede4a1b | 142 | graphics.showCar(logger); |
| el19tb | 9:d210eede4a1b | 143 | graphics.showCar(vop); |
| el19tb | 9:d210eede4a1b | 144 | |
| el19tb | 8:52794de935b2 | 145 | graphics.showChicken(); |
| el19tb | 8:52794de935b2 | 146 | process_input(); |
| el19tb | 8:52794de935b2 | 147 | |
| el19tb | 8:52794de935b2 | 148 | // now when the chicken is above the safety |
| el19tb | 8:52794de935b2 | 149 | // lane we need to ensure that it only can go on logs |
| el19tb | 8:52794de935b2 | 150 | if(chicken.y < screenH - grid*6){ |
| el19tb | 8:52794de935b2 | 151 | frogDie = true; // frog can die if it is in water |
| el19tb | 7:1dce07fd0867 | 152 | |
| el19tb | 8:52794de935b2 | 153 | //if it is not in a log |
| el19tb | 8:52794de935b2 | 154 | for(int x = 0; x < 2; x++){ |
| el19tb | 8:52794de935b2 | 155 | setCollision(&log1Lane[x]); |
| el19tb | 9:d210eede4a1b | 156 | setCollision(&lo[x]); |
| el19tb | 9:d210eede4a1b | 157 | setCollision(&logger[x]); |
| el19tb | 9:d210eede4a1b | 158 | setCollision(&vop[x]); |
| el19tb | 9:d210eede4a1b | 159 | |
| el19tb | 8:52794de935b2 | 160 | if(attach){ |
| el19tb | 8:52794de935b2 | 161 | frogOnLog(&log1Lane[x]); |
| el19tb | 9:d210eede4a1b | 162 | frogOnLog(&lo[x]); |
| el19tb | 9:d210eede4a1b | 163 | frogOnLog(&logger[x]); |
| el19tb | 9:d210eede4a1b | 164 | frogOnLog(&vop[x]); |
| el19tb | 9:d210eede4a1b | 165 | |
| el19tb | 8:52794de935b2 | 166 | } |
| el19tb | 8:52794de935b2 | 167 | } |
| el19tb | 8:52794de935b2 | 168 | |
| el19tb | 8:52794de935b2 | 169 | if(!attach){ |
| el19tb | 8:52794de935b2 | 170 | graphics.print(); |
| el19tb | 9:d210eede4a1b | 171 | } |
| el19tb | 6:e285eaf8bdcd | 172 | } |
| el19tb | 9:d210eede4a1b | 173 | |
| el19tb | 3:648c9d5001be | 174 | graphics.refresh(); |
| el19tb | 9:d210eede4a1b | 175 | wait_ms(70); |
| el19tb | 2:86cef2afa648 | 176 | } |
| el19tb | 2:86cef2afa648 | 177 | } |
| el19tb | 2:86cef2afa648 | 178 | |
| el19tb | 7:1dce07fd0867 | 179 | // log intersects then frog.x = log[i].speed |
| el19tb | 7:1dce07fd0867 | 180 | // frog is attached function |
| el19tb | 7:1dce07fd0867 | 181 | // detach the frog when user goes up or down |
| el19tb | 7:1dce07fd0867 | 182 | // if the frog is back to the safe zone detatch also |
| el19tb | 7:1dce07fd0867 | 183 | // whenever the frog moves detach |
| el19tb | 2:86cef2afa648 | 184 | //A moves right |
| el19tb | 2:86cef2afa648 | 185 | //X moves upward |
| el19tb | 2:86cef2afa648 | 186 | //B moves downward |
| el19tb | 2:86cef2afa648 | 187 | //Y moves left |
| el19tb | 2:86cef2afa648 | 188 | void CrossyChicken::process_input() { |
| el19tb | 3:648c9d5001be | 189 | //determine the input |
| el19tb | 8:52794de935b2 | 190 | /* make this a switch statement */ |
| el19tb | 3:648c9d5001be | 191 | if(gamepad.A_pressed()){ |
| el19tb | 3:648c9d5001be | 192 | moveChicken(1,0); |
| el19tb | 8:52794de935b2 | 193 | attach = false; |
| el19tb | 3:648c9d5001be | 194 | } else if(gamepad.X_pressed()){ |
| el19tb | 3:648c9d5001be | 195 | moveChicken(0,-1); |
| el19tb | 8:52794de935b2 | 196 | attach = false; |
| el19tb | 3:648c9d5001be | 197 | } else if(gamepad.B_pressed()){ |
| el19tb | 3:648c9d5001be | 198 | moveChicken(0,1); |
| el19tb | 8:52794de935b2 | 199 | attach = false; |
| el19tb | 3:648c9d5001be | 200 | } else if(gamepad.Y_pressed()){ |
| el19tb | 3:648c9d5001be | 201 | moveChicken(-1,0); |
| el19tb | 8:52794de935b2 | 202 | attach = false; |
| el19tb | 8:52794de935b2 | 203 | } |
| el19tb | 8:52794de935b2 | 204 | } |
| el19tb | 8:52794de935b2 | 205 | |
| el19tb | 8:52794de935b2 | 206 | // make the frog move same speed as log |
| el19tb | 8:52794de935b2 | 207 | // if the frog moves then detach |
| el19tb | 8:52794de935b2 | 208 | void CrossyChicken::frogOnLog(Car *log) { |
| el19tb | 9:d210eede4a1b | 209 | if(log->seperation != 0){ |
| el19tb | 9:d210eede4a1b | 210 | chicken.x += 1.0; |
| el19tb | 9:d210eede4a1b | 211 | } |
| el19tb | 2:86cef2afa648 | 212 | } |
| el19tb | 2:86cef2afa648 | 213 | |
| el19tb | 3:648c9d5001be | 214 | //moves the chicken around the grid |
| el19tb | 3:648c9d5001be | 215 | void CrossyChicken::moveChicken(int xWay, int yWay){ |
| el19tb | 3:648c9d5001be | 216 | //increment the left side of the chicken by a value of the grid size |
| el19tb | 4:aae7f8d4ab78 | 217 | chicken.x += xWay * 4; |
| el19tb | 3:648c9d5001be | 218 | |
| el19tb | 3:648c9d5001be | 219 | //increment the top side by a value of grid sizw |
| el19tb | 4:aae7f8d4ab78 | 220 | chicken.y += yWay * 4; |
| el19tb | 3:648c9d5001be | 221 | |
| el19tb | 6:e285eaf8bdcd | 222 | chicken.left_side = chicken.x; |
| el19tb | 6:e285eaf8bdcd | 223 | chicken.right_side = grid + chicken.x; |
| el19tb | 6:e285eaf8bdcd | 224 | chicken.up = chicken.y; |
| el19tb | 6:e285eaf8bdcd | 225 | chicken.down = grid + chicken.y; |
| el19tb | 8:52794de935b2 | 226 | |
| el19tb | 3:648c9d5001be | 227 | //display the new state of the chicken |
| el19tb | 9:d210eede4a1b | 228 | //graphics.showChicken(); |
| el19tb | 3:648c9d5001be | 229 | |
| el19tb | 8:52794de935b2 | 230 | //wait_ms(30); |
| el19tb | 2:86cef2afa648 | 231 | } |
| el19tb | 2:86cef2afa648 | 232 | |
| el19tb | 5:6e3afee7eac3 | 233 | void CrossyChicken::moveCar(Car *car, int dir, int x) { |
| el19tb | 5:6e3afee7eac3 | 234 | car->speedMedium(dir, x); |
| el19tb | 4:aae7f8d4ab78 | 235 | |
| el19tb | 8:52794de935b2 | 236 | // check if car goes out of bounds |
| el19tb | 5:6e3afee7eac3 | 237 | if(car->vehicle.x > 84+grid){ |
| el19tb | 5:6e3afee7eac3 | 238 | car->vehicle.x = -4; |
| el19tb | 3:648c9d5001be | 239 | |
| el19tb | 5:6e3afee7eac3 | 240 | } else if(car->vehicle.x < -4){ |
| el19tb | 5:6e3afee7eac3 | 241 | car->vehicle.x = 84 + grid; |
| el19tb | 5:6e3afee7eac3 | 242 | } |
| el19tb | 5:6e3afee7eac3 | 243 | } |
| el19tb | 5:6e3afee7eac3 | 244 | |
| el19tb | 5:6e3afee7eac3 | 245 | // debug |
| el19tb | 8:52794de935b2 | 246 | void CrossyChicken::setCollision(Car *car){ |
| el19tb | 4:aae7f8d4ab78 | 247 | |
| el19tb | 5:6e3afee7eac3 | 248 | float other_bottom = car->vehicle.height + car->vehicle.y; |
| el19tb | 6:e285eaf8bdcd | 249 | |
| el19tb | 6:e285eaf8bdcd | 250 | |
| el19tb | 5:6e3afee7eac3 | 251 | if(!(chicken.up >= other_bottom || |
| el19tb | 5:6e3afee7eac3 | 252 | (chicken.right_side <= car->vehicle.x) || |
| el19tb | 5:6e3afee7eac3 | 253 | (chicken.down <= car->vehicle.y) || |
| el19tb | 5:6e3afee7eac3 | 254 | chicken.left_side >= (car->vehicle.width + car->vehicle.x))){ |
| el19tb | 5:6e3afee7eac3 | 255 | graphics.printTest(); |
| el19tb | 8:52794de935b2 | 256 | |
| el19tb | 8:52794de935b2 | 257 | if(chicken.y < screenH - grid*6){ |
| el19tb | 8:52794de935b2 | 258 | attach = true; |
| el19tb | 8:52794de935b2 | 259 | } else { |
| el19tb | 8:52794de935b2 | 260 | attach = false; |
| el19tb | 8:52794de935b2 | 261 | } |
| el19tb | 8:52794de935b2 | 262 | } |
| el19tb | 8:52794de935b2 | 263 | } |
| el19tb | 8:52794de935b2 | 264 | |
| el19tb | 8:52794de935b2 | 265 | bool CrossyChicken::returnCollision(Car* log){ |
| el19tb | 8:52794de935b2 | 266 | |
| el19tb | 8:52794de935b2 | 267 | float ob= log->vehicle.height + log->vehicle.y; |
| el19tb | 8:52794de935b2 | 268 | |
| el19tb | 8:52794de935b2 | 269 | if(!(chicken.up >= ob|| |
| el19tb | 8:52794de935b2 | 270 | (chicken.right_side <= log->vehicle.x) || |
| el19tb | 8:52794de935b2 | 271 | (chicken.down <= log->vehicle.y) || |
| el19tb | 8:52794de935b2 | 272 | chicken.left_side >= (log->vehicle.width + log->vehicle.x))){ |
| el19tb | 8:52794de935b2 | 273 | return true; |
| el19tb | 5:6e3afee7eac3 | 274 | } |
| el19tb | 5:6e3afee7eac3 | 275 | } |
| el19tb | 5:6e3afee7eac3 | 276 | |
| el19tb | 11:cc5861abfca5 | 277 | void drawObjects() |
| el19tb | 11:cc5861abfca5 | 278 | { |
| el19tb | 12:a0e0939a498f | 279 | /* |
| el19tb | 11:cc5861abfca5 | 280 | std::vector<ObjectInfo *>::size_type it; |
| el19tb | 11:cc5861abfca5 | 281 | |
| el19tb | 11:cc5861abfca5 | 282 | for(auto lane : first_level) |
| el19tb | 11:cc5861abfca5 | 283 | { |
| el19tb | 11:cc5861abfca5 | 284 | |
| el19tb | 11:cc5861abfca5 | 285 | |
| el19tb | 11:cc5861abfca5 | 286 | } |
| el19tb | 12:a0e0939a498f | 287 | */ |
| el19tb | 12:a0e0939a498f | 288 | |
| el19tb | 12:a0e0939a498f | 289 | |
| el19tb | 11:cc5861abfca5 | 290 | } |
| el19tb | 11:cc5861abfca5 | 291 | |
| el19tb | 12:a0e0939a498f | 292 | void CrossyChicken::drawSprites(char obj, int x, int y, int rows, int cols) |
| el19tb | 12:a0e0939a498f | 293 | { |
| el19tb | 12:a0e0939a498f | 294 | switch(obj) |
| el19tb | 12:a0e0939a498f | 295 | { |
| el19tb | 12:a0e0939a498f | 296 | case 'L': |
| el19tb | 12:a0e0939a498f | 297 | graphics.drawObjs(x, y, rows, cols); |
| el19tb | 12:a0e0939a498f | 298 | |
| el19tb | 12:a0e0939a498f | 299 | case 'R' |
| el19tb | 12:a0e0939a498f | 300 | |
| el19tb | 12:a0e0939a498f | 301 | case 'B': |
| el19tb | 12:a0e0939a498f | 302 | |
| el19tb | 12:a0e0939a498f | 303 | case 'N': |
| el19tb | 12:a0e0939a498f | 304 | |
| el19tb | 12:a0e0939a498f | 305 | case 'X': |
| el19tb | 12:a0e0939a498f | 306 | |
| el19tb | 12:a0e0939a498f | 307 | |
| el19tb | 12:a0e0939a498f | 308 | |
| el19tb | 12:a0e0939a498f | 309 | } |
| el19tb | 12:a0e0939a498f | 310 |