Assignment 6B: Maze Game - Version 2! In the "real world", you rarely write a piece of software once and then leave it.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Assignment 6B: Maze Game - Version 2! In the "real world", you rarely write a piece of software once and then leave it.

Post by answerhappygod »

Assignment 6b Maze Game Version 2 In The Real World You Rarely Write A Piece Of Software Once And Then Leave It 1
Assignment 6b Maze Game Version 2 In The Real World You Rarely Write A Piece Of Software Once And Then Leave It 1 (72 KiB) Viewed 25 times
Assignment 6B: Maze Game - Version 2! In the "real world", you rarely write a piece of software once and then leave it. Instead, you make updates and fixes as you improve as a programmer. In this assignment, we are going to take our code from Assignment 5B and make the following code improvements with methods. Note for C++ Students: To use a 2D array as a parameter, you need to include the numbers of columns in the method header. For example, "void setArray (int arr[][5])" would accept a 5x5 2D array. . Create a method called checkValid Position. It should take in as parameters the current 2D array and two ints - one that represents the new X position and one that represents the new Y position of the Player. It should determine if the new position is valid (within the bounds of the array), and return a boolean TRUE or FALSE to the Main method. This function should be used to replace the code that was previously used to do this work in your code from Assignment 5B. • Create a method called checkGameStatus. It should take in as parameters the current 2D array and two ints that represent the X/Y position of the player. It should determine if the player is on the path or has won or lost the game. It should return an integer to the Main method that represents each state: Returning 0 means the player has lost o Returning 1 means the player is still playing the game Returning 2 means the player has won the game. This function should be used to replace the code that was previously used to do this work in your code from Assignment 5B. Create a method called printMaze. It should take in as parameters the current 2D array. It should print the maze to the screen; it should not return any value to the Main method. This function should be used to replace the code that was previously used to do this work in your code from Assignment 5B. The program should produce identical output to the sample output shown in Assignment 5B.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply