Login
You're viewing the functional.cafe public feed.
  • Nov 10, 2026, 7:21 AM
    retooted Stuart Langridge

    hillelwayne.com/post/randomnes
    this is a neat trick: an PRNG you can do in your head.
    To start, pick a number between 0 and 58 inclusive. (However you want, but "the number of seconds on your watch" seems obvious... but just pick one if you like.)
    Then, calculate the next number by saying: tens digit + (6 * units digit). So if you start with 48, the next one is 52 (4 + 6*8), then 17 (5 + 6*2), etc, etc.
    This generates every number between 0 and 58 once each and then repeats. Nice!

    💬 5🔄 4⭐ 0