Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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  

image text in transcribedimage text in transcribedimage text in transcribed

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

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

=+ For what reasons can and do unions go on strike?

Answered: 1 week ago

Question

=+ Is secondary industrial action common and/or legal?

Answered: 1 week ago