Why you sneaky cheater!
Well, you figured it out, so I might as well just tell you that the Secret Number is currently TEST.
The following is my JavaScript code used - update when changing:
(CREATE: a div that allows user to scroll the JS code up underneath the game without showing through; image of shrugging character or a means to display via web; function to let user hit enter instead of clicking check guess button; button to toggle code visible/invisible)
<script>
var userInput_var;
var actualSecretNum_var;
var counter_var = 0;
window.onload = onLoad_fun;
function onLoad_fun(){
secretNum_fun();
ShowCounter_fun();
disableButtonTwo_fun();
disableButtonThree_fun();
enableButtonOne_fun();
document.getElementById("userInput_id").value = "";
}
function TickUpCounter_fun(){
Number(counter_var += 1);
if(counter_var == 15){
document.getElementById("Alert_1_id").innerHTML = "Game Over. The number was actually " + actualSecretNum_var;
disableButtonOne_fun();
disableButtonTwo_fun();
enableButtonThree_fun();
}
else if(counter_var >= 10){
document.getElementById("Alert_1_id").innerHTML = "oh I guess you could give up, if your scared?";
enableButtonTwo_fun();
}
else{
document.getElementById("Alert_1_id").innerHTML = "So, you're up for the challenge, huh?!?";
}
}
function ShowCounter_fun(){
document.getElementById("ShowCounter_id").innerHTML = counter_var;
}
function secretNum_fun(){
//this function is successful and complete. it generates a random number between 1 and 100.
actualSecretNum_var = Math.floor(Math.random()* 100);
if (actualSecretNum_var != 0) {
document.getElementById("demo_id").innerHTML = actualSecretNum_var;
}
else {
secretNum_fun();
}
}
function GetThatNumber_fun(){
userInput_var = document.getElementById("userInput_id").value;
if(Number(userInput_var) == actualSecretNum_var){
document.getElementById("Alert_2_id").innerHTML = "Glorious!!!!! The number is you absolutely dominated!!!!";
document.getElementById("Alert_3_id").innerHTML = actualSecretNum_var;
disableButtonOne_fun();
enableButtonThree_fun();
document.getElementById("Alert_4_id").innerHTML = "";
}
else if(Number(userInput_var) < actualSecretNum_var){
document.getElementById("Alert_2_id").innerHTML = "Nope, that's not correct, your gonna need to try again, this time guess higher!";
}
else if(Number(userInput_var) > actualSecretNum_var){
document.getElementById("Alert_2_id").innerHTML = "Nope, that's not correct, your gonna need to try again, this time guess lower!";
}
}
function CheckYourGuess_fun(){
GetThatNumber_fun();
TickUpCounter_fun();
ShowCounter_fun();
document.getElementById("userInput_id").value = "";
}
function iGiveUp_fun(){
alert("Short on time? I mean, you've got no more than 5 guesses left, but you give up? Wow, just wow.");
location.reload();
}
function goAgain_fun(){
location.reload();
}
function toggleCode_fun() {
var x = document.getElementById('Alert_5_id');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
function disableButtonOne_fun() {
document.getElementById("CheckYourGuess_id").disabled = true;
}
function enableButtonOne_fun() {
document.getElementById("CheckYourGuess_id").disabled = false;
}
function disableButtonTwo_fun() {
document.getElementById("IgiveUp_id").disabled = true;
}
function enableButtonTwo_fun() {
document.getElementById("IgiveUp_id").disabled = false;
}
function disableButtonThree_fun() {
document.getElementById("GoAgain_id").disabled = true;
}
function enableButtonThree_fun() {
document.getElementById("GoAgain_id").disabled = false;
}
</script>