JS怎樣計算過關分數
阿新 • • 發佈:2018-04-09
div nbsp HA amp char -c javascrip 分數 pre
一個遊戲,前20關是每一關自身的分數,
//21-30關每一關是10分
//31-40關,每一關是20分
//41-49關,每一關是30分
//50關,是100分
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> </body> </html> <script type="text/javascript"> var guanQia= parseInt(prompt("請輸入第幾關")) if (guanQia<=20) { alert(guanQia) } else if (guanQia>20 && guanQia<=30 ){ (guanQia=(guanQia-20)*10+20) alert(guanQia) } else if (guanQia>30 && guanQia<=40){ (guanQia=(guanQia-30)*20+120) alert(guanQia) }else if (guanQia>40 && guanQia<=49){ (guanQia=(guanQia-40)*30+320) alert(guanQia) } else if (guanQia=50){ (guanQia=100+590) alert(guanQia) } </script>
JS怎樣計算過關分數