Number Hover Text Game - Instructions
A keyboard timing game for practicing state observation, DevTools exploration, and lightweight browser automation.
About Page
Number Hover Text Game is a small text game where a count drops every tenth of a second. Press space to start, then use the up and down arrow keys to keep the count near the current magic number.
You score when theCount matches magicNumber. Using the arrow keys costs boost, boost is replenished when the target changes, and the stats become harder to rely on as the game progresses.
Use it to practice:
- keyboard event handling
- timing and state changes
- observing text updates
- inspecting hidden DOM configuration
- changing JavaScript variables from the console
- writing small
setIntervalhelpers
Gameplay Hints
Watch the points value. When it changes, the current count has reached the magic number. Try to keep the count near that value until the target changes again.
Things to try:
- tap the up arrow to spend boost and raise the count
- use the down arrow to let the count fall faster
- avoid spending boost just before the target changes
- watch how
UP,DOWN,MAGIC,ROUNDS, andHIDEchange over time - keep notes on which values you can observe and which values you have to infer
DevTools Exercises
Inspect the source and find the functions and variables that drive the game:
document.onkeydowncountDownsetValuesToStartingValuestheCountmagicNumberboostboostCostpointsChangeAftermaxCount
The page also has a hidden #defaults section. In the Elements panel, inspect the div with id="defaults" and try changing values before starting a new game. For example, increase Default_boost, slow down Default_millisecondsBetweenCountDowns, or change Default_pointsChangeAfter.
From the console, try direct state changes:
magicNumber = 50;
boost += 100;
theCount = magicNumber + 2;
Then use the visible page to decide whether the change helped, harmed, or revealed a bug.
Bot Challenges
Small interval scripts can run alongside the game. Capture the interval id so you can stop the script afterwards.
Boost supply helper:
var myBoostSupplyBot = setInterval(function() {
if (boost < 10) {
boost = 1000;
}
}, 100);
clearInterval(myBoostSupplyBot);
Magic number range helper:
var myMagicNumberRangeBot = setInterval(function() {
var withinRange = 5;
if (theCount < magicNumber - withinRange) {
var newCount = magicNumber - withinRange;
if (newCount < 1) {
newCount = 1;
}
theCount = newCount;
}
}, 100);
Never zero helper:
var myNeverZeroBot = setInterval(function() {
if (theCount < 1) {
theCount = 1;
}
}, 10);
Display the magic number in the boost field:
var myMagicNumberBot = setInterval(function() {
changeSpanText("boost", magicNumber);
}, 100);
Gameplay helper that uses the real key handler:
var myFirstGameplayBot = setInterval(function() {
if (theCount < magicNumber) {
var myFakeEvent = {};
myFakeEvent.keyCode = 38;
document.onkeydown(myFakeEvent);
}
}, 100);
Other challenge ideas:
- prevent the count moving too far away from the magic number
- keep the count above zero without directly changing
points - show the hidden target somewhere on the page
- play the game by sending key events rather than directly changing state
- score highly without assigning a new value to
points
Automated Execution
When automating, send real keyboard events to the page and wait for visible text changes such as the count, points, boost, or info message.
Avoid asserting immediately after a key press. The timer may update the same values between actions, so wait for the state you care about rather than sleeping for a fixed amount of time.