Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
var roundCounter = 0;
var winCounter = 2;

var main = function (input) {
var myOutputValue = 'hello world';
var secretWord = 2;
console.log(secretWord);

if (secretWord == 1) {
secretWord = `banana`;
console.log(secretWord);
}

if (secretWord == 2) {
secretWord = `chisel`;
console.log(secretWord);
}

if (secretWord == 3) {
secretWord = `faucet`;
console.log(secretWord);
}

if (input == secretWord) {
winCounter = winCounter - 1;
console.log(secretWord);
}

var myOutputValue = `you guessed ${input} and the secret word is ${secretWord} and you have to guess ${winCounter} time more to win`;
console.log(myOutputValue);

return myOutputValue;
};
var generateRandomInteger = function () {
var randomDecimal = Math.random() * 3;
var randomInteger = Math.floor(randomDecimal) + 1;
return randomInteger;
};