When is it Numberwang?
"That's Numberwang!" is a random message displayed 10% of the time during score update if your score for that turn is greater than 8:
The relevant code is in html_actuator.js
:
function HTMLActuator() {
...
this.thatsNumberwang = document.querySelector(".thats-numberwang");
...
}
...
HTMLActuator.prototype.updateScore = function (score) {
...
if (Math.random() > 0.9 && score > 8) {
this.showMessage()
}
...
};
...
HTMLActuator.prototype.showMessage = function (message) {
message = message || "That's Numberwang!";
var announce = document.createElement("p");
announce.classList.add("show-numberwang");
announce.textContent = message;
this.thatsNumberwang.appendChild(announce);
};
Every turn the site contacts Colosson to determine whether or not it is Numberwang. The result is relayed safely back to the user, to avoid further incident.