Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 this WITHOUT using an SMFL library. Please post the output as well. Thanks in advance :) image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago