Question: write this WITHOUT using an SMFL library. Please post the output as well. Thanks in advance :) Write and compile a C++ program to construct
Write and compile a C++ program to construct and plot a 2-D square grid of dimension NXN where N can vary from five to twenty. Use a class to hold the grid data. The grid squares either hold the user's player "P", the target "T", or is empty. The player's goal is to reach the target by moving either left, right, up, or down. Players move one grid square each turn and the target moves in a random direction either zero ( 50% likely) or one ( 50% likely) grid square each turn. The target is constrained to not move to the same square as the player if within one square's distance. A running score showing the player's name and running total number of moves at each turn should be displayed over the grid at each turn. An example of what a 5X5, i.e. N=5, board might look like is shown below. Player: Bill Running Score: 3 a) Use extended characters for the outline of the grid b) Input player moves using keyboard keys without carriage return c) Code should have error checking for incorrect key entries d) [BONUS] Keep the grid and running score information in the same position in the console at each turn using cursor re-positioning characters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
