Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code in C its due today at 11:59 Create a #define called MAPSIZE, Set to 10. Create global variable MapFilename. Use char array and

Write code in C its due today at 11:59 image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Create a #define called MAPSIZE, Set to 10. Create global variable MapFilename. Use char array and set them to nulls by using 0. Make it at least 20. Create a structure called PlayerInfo that has a char array called PlayerName of size 20 and two int members called CurrentRow and CurrentCol to hold the current position of the player Function MoveNorth should have a return value of int and two parameters-the Map array and a pointer to Player. If moving the Player's current position north results in a spot on the map that is part of the path (Map element is set to X, S or E), then decrement the Player's row and return true to show that a move was made; otherwise, print message "North is the xrong move" and return false to show that a move was not made. Function MoveSouth should have a return value of int and two parameters-the Map array and a pointer to Player If moving the Player's current position south results in a spot on the map that is part of the path (Map element is set to X, S or E), then increment the Player's row and return true to show that a move was made; otherwise, print message "South is the wrong move" and return false to show that a move was not made. Function MoveEast should have a return value of int and two parameters-the Map array and a pointer to Player. If moving the Player's current position east results in a spot on the map that is part of the path (Map element is set to X, Sor E), then increment the Player's colum and return true to show that a move was made; otherwise, print message "Sast is the wrong move" and return false to show that a move was not made. Function MoveWest should have a return value of int and two parameters-the Map array and a pointer to Player If moving the Player's current position west results in a spot on the map that is part of the path (Map element is set to X, S or E), then decrement the Player's column and return true to show that a move was made; otherwise, print message "Nest is the wrong move" and return false to show that a move was not made. unction getcommand_1ine_params should have a return value of voidand parameters of argc and argy Create a for loop with arge to go through each value of argv Look for an argy of MAP- When found, take the string after the as the value to store in MapFilename After looking at all of the strings in argv, if you do not have a value for MapFilename, then print the message KAP must be given on the commad line and exit

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

Step: 3

blur-text-image

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions