131k views
3 votes
After reading through the code, what will happen when you click run?​

After reading through the code, what will happen when you click run?​-example-1
User Greg Price
by
5.6k points

1 Answer

7 votes

Answer:

B.) Laurel will try to collect treasure when there is not any and it causes an error

Step-by-step explanation:

Laurel is at the top right corner of the map. When you click run, laurel moves 1 step ahead. This spot is right above the coordinate of the very first diamond. There is no treasure at this spot.

Therefore, when the next command calls for collecting, there will be an error, as there is no treasure at the spot right above the first diamond.

User Ricardo Markiewicz
by
6.3k points