Question: C programming Write a function that moves the avatar until it is against the wall. It takes no input arguments. However, it returns an integer.

C programming

Write a function that moves the avatar until it is against the wall. It takes no input arguments. However, it returns an integer. This return value is the number of move() commands it took to get to the wall.

Write a function that moves the avatar a fixed number of times. It contains one input argument -- an integer that specifies how many moves the avatar should make. It does not return anything. In this function, the avatar does not need to check if there is a wall and it only needs to execute the stated number of moves.

*Please comment on your code explaining the function.

UPDATE:

C programming Write a function that moves the avatar until it is

* The solid bold line is considered a wall. (i.e. In the picture, the outside borders are walls.)

* Each tile (as separated by grid lines) is one space.

* The avatar (the little blue pacman) can take actions such as:

move() - moves one tile, turnLeft() and turnRight() - turns in place 90 degrees left or right accordingly

* It can also query if there is a wall in front, left, or right as well as if it is facing north, south, east, or west.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!