カテゴリー
JavaScript

JavaScript「超」入門3-07_monster

  <script>
        'use strict';
        let enemyEnagy = 100;
        window.alert('戦闘スタート!')
        while(enemyEnagy > 0){
            let attackEnagy = Math.floor(Math.random() * 30) + 1;
            enemyEnagy -= attackEnagy;
            console.log('敵のエネルギーは:' + enemyEnagy + 'になりました。');
        }
        console.log('Conguraturation 敵は消滅しました。!')
    </script>

<script>…</script>間以外は同じ

inserted by FC2 system