当前位置:三九宝宝网 → 宝宝教育 → 智力培养 → 正文

求一份400行小游戏代码

更新:04-25 整理:39baobao.com
字体:

[vb小游戏源代码]Rem 窗体创建三个单选框按钮,Option1、Option2、Option3 Private Sub Form_Activate() Option1.Caption = "石头" Option2.Caption = "剪刀" Option3.Caption = "布" Option1.Value...+阅读

一个简单的猜数字的游戏。

#include

#include

#include

#include

int main(void)

{

int RandomNum, InputNum, PassScore, count = 0;

//随机数生成

srand(GetTickCount());

RandomNum = rand() % 101;

//游戏开始

do

{

scanf("%d", &InputNum);

if(InputNum == RandomNum)

{

printf("正确!\n");

count++;

break;

}

else

{

if(InputNum > RandomNum )

{

printf("猜大了!\n");

count++;

continue;

}

if(InputNum < RandomNum )

{

printf("猜小了!\n");

count++;

continue;

}

}

}while(1);

//成绩计算

PassScore = (int)(log10(100) / log10(2)) + 1;

printf("您一共猜了%d次,", count);

if(count > 100)

{

printf("唉…你让我说你什么好呢?0分!\n");

}

else if(count > PassScore)

{

printf("咦…你还没掌握到方法哦!%d分吧!\n", (int)(60 * (2 * PassScore - count) / PassScore));

}

else if(count == PassScore)

{

printf("勉勉强强马马虎虎。及格了!60分!\n");

}

else if((count < PassScore) & (count > (PassScore / 2)))

{

printf("应该还算不错吧~!嘿嘿! %d分哈!\n", (int)(60 * (2 * PassScore - count) / PassScore));

}

else if((count <= (PassScore / 2)) & (count > 1))

{

printf("人品很不错嘛!%d分不解释咯哈!\n", (int)(60 * (2 * PassScore - count) / PassScore));

}

else if(count == 1)

{

printf("敢问你今天踩狗屎了??\n");

}

return 0;

}

求几C语言个小游戏代码简单的要注释谢谢了

// Calcu24.cpp : Defines the entry point for the console application.///*6-624点游戏*/#include "conio.h"#include "stdlib.h"#include "time.h"#include "math.h"#include "string.h"/* 从一副扑克牌中,任取4张。 2-10 按其点数计算(为了表示方便10用T表示),J,Q,K,A 统一按 1 计算 要求通过加减乘除四则运算得到数字 24。 本程序可以随机抽取纸牌,并用试探法求解。*/void GivePuzzle(char* buf){ char card[] = {'A','2','3','4','5','6','7','8','9','T','J','Q','K'}; for(int i=0; i

求一个简短的VB小游戏程序代码紧急!

展开全部

Private Sub Command1_Click()

Dim a As Integer, b As Integer, s As String

MsgBox "我记住一个数,你根据我的提示猜猜是这个数是几"

Randomize

a = Int(Rnd * 100)

s = InputBox("写出你猜的数")

Do While s ""

b = Val(s)

If a = b Then

MsgBox "你真聪明!猜对了"

Exit Do

ElseIf a > b Then MsgBox b & " 有点小了"

ElseIf a End If

s = InputBox("写出你猜的数")

Loop

MsgBox "88,下次再玩"

End Sub

本文地址:https://www.39baobao.com/show/32_91394.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.

以下为关联文档:

求一份游戏文案策划的案例您好,游戏文案策划(剧情策划)主要负责游戏的背景、世界观、剧情的扩展,任务的设计,任务对白的撰写等方面。另外,在剧情设计中,剧情策划还需要同关卡策划紧密配合。因为关卡策划在架...

求一份观察记录关于一名3到6岁幼儿的游戏活动注明游戏过程观察目的:芸芸小朋友个性较强,由于现在都是独生子女,都比较自私,自己的东西不懂得与人分享,不懂得与人合作,通过观察教育让他们养成良好的行为习惯。 观察实录: 今天班里一位小朋友...

求C小游戏代码以下是贪吃蛇源代码:#include#include#include#include#include#define N 21void gotoxy(int x,int y)//位置函数{COORD pos;pos.X=2*x;pos.Y=y;SetConsoleCursorPosition(Ge...

用PHP搞1个井字棋的小游戏行吗求代码 #bg{width:150px; margin:auto; margin-top:15%; } #bg div{ width:44px; height:44px; border:solid 1px #33bcfa; background:#2db648; float:left; font-size:50px; t...

用C编写的小游戏代码以下是贪吃蛇源代码:#include#include#include#include#include#define N 21void gotoxy(int x,int y)//位置函数{COORD pos;pos.X=2*x;pos.Y=y;SetConsoleCursorPosition(Ge...

java猜数字小游戏代码怎么写1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 importjava.util.Scanner; publicclassGuess { privatestaticfinalintF = 1; privatestaticfinalintT...

跪求猜数字小游戏代码 C急#include<iostream> #include<cstdlib> #include<ctime> using namespace std; class Guess { public: Guess(); int compare(int _a); int count; private: int a; }; Gues...

求一份游戏公会收人广告XXXX工会之N不收: 1、ID猥琐、出言龌龊、言语混乱者 不收。 2、先问好处,以要钱、要装备、要帮忙为目的者,不收。 3、战斗无脑、操作无配合、眼光狭隘不自知者,不收。 4、言语无...

求一份入团申请书400字你应该是名初中生吧! 给你个范文: 敬爱的学校团支部: 团支部组织是一个优秀的团体。 本人深刻理解共青团的意义,所以我要入团! 我是初中某班班的###,上课遵守纪律,不搞小动作,上学从...