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 3875_Individualproject
Diff: main/main.cpp
- Revision:
- 35:2fd4ee9ac889
- Parent:
- 34:63f7c61ee4da
- Child:
- 36:1af069be0fdb
--- a/main/main.cpp Tue Apr 14 00:36:29 2020 +0000 +++ b/main/main.cpp Tue Apr 14 00:41:17 2020 +0000 @@ -239,11 +239,6 @@ looped_path[path_length] = point[curr_index]; //returns an int of which point we are at what its called choose_turn(); //looks at the point we are at, examines the type vs explored and makes the appropriate turn also updates the explored - if (complete) { - // once complete, have it return to start node and add those turns to path return_to_start(); - looped_goal(); - } - // check_explored(); // iterates through all existing points, if all explored match type, then mapping is complete // if not, make a func that traverses back through the bath until reaching that node, then explore the unexplored path // i.e. the function will take the node ID integer as an argument and go backwards through the path until reaching that node (appending each node along the way to the end of the path) @@ -476,18 +471,18 @@ // find the closest previous node with unexplored paths and go back through the path until reaching that node, updating the path and directions appropriately, then choose turn // also if no nodes have unexplored paths set complete to true - bool check = false; + bool complete = false; int pointer; // an index to the most recent node with unexplored paths for(int i = total_points; i >= 0; i--) { // start from the most recently discovered node if( explored[i] != type[i] ) { - check = true; + complete = true; pointer = i; break; } } - if( check == false ) { complete = true; } + if( complete == false ) { looped_goal(); } else { // compare node coordinates to previous node coordinates