logoalt Hacker News

KSteffensentoday at 9:53 AM2 repliesview on HN

Please fix the integer overflow. Total income over the game was tracked in a 32-bit signed int, so if you earned too much money suddenly the total would turn negative and your stocks would crash.


Replies

jrs235today at 11:07 AM

I never found the bug in that direction. I discovered it the opposite way: when starting out, selling shares (or was it taking loans?) all the shares you can. Get around 30+ million in the hole and continue to lose money. Eventually an arithmetic overflow will occur and then suddenly you'll have a net worth of like $30-40 million and have the money form selling stock to build to your heart's content.

show 1 reply
boredhedgehogtoday at 11:15 AM

As described by the posts, the original used 16-bit signed integers. The fix was to switch to 32-bit.