原文:JS編程猜數字:系統隨機生成一個100-500的正整數,用戶輸入一個數字,如果輸入數字大於隨機數則提示“大了”,反之“小了”。直到游戲結束,提示“通過”並輸出猜出猜測的次數。

var num parseInt Math.random var input window.prompt 猜數字: var count while input num if input gt num count count window.alert 大了 else if input lt num count count window.alert 小了 input window.prompt 猜數字 ...

2020-08-26 16:08 0 950 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM