Console Driver - Instructions
A deliberately buggy game for practicing JavaScript console interaction.
Stuck? Start Here
The game shows status on the main page, but the actual game takes place in the JavaScript console.
Open the browser DevTools and look in the console to see the road render as the game runs.
To play the game, keep your keyboard and mouse focus in the page, not in the console. Click the page, then use the left and right arrow keys to steer.
About Page
Console Driver is a small browser game designed to be explored technically.
Use it to practice:
- reading on-page instructions and modelling game rules
- using the JavaScript console as a control surface
- checking state transitions
- inspecting functions and variables
- identifying deliberately buggy or hackable behaviour
Exploratory Testing
Play the game normally first. Then open DevTools, inspect the available JavaScript, and compare what the code allows with what the page suggests.
DevTools Exercises
Console Driver is deliberately open to browser-console investigation. Try these exercises after you have played a few rounds normally:
- keep focus on the page and use the left and right arrow keys to steer
- open the JavaScript console and watch the road render there
- inspect
document.onkeydownto see how keyboard input changescarPosition - inspect
distanceTravelled,points,widthOfTrack,millisecondsBetweenScrolls, andcarPosition - look for hidden or prototype controls in the DOM
- compare the visible instructions with the JavaScript rules
Useful console experiments:
widthOfTrack = 30;
distanceTravelled += 100;
Try a small points bot:
var myPointsBot = setInterval(function() {
distanceTravelled = distanceTravelled + 50;
}, 500);
Stop it with:
clearInterval(myPointsBot);
Try keeping the road wide:
var myWidthBot = setInterval(function() {
widthOfTrack = 58;
}, 500);
Try slowing the game by repeatedly resetting the difficulty:
var mySpeedBot = setInterval(function() {
setDifficultyLevel(0);
}, 500);
For a bigger challenge, write a bot that reads the current track line, finds a safe space, and moves carPosition there before the next game tick.