Can anyone help me figure out what i'm doing wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone help me figure out what i'm doing wrong?

var chocies = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",]; var wins = 0; var losses = 0; var numberGuesses = 12; var guesses = []; document.onkeyup = function(event) { var guesses = event.key; var computerGuess = chocies[Math.floor(Math.random() * choices.length)]; var choices = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",]; console.log(choices) if (choices0.indexOf(userGuesses) > -1) { wins++; numberGuesses --; guessChoices = []; } if (userGuesses != guesses) { numberGuesses = 12; guessChoices.push(guessesSoFar); } if (numberGuesses === 0) { numberGuesses = 12; losses ++; guessChoices = []; } }

29th Mar 2018, 5:23 AM
J Brooks
J Brooks - avatar
3 Answers
+ 1
html code for it is as follows
29th Mar 2018, 5:24 AM
J Brooks
J Brooks - avatar
+ 1
<html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Psychic</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/javascript" href="game.js"></script> </head> <body> <div id="game"> <h1>The Psychic Game</h1><br> <p>Guess what letter I'm thinking of</p> <p id="wins">Wins</p> <p id="losses">Losses:</p> <p id="numberGuesses">Guesses Left:</p> <p id="guesses">Your guesses so far:</p> </div> </body> </html>
29th Mar 2018, 5:24 AM
J Brooks
J Brooks - avatar
+ 1
this was pieced together by a friend from other codes i'm trying to get it to work without rewriting it haha thank you for your input
29th Mar 2018, 5:33 AM
J Brooks
J Brooks - avatar