原文:寫一個猜數字腳本,當用戶輸入的數字和預設數字(隨機生成一個0-100的數字)一樣時,直接退出並顯示猜了多少次,否則讓用戶一直輸入,並提示數字的大小

bin bash 定義一個變量 num,取出 到 的隨機值 num echo RANDOM i 輸入一個數值 num read p please enter integer: num while循環while true do 使用 num 和 num比較 if num gt num then echo The number you entered is too big. read p pleas ...

2019-02-19 20:22 0 900 推薦指數:

查看詳情

JavaScript一個數字游戲

效果圖: 代碼: <body> <script type="text/javascript"> window.onload = newgame; //頁面載入的時候就開始一個新的游戲 window.onpopstate = popState; //處理 ...

Sat Jun 03 06:44:00 CST 2017 0 1650
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM