My first endeavour into browser game development. Working with vanilla JavaScript's canvas made for an interesting experience, a little different from what I'm typically used to in terms of drawing, but overall "game loop" principles deem consistent. This browser game was based on a puzzle called the Quarrasi Lock, taken from the book "Think Like A Programmer". The puzzle was concocted by the author himself, designed to be a river crossing puzzle in disguise, which he discusses in the book.
Besides being a quick project written over the weekend, it could prove useful for those who want to test their solution without subjecting themselves to human error, or are having trouble understanding the solution discussed in the book, and are in need of a visual aid.
This is plain run-in-your-browser JavaScript. Simply download the files, compile them into a single folder, and open the HTML page (double click!). You'll have the game up and running in no time.
Read the original problem statement (added as a png) before attempting the puzzle as there is no explanation in the game.
The grey border around the Krattz bars represents where your character currently is. Your character can only be in one place at a time (but he's lighting fast!). Click on a Krattz bar to move your character there. You can only move between Krattz bars. You can only push a Krattz bar once your character is at the Krattz bar. Once you have your character on the Krattz bar, click on the bar again to make your character push it. You can't move while a Krattz bar is being pushed.
The large buttons on the left and right hand side represent your suppressors. Hold space to activate a suppressor, you will see it turn green. The left suppressor can only be activated when your player is on the left hand side or is pushing a Krattz bar towards the left hand side, the same applies to the right suppressor. You may hold down on space, and the suppressor that is activated will automatically switch depending on which side your character is on or moving towards.
Have fun!