If you grew up with a Game Boy in your backpack, or a Switch on the sofa, Nintendo probably feels like a company that has always made games. Mario has been jumping on enemies for over forty years. Pokémon has been caught on almost every Nintendo machine since the 1990s.

So it can come as a surprise that Nintendo started in 1889, in Kyoto, as a small shop making playing cards. Not video game cards. Paper cards, for games people played around a table, and quite often for money.

The road from that shop to Mario is longer and stranger than you might expect. It runs through a banned card game, a young boss who tried running a taxi company, and an engineer who made a toy out of boredom.

The founder, Fusajiro Yamauchi, made hanafuda, “flower cards”. A deck has 48 small, stiff cards, four for each month of the year, and each month has its own plant: pine for January, cherry blossom for March, maple leaves for October. You play by matching cards from the same month.

Flower cards had a shady past. Card games came to Japan with Portuguese traders in the 1500s, and gambling with cards was banned again and again through the Edo period (1603–1868). Card makers kept finding ways around the bans. By the late 1700s, one Kyoto maker was selling a flower deck dressed up as a set of poem cards, a respectable parlour game, so it would not look like a gambling tool. Nobody is sure whether the flower pictures themselves began as a disguise. Either way, the cards spent a long time on the edge of the law.

Until the end of 1881, it was illegal in Japan even to own flower cards. A new criminal code that came into force on 1 January 1882 no longer mentioned them, and within a few years they were being sold openly. Yamauchi opened his shop in 1889, only seven years after the ban fell away. He was getting into a business that had just come out of the shadows.

A card company tries everything

For decades Nintendo stayed a card company. In 1902 it began making Western-style playing cards, said to be the first made in Japan. After the Second World War it kept improving the product: in 1953 it made Japan’s first plastic playing cards, and in 1959 it signed a deal with Disney. Its Disney-character cards, sold from 1960, were a hit with families.

The man behind that push was Hiroshi Yamauchi, the founder’s great-grandson. In 1949 his grandfather, who was running the company, fell ill, and Hiroshi took over at just 22.

He wanted more than cards. In the 1960s Nintendo set up a taxi company. It moved into processed food through a company it co-founded. It tried a baby stroller and a home copying machine. Almost none of it worked.

Toys, and then games

The idea that did work came from inside the company. A young engineer, Gunpei Yokoi, had built a criss-cross extending arm to amuse himself in his spare time. Hiroshi Yamauchi spotted it and told him to turn it into a product. The Ultra Hand, an extending toy arm for grabbing things, sold more than a million.

Yokoi went on to make more toys, including a range of light-gun shooting games. His own name for his approach translates as “lateral thinking with withered technology”, where withered means tried, tested and well understood. Take a technology like that and find a new way to play with it. One of his light-gun toys, for example, used a cheap solar cell to sense when the beam of light hit the target.

His best-known example came in 1980. There is a well-loved story about where the idea came from. On a bullet train, Yokoi watched a bored passenger passing the time by pressing the buttons on his pocket calculator. Why not use the same kind of parts for a game small enough to carry? The result was the Game & Watch, a pocket game with a simple screen that doubled as a clock. A later model introduced the cross-shaped direction pad, the plus-sign button that is still on game controllers today.

By then Nintendo was making arcade games too, and in 1981 it had its breakthrough hit, Donkey Kong. Its small, jumping hero was soon given a name: Mario.

In 1983 Nintendo brought games into the living room with the Family Computer, a home console known in Japan as the Famicom. Two years later came Super Mario Bros., made by a team led by the designer Shigeru Miyamoto. Mario had become the star.

The thread that never broke

So how did a card maker end up making Mario? Seen from a distance, it looks like a leap. Seen up close, Nintendo never really left its first trade. A deck of flower cards, a plastic grabber, a pocket game and a games console are all the same kind of thing: something you hold in your hands to play with, alone or with the people around you.

The experiments that failed were the ones that stepped outside that. The ones that worked stayed inside it, and simply put familiar technology to new uses.

And the cards never went away. Nintendo still sells flower cards and playing cards today, alongside the Switch. Next time Mario leaps over a gap, it is worth remembering that the company behind him began by selling a game of cherry blossoms and maple leaves, one that had only just stopped being illegal.