use javascript for game2 slaying dragon
来源:互联网 发布:数据库系统的应用 编辑:程序博客网 时间:2024/06/06 01:54
use if while 判断语句,可以做到文字游戏的剧情。当涉及各种各样的游戏剧情会产生不一样的判定
从而使游戏的趣味ing大大增加。
<pre name="code" class="javascript">var slaying = true;var youHit=Math.floor(Math.random()*2);var damagethisround = Math.floor(Math.random()*5 + 1);var totalDamage=0;while(slaying){ if(youHit=1) { console.log("you hit the dragon"); totalDamage+=damagethisround; if(totalDamage >= 4) { console.log("you beat the dragon!"); slaying=false} else { youHit=Math.floor(Math.random()*2); } }else { console.log("dragon defeat you"); slaying=false; } }
0 0
- use javascript for game2 slaying dragon
- abap game2
- JavaScript: Use a Web Proxy for Cross-Domain XMLHttpRequest Calls
- a example for calling java code in javascript use dwr
- get the week in year for a date use javascript
- C:\Users\Administrator>net use \\dragon-nas\gyn私有云 "881017" /user:"dragon" /p ersistent:yes
- leetcode-jump Game2
- My New Game2
- Use xDoclet For Hibernate
- Use for-each liberally
- git command for use
- How to use your Selenium Tests for automated JavaScript/AJAX Performance Analysis
- JAVASCRIPT use program
- Making Use of JavaScript
- javascript中的'use strict'
- Javascript use strict
- javascript之use strict
- JavaScript中的'use strict'
- table布局写出小样式
- 第31个python程序:逻辑判断
- HIVE从入门到精通
- swift中UIPickerView的使用
- Recyclew+Fragment获取手机所有程序
- use javascript for game2 slaying dragon
- SVN报403
- opencv调试-内存泄露
- Codeforces--486B---OR in Matrix思维题
- HDU 2824The Euler function
- java实现发布订阅
- 代码版模板~|owO|
- 编码格式互相转换顺序和次数
- servlet3.1规范: 第14章 部署描述符