Question: #include #include #include #define SIZE 15 #define EMPTY 0 #define STONE 1 // TODO: Add any extra #defines here. void printMap(int map[SIZE][SIZE], int playerX); //
#include#include #include #define SIZE 15 #define EMPTY 0 #define STONE 1 // TODO: Add any extra #defines here. void printMap(int map[SIZE][SIZE], int playerX); // TODO: Add any extra function prototypes here. int main (void) { // This line creates our 2D array called "map" and sets all // of the blocks in the map to EMPTY. int map[SIZE][SIZE] = {EMPTY}; // This line creates out playerX variable. The player starts in the // middle of the map, at position 7. int playerX = SIZE / 2; printf("How many lines of stone? "); // TODO: Scan in the number of lines of blocks. printf("Enter lines of stone: "); // TODO: Scan in the lines of blocks. printMap(map, playerX); // TODO: Scan in commands until EOF. // After each command is processed, you should call printMap. return 0; } // Print out the contents of the map array. Then print out the player line // which will depends on the playerX variable. void printMap(int map[SIZE][SIZE], int playerX) { // Print values from the map array. int i = 0; while (i Summary: Move Laser Command Command Name "Move Laser" Command Number 1 Inputs direction Examples Command Meaning 11 Move the laser downwards once. 1 - 1 Move the laser upwards once. 1 2 Invalid. Don't make any changes. Summary: Fire Laser Command Command Name "Fire Laser" Command Number 2 Inputs (none) Examples Command Meaning 2 Fire the laser rightwards. Summary: Move Laser Command Command Name "Move Laser" Command Number 1 Inputs direction Examples Command Meaning 11 Move the laser downwards once. 1 - 1 Move the laser upwards once. 1 2 Invalid. Don't make any changes. Summary: Fire Laser Command Command Name "Fire Laser" Command Number 2 Inputs (none) Examples Command Meaning 2 Fire the laser rightwards
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock


![// TODO: Add any extra #defines here. void printMap(int map[SIZE][SIZE], int playerX);](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a1f893bfb_74466f3a1f844b17.jpg)
