I was finally ready to put it all to the test, I warped to the Metro Kingdom, ran up to the challenge, and prepared myself to bask in the sweet glory of my smug success.

And almost immediately failed… My timing was wrong. I manually tweaked a few of the timings in my code and got Mario closer, closer again, and closer still, until he could pretty reliably get to 86.

At that point instead of randomly tweaking things I recorded it playing and returned to Final Cut Pro to recount frames (this time focusing on how many frames nearer/further the rope was getting per 5 jump segment), and while I was a little off in a few places, as Mario was always getting to 50 the only thing requiring changing was the 50+ timing. I reduced it to a jump every 35.2 frames and tried again.

261 jump success

Success! 261 jumps. This felt like a huge victory, you can see in the video it easily trounced my meagre human effort of 102 jumps. I immediately went and woke my wife and tried to explain how cool it was, and when that failed to get me much adulation, resorted to telling my brother who was much more suitably impressed.

However, it’s a robot, why should 261 be a limit? Why can’t it be perfect? I analyzed the frames again and noticed the rope was catching up to Mario ever so slowly, he needed to go faster!

Jump timings, average was measured, actual is what is in code

Reducing the timing from a jump every 35.2 frames to one every 35.15 frames (a change of just 0.14%) resulted in a much more successful Mario.

So successful that it was able to play the infuriating Mario Jump-Rope challenge for 35 minutes and 21 seconds before failing… setting a new high score (for me) of 3613.

At first I assumed it failed because my timing was still imperceptibly out, but upon closer inspection of the video it stayed perfectly in sync until it… long pressed! What a human mistake for a computer to make, instead of doing a short quick jump it held the button too long and sent Mario too high, he jumped at the right time but landed late.

Long press for no success

In actuality I think it was that the poor solenoid was overheating, earlier in the night while I was playing with timings it had stopped running as well, I think driving it at almost twice the voltage was problematic. In the video you can even see that it pressed a second time during the jump at the correct timing.

As for the code? That was the simplest part. A mere 76 lines of code can play Mario better than me

For simplicities sake I measured all timings in how many frames between jumps, I could count the frames easily in the video, and then just divide by 60 to turn that into seconds.

The code calculates everything using dead reckoning from the time the challenge started, I assumed imprecisions in triggering any single jump would average out. Every loop the code calculates how many milliseconds should have elapsed before the next jump and if that threshold is met turns on the solenoid; there is a short duration that it keeps the solenoid on before resetting (maybe it needed to be shorter to avoid the long-press).

And that’s it… almost stupidly simple, fittingly so, given the nature of the jumping challenge.

I could try again but at almost 40 minutes per attempt I’m just not interested enough. Also, I’ve since discovered that someone went one step better than me, although in a slightly different direction.

Instead of physically pressing a button on their controller they use a library to simulate being a controller enabling them to trivially send signals. When they ran into the same timing challenge as me (only getting a few hundred jumps before failing — they were using the constant 35.18 for their final jumps) they solved that by programmatically monitoring to the video signal, checking the score region and when it changes do another jump. With this method they can reach the max score of 99,999!

You’d think with all of this that I’d have one of the highest scores in the game… you’d be wrong! Only a week ago I’d probably be in the top 100, but a bug has been discovered in the game that enables anyone to glitch this challenge, for almost no effort you can get unlimited jumps and over 10,000 people have now done so. Maybe if Nintendo patch this and reset the score board I’ll dust my solenoid off again, I feel if you can build something to play the game using only the controller itself then that’s kinda legitimate.