aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk5/hw5_directory/strap012_HW5A.cpp
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-04-02 15:54:57 -0500
committerRossTheRoss <msattr@gmail.com>2019-04-02 15:54:57 -0500
commitda862e505457ec3ec701f7c41ecdd1061d5d1de4 (patch)
treeb0eae1578ffa6317d301698723e5c041968a15d1 /ee1301/wk5/hw5_directory/strap012_HW5A.cpp
parentFix an oopsie (diff)
downloadhomework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar.gz
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar.bz2
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar.lz
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar.xz
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.tar.zst
homework-da862e505457ec3ec701f7c41ecdd1061d5d1de4.zip
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
Diffstat (limited to 'ee1301/wk5/hw5_directory/strap012_HW5A.cpp')
-rw-r--r--ee1301/wk5/hw5_directory/strap012_HW5A.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/ee1301/wk5/hw5_directory/strap012_HW5A.cpp b/ee1301/wk5/hw5_directory/strap012_HW5A.cpp
index 4332d2d..253be9b 100644
--- a/ee1301/wk5/hw5_directory/strap012_HW5A.cpp
+++ b/ee1301/wk5/hw5_directory/strap012_HW5A.cpp
@@ -60,7 +60,8 @@ int main()
return 0;
}
-//The default (no custom file) maze is procedurally generated
+//The default (no custom file) maze is procedurally generated, sometimes rendering levels impossible to solve.
+//This bug is not as important as finishing the monster that is 5C.
void initBoardDefault(char board[lengthX][lengthY], int &xPos, int &yPos)
{
for (int curRow = 0; curRow < lengthY; curRow++)
@@ -78,11 +79,10 @@ void initBoardDefault(char board[lengthX][lengthY], int &xPos, int &yPos)
}
}
- board[0][0] = GOAL;
- board[lengthX / 2][lengthY / 2] = ROBOT;
-
- xPos = lengthX / 2;
- yPos = lengthY / 2;
+ board[rand() % lengthX][rand() % lengthY] = GOAL;
+ xPos = rand() % lengthX;
+ yPos = rand() % lengthY;
+ board[xPos][yPos] = ROBOT;
}
void initBoardCustom(char board[lengthX][lengthY], int &xPos, int &yPos)