Say Hello to Discobot

:game_die: 6, 4

That worked.
@Discobot fortune
Are you broken?

That didn’t, again…
@Discobot quote

@Discobot quote

:left_speech_bubble: It is one of the blessings of old friends that you can afford to be stupid with them. — Ralph Emerson

Lol, @Discobot seems to be copping an attitude.

1 Like

Hi! To find out what I can do, say @Discobot display help.

Seems the fortune module for discobot is broken at the moment. He isn’t responding to those prompts.

Wheels

@Discobot fortune

:crystal_ball: Without a doubt

Does the command need to be on the first line?

No.

Wheels

Testing a theory…
@wheelsup_cavu rolled d99: 14
@wheelsup_cavu rolled d99: 93
@wheelsup_cavu rolled d99: 12
@wheelsup_cavu rolled d99: 60
@wheelsup_cavu rolled d99: 2
@wheelsup_cavu rolled d99: 92
@wheelsup_cavu rolled d99: 25
@wheelsup_cavu rolled d99: 48
@wheelsup_cavu rolled d99: 45
@wheelsup_cavu rolled d99: 92
@wheelsup_cavu rolled d99: 65
@wheelsup_cavu rolled d99: 23
@wheelsup_cavu rolled d99: 8
@wheelsup_cavu rolled d99: 32
@wheelsup_cavu rolled d99: 60
@wheelsup_cavu rolled d99: 34

Summary

Hopefully my testing does not break the forum again…

Wheels

1 Like

Here’s the bit you’re probably curious about @wheelsup_cavu?

The line in the bot to produce the result:

…which calls the ruby ‘rand’ method, with the source code for that here:

…which is opening the underlying Unix /dev/urandom byte stream, which is described here:

…which is hardware CPU dependent from here (our server is x86 based):

…of which the more palatable description is in here (Intel don’t release their microcode for this):

https://man7.org/linux/man-pages/man4/random.4.html

…with the TL;DR of:

The random number generator gathers environmental noise from
device drivers and other sources into an entropy pool. The
generator also keeps an estimate of the number of bits of noise
in the entropy pool. From this entropy pool, random numbers are
created.

So, basically, it uses thermal noise. :slight_smile:

2 Likes

Actually I wanted to see if the random generator would output the same number more than once. I was surprised that it generated the number 60 and the number 92 twice in only 16 entries.

Wheels

If you find a pattern, let me know. We could make a lot of money on crypto if you do… :wink: :money_mouth_face:

1 Like

Had I only bought it in 2009/2010 when it was worthless

Web cams and lava lamps. Random numbers in computers are really hard, but underpin pretty much everything:

3 Likes

Yeah. Random numbers are, theoretically, really hard. Intel doesn’t release the micro-code in case there is an exploitable flaw in their design. I remember early RSA keys that became useless after a supply chain hack exposed the seed values used to generate the chain of numbers the RSA token generated. In practice, I think that computers are ‘random enough’ to be very difficult to predict.

I used to work for a Video Lotto Company and the automated test suite would run the pay table through hundreds of thousands of calculations to generate enough statistics to validate the code and the random generator. Casinos didn’t want VLTs that could be predicted … go figure. Yet it was still surprising the number of developers who still thought that because they had lost a number of games in testing, still felt that they were ‘due’ to win.

You can figure out the odds of getting 60 and 92 twice in 16 rolls … but the probability of any particualr number on the next roll is still 1 in 99 no matter what the history of the rolls tell you :slight_smile:

4 Likes

Linux still has a switch so you don’t use the RDRAND instruction. The thinking being that the NSA requires the entropy to be within certain bounds that they can deal with, as in, not deterministic, but getting closer to it for a nation-state level. The circuit that generates it is fascinating, as it’s a 3 Ghz completely independent bit of tech. Bull Mountain tech here - RdRand - HandWiki

3 Likes