this post was submitted on 19 Jan 2024
39 points (97.6% liked)

Game Development

4744 readers
2 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] SatanicNotMessianic@lemmy.ml 17 points 2 years ago (2 children)

7 is the most random number, because when you ask someone to choose a random number between 1 and 10, most people choose 7.

Whenever you need a random number in your code, don’t use rand() or a similar function. Use 7. It’s faster, and it’s the choice of the people.

[–] Enkers@sh.itjust.works 12 points 2 years ago* (last edited 2 years ago) (1 children)

This seems like you're introducing selection bias. Do you really want laypersons to influence your code? You should poll a representative sample of coders for a random number, and use the mode of that.

Here, I'll start you off: 7

[–] SatanicNotMessianic@lemmy.ml 3 points 2 years ago

I’m good with that. My current number of upvotes is the most random number, which I also find acceptable.

[–] sus@programming.dev 4 points 2 years ago

// guaranteed to be random