In order to test a random space picker, we’ll need to refactor our code a little to capture a testable output.
- The way
computerFireis written is not testable; the only tests we can write for it are trivial and uninformative
- Refactor the two "computer" functions I’ve written so that they’re more testable
- Try to rewrite the set of functions so that we can still generate random locations
- You might need to move the code generating random numbers into their own functions in order to isolate the problem
You need to sign up for Treehouse in order to download course files.Sign up