codeblocks 编译java_在CodeBlocks中发布编译程序
我已成功编译/运行其他程序但是当我尝试编译/运行下面的代码时,它告诉我:“这个项目尚未构建,你想现在构建它吗?” .
当我从函数getWinnings()中取出int时,它将编译/运行,但是如果我添加更多参数,那么代码:: blocks会给我上面的消息 . 是什么造成的?
#include
#include
#include
#include
int gameCoins;
using namespace std;
void instructions();
void playSlots();
void spin();
int main()
{
srand(time(NULL));
instructions();
playSlots();
}
void instructions()
{
cout << "\t\t" << "VIRTUAL SLOT MACHINE" << "\n\n";
cout << "INSTRUCTIONS: " << endl << "You start with 500 coins. The game is over either when you run out of coins or you quit the game." << "\n";
cout << "It will cost you 25 coins per spin. Good luck!" << "\n\n" ;
}
void playSlots()
{
string user_input;
string replay_or_quit;
while (replay_or_quit != "n" && replay_or_quit != "no")
{
gameCoins = 500;
cout << "Coins: " << gameCoins << "\n";
while (user_input != "spin" && user_input != "Spin")
{
cout << "Spin the wheels to start playing. Type 'spin' to begin" << "\n";
cin >> user_input; cout << "\n\n";
}
spin();
while (gameCoins > 0 && user_input != "no" && user_input != "n")
{
cout << "Spin again?" << "\n" << "Decision: ";
cin >> user_input;
if (user_input == "y" || user_input == "yes")
spin();
}
if (gameCoins == 0)
{
cout << "You went broke. Play again?" << "\n" << "Decision: ";
cin >> replay_or_quit;
}
else
{
cout << "Congratulations, you won " << gameCoins << " coins. Play again?" << "\n" << "Decision: ";
cin >> replay_or_quit;
}
}
}
int getWinnings(int a, int b)
{
return (a+b);
}
void spin()
{
int wheelOne_Top, wheelOne_Mid, wheelOne_Bot;
int wheelTwo_Top, wheelTwo_Mid, wheelTwo_Bot;
int wheelThree_Top, wheelThree_Mid, wheelThree_Bot;
int coinsWon;
gameCoins = gameCoins-25;
wheelOne_Top = (rand() % 3) + 1, wheelTwo_Top = (rand() % 3) + 1, wheelThree_Top = (rand() % 3) + 1;
wheelOne_Mid = (rand() % 3) + 1, wheelTwo_Mid = (rand() % 3) + 1, wheelThree_Mid = (rand() % 3) + 1;
wheelOne_Bot = (rand() % 3) + 1, wheelTwo_Bot = (rand() % 3) + 1, wheelThree_Bot = (rand() % 3) + 1;
while (wheelOne_Top == wheelOne_Mid || wheelOne_Top == wheelOne_Bot || wheelOne_Bot == wheelOne_Mid)
{
wheelOne_Mid = (rand() % 3) + 1;
wheelOne_Bot = (rand() % 3) + 1;
}
while (wheelTwo_Top == wheelTwo_Mid || wheelTwo_Top == wheelTwo_Bot || wheelTwo_Bot == wheelTwo_Mid)
{
wheelTwo_Mid = (rand() % 3) + 1;
wheelTwo_Bot = (rand() % 3) + 1;
}
while (wheelThree_Top == wheelThree_Mid || wheelThree_Top == wheelThree_Bot || wheelThree_Bot == wheelThree_Mid)
{
wheelThree_Mid = (rand() % 3) + 1;
wheelThree_Bot = (rand() % 3) + 1;
}
cout << "Coins: " << gameCoins << endl << endl;
cout << "\t\t\t" << wheelOne_Top << " " << wheelTwo_Top << " " << wheelThree_Top << "\n";
cout << "\t\t\t" << wheelOne_Mid << " " << wheelTwo_Mid << " " << wheelThree_Mid << "\n";
cout << "\t\t\t" << wheelOne_Bot << " " << wheelTwo_Bot << " " << wheelThree_Bot << "\n\n";
coinsWon = getWinnings(wheelOne_Top, wheelOne_Mid);
gameCoins = coinsWon + gameCoins;
if (gameCoins > 0)
cout << "You won " << gameCoins << " coins!" << "\n" << "Total Coins: " << gameCoins << "\n\n";
else
cout << "You lost 25 coins!" << "\n" << "Total coins: " << gameCoins << "\n\n";
}
codeblocks 编译java_在CodeBlocks中发布编译程序相关推荐
- ultraedit编译java_在UltraEdit中编译和运行Java程序
一.首先打开UltraEdit, 点击菜单上的 高级->工具配置,如图: 1 点击插入: 2 在菜单项名称写上该功能,"编译java ": 3 创建一个批处理的文件compi ...
- 关于edge下载文件及codeblocks编译中文乱码问题
一.edge下载文件中文乱码 edge下载中文乱码很可能是因为浏览器不兼容的问题,解决方案如下: 1.在浏览器搜索栏输入about:flags 2.进入开发者设置 如果显示是中文,搜索"兼容 ...
- codeblocks linux使用教程,codeblocks教程
这既是一份CodeBlocks使用教程,也是一份经由小编最新整理带来的CodeBlocks使用手册,如果你需要一份这样的codeblocks使用教程或是手册,那就赶紧点击本文下方相应的下载地址进行下载 ...
- windows环境jenkins安装 自动编译 publish over ssh 远程发布.netcore webapi 服务化.netcore webapi
title:'windows环境jenkins安装 自动编译 publish over ssh 远程发布.netcore webapi 服务化.netcore webapi' 1.下载安装JDK 只支 ...
- 如何降低在 npm 模块中发布敏感信息的可能性
简评:国内也有不少在开源代码里泄露敏感数据的例子,这种事一定要小心啊. 目前 npm 上有着数十万的包,而隐藏在这惊人数量之下的是更令人惊讶的敏感信息泄漏.包括 authentication toke ...
- mysql中添加下拉,如何从MySQL填充的下拉列表中发布数据
在任何人发火之前,我看过的不仅仅是以下3个帖子 . 这些都没有工作答案 . 这些只是做 . 不 . 工作 . 现在回答我的问题: 我的php页面上有一个下拉列表,由MySQL查询填充 . 这部分很完美 ...
- Tomcat8源码编译及导入Eclipse中研究
最近因为需求需要修改Tomcat中的某些功能,无奈只能研究那部分源码然后稍作修改. 目前Tomcat最新版是8.0,下载了源码包,编译并导入Eclipse中研究比较方便. 1. Tomcat8源码编译 ...
- VC如何在编译链接程序过程中在输出窗口看到链接的顺序
VC如何在编译链接程序过程中在输出窗口看到链接的顺序 具体操作:选择VC菜单Project->Settings->Link页,然后在Project Options的Edit栏中输入/ver ...
- 在web项目中发布jaxws
概述 在web项目中发布基于jaxws的webservice. 参考文章:用JAX-WS在Tomcat中发布WebService 参考文章说,如果不是servlet3.0及以上,需要配置servlet ...
最新文章
- Android数据手册02:android.permission权限请求汇总
- centos 安装 erlang
- Sqlite c/c++ api 学习
- 64位指针膨胀 java_Java 程序优化知识笔记
- MyBatis学习笔记(六)动态sql
- sis防屏蔽程序是什么意思_Android 11将强制应用程序支持本地备份——什么意思?...
- Docker最全教程——从理论到实战(二)
- 分布式事务,EventBus 解决方案:CAP【中文文档】
- 论文阅读(2)--Picking Deep Filter Responses for Fine-grained Image Recognition
- C语言空指针NULL详解
- Visual Studio 2010 实用功能总结图解
- ceph 代码分析 读_五大常见存储系统PK | Ceph、GlusterFS、MooseFS、HDFS、DRBD
- 构建基于流程的多维度企业管理体系
- php fopen下载文件,php fopen下载远程文件的函数 | 学步园
- 后台扫描工具 - 御剑(珍藏版)附下载
- Oracle索引的原理及使用
- 在西安参加Java培训该怎么学习?
- 人工智能--技术发展史
- 从键盘输入一个四位数,输出该四位数的个位,十位,百位和千位数分别是什么。
- python用folium绘制地图并设置弹窗
热门文章
- 【电脑帮助】解决Win10系统电脑开机速度慢的问题
- 使用静态容器防止并发修改同一对象
- 为什么css效果在本地测试没问题,上传到服务器后却显示位置乱动,css下拉菜单本地正常,上传后360浏览器中显示错位,火狐、IE8显示正常...
- Oracle listener
- rds mysql 表被删了_MySQL · 捉虫动态 · 删除索引导致表无法打开
- 上拉加载_如何用Vue + Mint UI实现上拉加载更多
- jpa 托管_JPA EntityManager详解(一)
- 华为杯数学建模2020什么时候出结果_关于东北三省数学建模联赛及“华为杯”研究生数学建模竞赛的通知...
- 分布式文件系统FastDFS安装教程
- spring_boot的logback-spring.xml配置为什么 %d{yyyy-MM-dd} 不起作用