Satoru Iwata, who died this week at the age of 55, was the only Nintendo president who had a background in game design and development.

He started his career at HAL Laboratory, working on games like Balloon Fight and Kirby. Eventually he would become president of HAL, then head of corporate planning at Nintendo, and finally CEO of Nintendo.

But climbing the ranks didn't stop him from programming. And even when he was the boss of HAL or an executive at Nintendo, he would still pitch in to help out - often leaving the day-to-day programmers stunned by his skills.

Here are four stories that reveal Satoru Iwata to have been some kind of coding super genius.

He re-wrote Earthbound's programming code

When APE and HAL were working on the sequel to Mother, the development team was running into all kinds of trouble. Iwata, then president of HAL, looked at the code and said "I don’t think you’re going to be able to finish if you go on like this".

"I can help you if you would like but there are two ways to proceed," said Iwata, recalling the story in 2013. "If we use what you have now and fix it, it will take two years. If we can start fresh, it’ll take half a year".

The boss took what the team had, toiled away for a month, and came back with clean, rewritten, working code that would power that cult classic, Earthbound.

He remade the Pokemon battle system without documentation

If you wanted to, say, rework the entire battle system from Pokemon Red and Blue to make it work in the N64 game Pokemon Stadium, you'd probably want some material from the developers, explaining how the whole thing worked.

Not Iwata. He instead picked it up by analysing the Game Boy game's complicated source code, and figuring out how it worked. It's like making a Lego set without instructions. And some extra pieces. And only a blurry photo of the final model.

He had replicated the fighting mechanics on the N64 in a week. Shigeki Morimoto from Game Freak said "I thought: 'What kind of company president is this!?'"

He saved Super Smash Bros. Melee from delay

In 2001, Early Gamecube game Super Smash Bros. Melee was rife with bugs and glitches, and it looked like it would have to be delayed.

Iwata had just become head of corporate planning at Nintendo the year earlier but that didn't stop him from ditching his cushy office in Kyoto, traveling to HAL Laboratories in Yamanashi, and becoming the acting head of debugging.

"I did the code review, fixed some bugs, read the code and fixed more bugs, read the long bug report from Nintendo, figured out where the problem was, and got people to fix those".

"All in all, I spent about three weeks like that," he said in an interview with 4gamer. "Because of that, the game made it out on time".

He fit two Pokemon worlds onto a Game Boy cartridge

This one's a little harder to find a source for, but I wouldn't be surprised if it was true.

Remember how in Pokemon Gold and Silver you could, after finishing off all the gym leaders in land of Johto, travel back to the Kanto region of the previous Pokemon games?

Credit goes to Iwata who wrote the compression technology that would squeeze the new game down so small, that you could fit an entire other game world in the saved space. Crikey.