Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a 10 by 10 treasure and mine hunt game. The game function is called play-treasure-game and takes two numbers indicating the location to check

Create a 10 by 10 treasure and mine hunt game. The game function is called play-treasure-game and takes two numbers indicating the location to check for a treasure or hit a mine.

  • The probability of each location having a treasure is 50% and of having a mine is 10%.
  • Hint: use a build-vector to create the vectors inside of a constant vector. The function used by build-vector can in tern also use another build-vector .
  • Hint: use random to determine if a cell contains a treasure, a mine, or empty.
  • Hint: the testing examples can become complicated when using random numbers so relax your testing to only test the return type, or that a location contains either a treasure or a mine, or is empty.

Language is DrRacket

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

Students also viewed these Accounting questions