Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomization #7

Open
2 tasks
jugglinmike opened this issue Sep 25, 2014 · 0 comments
Open
2 tasks

Randomization #7

jugglinmike opened this issue Sep 25, 2014 · 0 comments
Milestone

Comments

@jugglinmike
Copy link
Collaborator

The Director's role in all this might be easier to understand if it did
something interesting. We'll start by having it show the Mole at a random time

  • mole.js
    • Define a method called scheduleShow that accepts a delay value
      as its only argument. It should show the Mole using window.setTimeout
      and the delay argument.
  • director.js
    • Replace the call to show in the Director's constructor with a call to
      scheduleShow. Use the Math.random function to make it a little
      unpredictable. Remember: scheduleShow uses window.setTimeout, and that
      expects the delay to be in number of milliseconds. Math.random returns
      a random number between 0 and 1, so you'll have to write a small formula to
      make the "right" random number.
@jugglinmike jugglinmike modified the milestone: The Director Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant