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.
Diff: snake.h
- Revision:
- 2:9c075a0a6d4e
- Parent:
- 1:5fcb94bb03db
diff -r 5fcb94bb03db -r 9c075a0a6d4e snake.h
--- a/snake.h Thu Oct 17 04:32:58 2013 +0000
+++ b/snake.h Thu Oct 17 22:09:22 2013 +0000
@@ -7,7 +7,7 @@
#define SNAKE_H
// Macros
-#define START_DIRECTION Up
+#define START_DIRECTION Down
#define START_SPEED 10
// Zero indexed number of columns and rows
#define NUM_COLS 4
@@ -31,13 +31,13 @@
std::list<bodyPiece> snakeBody;
// Function Prototypes
- char moveSnake(ledCube cube); // Moves the snake by one in the direction of movementDirection
+ char moveSnake(ledCube *cube); // Moves the snake by one in the direction of movementDirection
// Will return 1 if out of bounds or if the head has hit a bodyPiece, 0 if still in the boundaries
void addPiece(); // Adds a bodyPiece to the tail
bool isEating(char foodRow, char foodCol);
private:
- char move(char newHeadRow, char newHeadCol, ledCube cube);
+ char move(char newHeadRow, char newHeadCol, ledCube *cube);
};
class food