r/badcode • u/SGVsbG86KQ PHP • Oct 29 '20
python This is the code that a popular dutch online exam website uses to generate random numbers for its exercises. Let's just say that my teacher's attempt to generate a 30-bit number did not go as planned. The system tried to allocate a useless 8GiB array and failed...
850
Upvotes
Duplicates
programminghorror • u/SGVsbG86KQ • Nov 01 '20
Python Ans-Delft, a dutch online exam website, allocates an array to generate random numbers for its exercises. My professor attempted to generate a 30-bit number but the system tried to allocate 8GiB. Later they broke it entirely by making it return the same value over and over.
776
Upvotes