r/programminghorror • • 9h ago

c Using garbage values to generate pseudorandom numbers

Post image
1.1k Upvotes

Thing I came up with instead of paying attention to class today.

I tested it on this computer (windows 11 if it matters), and the first time it's ran, an actual "pseudorandom" number is returned and the following calls return 1.0 always.


r/programminghorror • • 17h ago

Python I love Python

145 Upvotes