Advertisement
amigojapan

uncheatable random number generator from 1 to 100

Mar 13th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. easy way:
  2. just pick a random number from 1 to 100 (but this method can be cheated)
  3. write L=the number you picked on the variables paper
  4.  
  5. hard way:
  6. uncheatable random number generator from 1 to 100
  7. you need 2 players to play this game, the “player” and the “executor”
  8. the executor does everything except where it is mentioned that the player should do something. 
  9.  
  10. how to get a number from 0 to 50
  11. Random_Number_0_to_50:
  12. repeat until the result is not negative:
  13. -roll first dice multiply times 10 then add the second roll of dice
  14. -subtract 11
  15. -the player should write down the results of both dice rolls and save them for later
  16. -the executor should write down the hidden random number  and keep it hidden until the game is over
  17. -be sure to record every pair of rolls of the dice and every hidden number for later verification
  18.  
  19. how to get a number 0 to 100
  20. RandomNumberA is Random_Number_0_to_50
  21. RandomNumberB is Random_Number_0_to_50
  22. if RandomNumberB is 0 then change RandomNumberB to 1
  23. make Random_number_Zero_to_100 into  RandomNumberA+RandomNumberB
  24. write down L=Random_number_Zero_to_100 on the variables paper
  25.  
  26. after the game ends:
  27. repeat for every pair of rolls of the dice:
  28. repeat until the result is not negative:
  29. -first roll of dice written down by player multiply times 10 then add the second roll of dice
  30. -subtract 11
  31. if the number is equal to the hidden random number then the executor did not cheat, otherwise he cheated
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement