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
Snake/Snake.h@1:6bcf09972c0d, 2018-04-30 (annotated)
- Committer:
 - weiway
 - Date:
 - Mon Apr 30 15:25:04 2018 +0000
 - Revision:
 - 1:6bcf09972c0d
 - Parent:
 - 0:d557f30e3a95
 - Child:
 - 2:1e90f0ca344c
 
snake file
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| weiway | 0:d557f30e3a95 | 1 | class snake | 
| weiway | 0:d557f30e3a95 | 2 | { | 
| weiway | 1:6bcf09972c0d | 3 | public: | 
| weiway | 1:6bcf09972c0d | 4 | |
| weiway | 0:d557f30e3a95 | 5 | snake(); | 
| weiway | 1:6bcf09972c0d | 6 | ~snake(); | 
| weiway | 0:d557f30e3a95 | 7 | void init(); | 
| weiway | 0:d557f30e3a95 | 8 | void update(Direction d,float mag); | 
| weiway | 0:d557f30e3a95 | 9 | void draw(N5110 &lcd); | 
| weiway | 0:d557f30e3a95 | 10 | Vector2D get_pos(); | 
| weiway | 1:6bcf09972c0d | 11 | void set_pos(Vector2D p); | 
| weiway | 1:6bcf09972c0d | 12 | void add_score(); | 
| weiway | 1:6bcf09972c0d | 13 | int get_score(); | 
| weiway | 0:d557f30e3a95 | 14 | |
| weiway | 0:d557f30e3a95 | 15 | |
| weiway | 0:d557f30e3a95 | 16 | |
| weiway | 0:d557f30e3a95 | 17 | |
| weiway | 1:6bcf09972c0d | 18 | private: | 
| weiway | 1:6bcf09972c0d | 19 | int _array; | 
| weiway | 1:6bcf09972c0d | 20 | int dir; | 
| weiway | 1:6bcf09972c0d | 21 | void s(); | 
| weiway | 1:6bcf09972c0d | 22 | void n(); | 
| weiway | 1:6bcf09972c0d | 23 | void e(); | 
| weiway | 1:6bcf09972c0d | 24 | void w(); | 
| weiway | 1:6bcf09972c0d | 25 | int _xoldpos[100]; | 
| weiway | 1:6bcf09972c0d | 26 | int _xnewpos[100]; | 
| weiway | 1:6bcf09972c0d | 27 | int _yoldpos[100]; | 
| weiway | 1:6bcf09972c0d | 28 | int _ynewpos[100]; | 
| weiway | 0:d557f30e3a95 | 29 | }; | 
| weiway | 0:d557f30e3a95 | 30 | #endif | 
| weiway | 0:d557f30e3a95 | 31 | |
| weiway | 0:d557f30e3a95 | 32 | |
| weiway | 0:d557f30e3a95 | 33 | |
| weiway | 0:d557f30e3a95 | 34 | |
| weiway | 0:d557f30e3a95 | 35 | |
| weiway | 0:d557f30e3a95 | 36 | |
| weiway | 0:d557f30e3a95 | 37 | |
| weiway | 0:d557f30e3a95 | 38 | |
| weiway | 0:d557f30e3a95 | 39 | |
| weiway | 0:d557f30e3a95 | 40 |