The code to randomly set the treasures on the map could be written in a more efficient way that allows for easier future changes, such as having more than 3 treasures. Currently, the code looks like this:
Perhaps a function can be used instead of the multiple while statements to ensure each treasure is uniquely placed. For example, maybe you could write an isOccupied function.
The code to randomly set the treasures on the map could be written in a more efficient way that allows for easier future changes, such as having more than 3 treasures. Currently, the code looks like this:
Perhaps a function can be used instead of the multiple while statements to ensure each treasure is uniquely placed. For example, maybe you could write an isOccupied function.
Suggested points: ~75