I’m going to tell you two stories, and it matters which order I tell them in. Here’s the first story.
Civilization is a 1991 strategy game where you watch Gandhi, Genghis Khan, Abraham Lincoln, and Napoleon Bonaparte wage war on each other with platoons of tanks, stealth bombers, and Renaissance-era chariots, all while you, Queen Elizabeth I, fend off barbarian tribes while also researching nuclear weaponry. At least, that was my experience of Civilization, and I loved it.
The Civilization games delicately balance depth and goofiness. This is a series with so much attention to detail, newer Civilization games have built-in encyclopedias. But this is also the series where a dinky Medieval spearman can take down a rocket artillery. And it’s the series where Mahatma Gandhi — peaceful, “I don’t believe anything good comes from war” Gandhi — will go hostile and nuke your entire empire to bits, due to the infamous “Nuclear Gandhi” bug.
Depending on who you talk to, the bug either started in Civilization (1991) or Civilization II (1996). But the explanation was nearly always the same.
Each computer-controlled leader had an “aggression score” from 1 to 10, which dictated how often they’d attack other nations. Genghis Khan or Napoleon Bonaparte would play aggressively and wage wars, but Gandhi would play peacefully. Gandhi had the lowest possible aggression score: 1.
But a leader’s aggression score could change. If a civilization switched its form of government to democracy, that would lower the aggression score by 2.
In Gandhi’s case this should lower his aggression score to -1. But the “aggression score” variable was stored as an unsigned integer (an integer that doesn’t include + or - signs), meaning it was impossible for the value to be saved as -1. It’s like how if you have a clock at 1:00, then rewind the clock 2 hours, the clock reads 11:00 instead of -1:00. Instead of saving Gandhi’s aggression score at -1, the game set Gandhi’s aggression level at the highest possible value for an 8-bit unsigned integer, 255. This phenomenon is called integer overflow.
If you often open multiple tabs and struggle to keep track of them, Tabs Reminder is the solution you need. Tabs Reminder lets you set reminders for tabs so you can close them and get notified about them later. Never lose track of important tabs again with Tabs Reminder!
Try our Chrome extension today!
Share this article with your
friends and colleagues.
Earn points from views and
referrals who sign up.
Learn more