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 ...
随机推荐
- diff 文件比较
测试数据: [xiluhua@vm-xiluhua][~]$ cat msn.txt aaa bbb bbb ccc ccc ddd bbb eee aaa ccc bbb sss [xiluhua@ ...
- POJ 3903:Stock Exchange(裸LIS + 二分优化)
http://poj.org/problem?id=3903 Stock Exchange Time Limit: 1000MS Memory Limit: 65536K Total Submis ...
- java 类型转化
String 转int s="12345"; int i; 第一种方法:i=Integer.parseInt(s);;//直接使用静态方法,不会产生多余的对象,但会抛出异常 第二种 ...
- STL MAP及字典树在关键字统计中的性能分析
转载请注明出处:http://blog.csdn.net/mxway/article/details/21321541 在搜索引擎在通常会对关键字出现的次数进行统计,这篇文章分析下使用C++ STL中 ...
- c#之线程池优先级
using System; using System.Threading; namespace ConsoleApplication1 { class Program { static void Ma ...
- 表单校验组件ValidForm
10.1使用入门 1.引入css 请查看下载文件中的style.css,把里面Validform必须部分复制到你的css中 (文件里这个注释 "/*==========以下部分是Validf ...
- 浅谈算法和数据结构: 七 二叉查找树 八 平衡查找树之2-3树 九 平衡查找树之红黑树 十 平衡查找树之B树
http://www.cnblogs.com/yangecnu/p/Introduce-Binary-Search-Tree.html 前文介绍了符号表的两种实现,无序链表和有序数组,无序链表在插入的 ...
- hdu 1205 从整体考虑
吃糖果 Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submiss ...
- ADO,NET 实体类 和 数据访问类
啥也不说,看代码. --SQl中 --建立ren的数据库,插入一条信息 create database ren go use ren go create table xinxi ( code ) pr ...
- java反编译工具JD-GUI
这款java反编译工具是由C++写的,是一款免费的非商业用途的软件,(Xjad也不错,但是不支持jar反编译) 一.支持众多.class反编译工具 二.支持反编译jar