Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Description:
  2.  
  3. The test fixture I use for this kata is pre-populated.
  4.  
  5. It will compare your guess to a random number generated in Ruby by:
  6.  
  7. (Kernel::rand() * 100 + 1).floor
  8. In Javascript/CoffeeScript by:
  9.  
  10. Math.floor(Math.random() * 100 + 1)
  11. In Python by:
  12.  
  13. randint(1,100)
  14. You can pass by relying on luck or skill but try not to rely on luck.
  15.  
  16. "The power to define the situation is the ultimate power." - Jerry Rubin
  17.  
  18. Good luck!
  19.  
  20. #This is exactly what the real test fixture looks like.
  21. lucky_number = (Kernel::rand() * 100 + 1).floor
  22. Test.assert_equals(guess, lucky_number, "Sorry. Unlucky this time.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement