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: LineSensors mbed
Revision 22:8f726dc175cd, committed 2015-04-18
- Comitter:
- Hypna
- Date:
- Sat Apr 18 04:57:20 2015 +0000
- Parent:
- 21:44d9b42c04a9
- Commit message:
- stuff
Changed in this revision
--- a/navcontroller.cpp Sat Apr 18 04:38:53 2015 +0000
+++ b/navcontroller.cpp Sat Apr 18 04:57:20 2015 +0000
@@ -13,34 +13,7 @@
end.y = mapSize-1;
}
-void NavController::explore()
-{
- typename ::direction next;
- typename ::position newPos;
-
- while(map.getPosition() != end)
- {
- updateMap();
- next = nextExploreMove();
- sendMove(next);
- newPos = map.getPosition();
-
- switch(next)
- {
- case NORTH : newPos.y++;
- break;
- case SOUTH : newPos.y--;
- break;
- case EAST : newPos.x++;
- break;
- case WEST : newPos.x--;
- }
-
- map.setPosition(newPos);
- }
-
- saveMap();
-}
+bool NavController::isDone() { return map.getPosition() == map.getFinish(); }
void NavController::prepReturn()
{
--- a/navcontroller.h Sat Apr 18 04:38:53 2015 +0000
+++ b/navcontroller.h Sat Apr 18 04:57:20 2015 +0000
@@ -14,7 +14,7 @@
NavController(int mapSize = 5);
R5Map::direction nextExploreMove();
R5Map::direction nextTraceMove();
- void nextPhase();
+ bool isDone();
private:
R5Map::position end;
--- a/r5map.cpp Sat Apr 18 04:38:53 2015 +0000
+++ b/r5map.cpp Sat Apr 18 04:57:20 2015 +0000
@@ -177,18 +177,6 @@
bool R5Map::getCurVisited() const { return map[pos.x][pos.y].visited; }
-vector<char> R5Map::getSymbols(position cell) const
-{
- if(cell.x >= 0 && cell.y >= 0 && cell.x <= 6 && cell.y <= 6)
- return map[cell.x][cell.y].symbols;
- else
- {
- cerr<<"ERROR: Position selection in R5Map::getSymbols(position) outside of map bounds!"<<endl;
- vector<char> empty;
- return empty;
- }
-}
-
int R5Map::getSize() const { return size; }
void R5Map::printMap() const