Olympic Doodle beaten in 15 seconds with 22 lines of Python code

first_imgFor the past three days Google has been releasing Google Doodles that take the form of simple Olympic games. Day one saw hurdling, day two was basketball, and day three was canoeing.Each game required different input and challenged players to get the lowest completion time, or highest score in the case of the free throws basketball game. Of course, when you have programmers performing a search and noticing the game, it doesn’t take long for them to start experimenting and see if they can automate the input to achieve the best score/time.That’s exactly what programmer and YouTube poster audionautics decided to do one bored lunchtime at work. Using Python as his programming language of choice, he set about automating the hurdling game.At first, he just got the hurdler running in Python and did the jumps manually with the spacebar, recording a time of 10.4 seconds. Then he disregarded the hurdles and managed to complete the course in just 0.4 seconds. Impressive, but that’s not playing properly and only achieved 2 of the 3 possible stars.The final fully-automated solution is the most impressive and can’t be beaten with a manual run. Automating both the running and jumping saw a time of 1.5 seconds achieved.Audionautics has since gone on to automate the basketball game, too. Final score: 39 with 3 stars achieved. As it’s a bit more complicated to play, due to the changing distance of the player from the hoop, this solution took 48 lines of Python to achieve.There’s no automation code for the canoeing game yet, but I wouldn’t be surprised to see it appear in the next day or two.via audionautics’ YouTube channellast_img read more