Doragon Kuesuto 1.15
#include<stdio.h>
#include<stdlib.h>
#include<time.h> int main()
{
int bloodD = ;
int bloodW = ;
int MP = ;
int action;
int tmp = ;
int tmp2 = ;
int score = ;
int round = ; printf("Update by xkfx ( E-mail: wyzxk_fx@163.com ) 2016-10-27\n");
srand((int)time());
for(round = ; round <= ; round ++){
srand(rand());
//输出回合数
printf("---Details above------ Round - %d -----\n", round);
//输出恶龙血量
printf("<Deathwing> \n");
printf("HP = %d , MP = ??? \n", bloodD);
//输出勇者血量 与 MP
printf("<Warrior> \n");
printf("HP = %d , MP = %d \n", bloodW, MP);
printf("---------------------------------------\n");
//输出勇者的技能列表
//printf("\n");
printf("YOUR ACTIONS:\n");
printf(" 1 --- ATTACK --- 20 MP\n");
printf(" 2 --- DEFENSE --- 10 MP\n");
printf(" 3 --- GATHER STRENGTH --- 0 MP \n");
printf(" 4 -SWORD OF JUDGEMENT --- ALL HP \n");
printf("> Warrior , please choose your action:");
//选择下一步行动
scanf("%d", &action);
//计算下一回合数据
system("cls");
switch(action){
case :
tmp = + rand()%;
bloodD = bloodD - tmp - tmp2;
MP = MP - ;
printf("\nYour cause %d damage !\n", tmp+tmp2);
score = score + tmp+tmp2;
tmp2 = ;
break;
case :
tmp = + rand()%;
bloodW = bloodW + tmp;
MP = MP - ;
printf("\nYour recovery %d HP !\n", tmp);
break;
case :
tmp2 = tmp2 + rand()%;
printf("\nWarrior:I will find you and I will kill you...\n");
break;
case :
bloodW = ;
tmp = + rand()%;
score = score + tmp;
bloodD = bloodD - tmp;
printf("\nWarrior:SWORD OF JUDGEMENT!!!\n");
printf("Your cause %d damage !\n", tmp);
break;
default:
break;
}
printf("Deathwing:All will burn!\n");
tmp = +rand()%;
printf("You got a few injuries - %d HP\n", tmp);
bloodW = bloodW - tmp;
if((bloodD < ) || (bloodW < ))
break;
}
if(bloodD < && bloodW > ){
printf("...\n");
printf("......\n");
printf("You have kill the Dragon!\n");
printf(".....\n");
printf("What a brave Warrior!");
printf("You final score: %d\n", + (-round)*+score);
printf("......\n");
}else if(bloodW < && bloodD > ){
printf("...\n");
printf("......\n");
printf("GAME OVER\n");
printf("You final score: %d\n", round* +score);
}else
printf("The game ended in a draw\n"); system("pause");
return ;
}
Doragon Kuesuto 1.15的更多相关文章
- Doragon Kuesuto 1.0
#include<stdio.h> #include<stdlib.h> #include<time.h> int main() { ; ; ; int actio ...
- Doragon Kuesuto 1.6
/* * <<D Q>> * * Author xkfx<wyzxk_fx@163.com> * * 游戏规则:利用适当的决策,在13回合内击杀恶龙取得胜利. * ...
- FIRST GAME.
-Doragon Kuesuto(.c) Doragon Kuesuto 1.0 Doragon Kuesuto 1.15 Doragon Kuesuto 1.6
- .NET平台开源项目速览(15)文档数据库RavenDB-介绍与初体验
不知不觉,“.NET平台开源项目速览“系列文章已经15篇了,每一篇都非常受欢迎,可能技术水平不高,但足够入门了.虽然工作很忙,但还是会抽空把自己知道的,已经平时遇到的好的开源项目分享出来.今天就给大家 ...
- 15个关于Chrome的开发必备小技巧[译]
谷歌Chrome,是当前最流行且被众多web开发人员使用的浏览器.最快六周就更新发布一次以及伴随着它不断强大的开发组件,使得Chrome成为你必备的开发工具.例如,在线编辑CSS,console以及d ...
- 15个C++项目列表
实验楼上有很多C++的实战项目,从简单到进阶,学习每个项目都可以掌握相应的知识点. 如果你还是C++新手的话,那么这个C++的项目列表你可以拿去练手实战开发,毕竟学编程动手实践是少不了的! 如果你不知 ...
- Hacker Rank: Two Strings - thinking in C# 15+ ways
March 18, 2016 Problem statement: https://www.hackerrank.com/challenges/two-strings/submissions/code ...
- 在 Ubuntu 15.04 中使用 ubuntu-make、Eclipse 4.4、Java 8 以及 WTP
Ubuntu 今天发布新版本了 其实昨天(2015-04-23)我就看到了 Ubuntu 发布新版本的新闻,下班后回家的第一件事就是访问 Ubuntu 的官网,很可惜,没有提供下载.今天(2015-0 ...
- 企业IT管理员IE11升级指南【15】—— 代理自动配置脚本
企业IT管理员IE11升级指南 系列: [1]—— Internet Explorer 11增强保护模式 (EPM) 介绍 [2]—— Internet Explorer 11 对Adobe Flas ...
随机推荐
- 时间戳转换成Date
SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ); String date = for ...
- Greenplum的全量备份之gpcrondump
gpcrondump是对gp_dump的一个包装,可以直接调用或者从crontab中调用.这个命令还允许备份除了数据库和数据之外的对象,比如数据库角色和服务器配置等. gpcrondump 常用到的参 ...
- java.lang.IllegalStateException异常简单分析和简单解决
我们在做文件上传或者下载,或者过滤等操作时,可能要用到页面的输出流. 例如在JSP使用: response.reset(); response.setContentType(”application/ ...
- css3 简单动画
<script> <!-- var x,y,n=0,ny=0,rotINT,rotYINT function rotateDIV() { x=document.getElementB ...
- java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException 今天遇到了这个问题.当时的情景是想要循环实现了runable的类和继承Thread类的两个线程.可是没有注意到,继承自Thr ...
- Uva 11400,照明系统设计
题目链接:https://uva.onlinejudge.org/external/114/11400.pdf 题意:有一个照明系统需要用到n种灯,每种灯的电压为V,电源费用K,每个灯泡费用为C,需要 ...
- nginx 的限制连接模块limit_zone与limit_req_zone
转载于:http://storysky.blog.51cto.com/628458/642970/ nginx 上有两个限制连接的模块一个是 limit_zone 另一个是 limie_req_zon ...
- torch基本操作
1.在terminal中th进入troch,th+文件名.lua运行文件.进入torch之后,dofile+"文件名.lua"运行文件
- Annotation实战【自定义AbstractProcessor】
前言 在使用Java的过程中,每个开发人员都接触过@Override, @Deprecated等等各式各样的注解,这些东西是java最基础的一些原生定义好的annotation.本文通过一个实例演示如 ...
- C# 中var as is 泛型集合
一.var var:万能变量类型,跟JS一样. 二.as:非强转类型. 强转类型:一般在变量前面加:(所需类型).如果转换失败,系统就会报错,如果用as,就不会报错,转换失败的话,就会返回null, ...