第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

猜謎游戲可能出現(xiàn)的語(yǔ)法錯(cuò)誤

猜謎游戲可能出現(xiàn)的語(yǔ)法錯(cuò)誤

白衣非少年 2021-05-13 10:16:17
我創(chuàng)建了一個(gè)數(shù)字猜謎游戲,您在其中輸入數(shù)字作為用戶(hù)并嘗試獲取與計(jì)算機(jī)選擇的數(shù)字相同的數(shù)字。計(jì)算機(jī)會(huì)在1-100之間選擇一個(gè)數(shù)字,每次您猜測(cè)時(shí),它都會(huì)告訴您是否需要猜測(cè)更高或更低。問(wèn)題出在Java腳本中,我正在考慮是寫(xiě)錯(cuò)了東西還是不是應(yīng)該寫(xiě)的東西。我已經(jīng)檢查了所有ID和所有內(nèi)容,但仍未從代碼中獲得任何反饋。我希望代碼在嘗試按下猜測(cè)按鈕時(shí)能夠輸出某些內(nèi)容<!DOCTYPE html><html><head>  <title>GuessingGame</title>  <style>  </style>  <script>    var playerGuess = document.getElementById("guessInput").value;    var computerGuess = Math.floor(Math.random() * 10 + 1);    var playAgain = true;    function randNum(low, high) {      var number = Math.floor(Math.random() * high + low);      return number    }    function guessNumber() {      if (playerGuess > computerGuess) {        document.getElementById("output").innerHTML =          "Guess lower"      } else if (playerGuess < computerGuess) {        document.getElementById("output").innerHTML =          "Guess higher"      } else(playerGuess == computerGuess) {        document.getElementById("output").innerHTML =          "Good job you guessed right"      }  </script></head><body>  <h1>Guessing Game</h1>  <h2>The computer will choose a number between 1 and 100</h2>  <h2>You have to try and guess what it picked</h2>  <span><input type="number" id="guessInput">    <button onclick="guessNumber();">Guess</button><button    onClick="reset();">Reset</button>    <p id="output"></p>    </body>    </html>
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 166 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)