Javascrip30 - Day 12 - Key Sequence Detector

Nice short thinking exercise. I hadn't implemented this before, but was pretty straightforward. I setup an array with the code and a position marker. Catch all keyboard entries, when the user enters the correct key for the next step of the code, move the marker, otherwise reset the marker to the first item. If after moving the marker, we are at the end of the code, reveal the secret.

This is the first exercise where after watching the video, I felt like my solution was better than the one shown in the video.

Completion Time: ~5 Minutes

You can sign up for Javascript30 here: https://javascript30.com

You can view my key-sequence-detector here (code: up-down-up-down-left-right-left-right-b-a): https://spencern.github.io/javascript30/12-key-sequence-detector

You can see my code here: https://github.com/spencern/javascript30/tree/master/12-key-sequence-detector