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/Snake.cpp
- Revision:
- 19:05cc9f801468
- Parent:
- 18:b391caa5754c
- Child:
- 20:1e6338403427
--- a/Snake/Snake.cpp Mon Apr 08 05:57:04 2019 +0000
+++ b/Snake/Snake.cpp Mon Apr 08 16:46:14 2019 +0000
@@ -249,72 +249,7 @@
}
return length;
}
-/*
-//helps to set the position automatically when we want to restrict it's movement when coliding with lines.
-void Snake::set_pos(Vector2D s)
-{
- if(length == 1) {
- _fx = s.x;
- _fy = s.y;
- }
- else if(length == 2) {
- _xa = s.x;
- _ya = s.y;
- }
- else if(length==3) {
- _xb = s.x;
- _yb = s.y;
- }
- else if(length==4) {
- _xc = s.x;
- _yc = s.y;
- }
- else if(length==5) {
- _xd = s.x;
- _yd = s.y;
- }
- else if(length==6) {
- _xe = s.x;
- _ye = s.y;
- }
- else if(length==7) {
- _xf = s.x;
- _yf = s.y;
- }
- else if(length==8) {
- _xg = s.x;
- _yg = s.y;
- }
- else if(length==9) {
- _xh = s.x;
- _yh = s.y;
- }
- else if(length==10) {
- _xi = s.x;
- _yi = s.y;
- }
- else if(length==11) {
- _xj = s.x;
- _yj = s.y;
- }
- else if(length==12) {
- _xk = s.x;
- _yk = s.y;
- }
- else if(length==13) {
- _xl = s.x;
- _yl = s.y;
- }
- else if(length == 14) {
- _xm = s.x;
- _ym = s.y;
- }
- else if(length==15) {
- _xn = s.x;
- _yn = s.y;
- }
-}
-*/
+
Vector2D Snake::get_pos(int length)
{
if(length == 1) {