好玩的游戏

//赌徒狂欢1.8
#include<iostream>
#include<windows.h>
using namespace std;
int f=200,a,b,ans,k,x,water;
void gs(string x) {
	int a=x.size();
	for(int i=0; i<=a; ++i) {
		Sleep(100);
		cout<<x[i];
	}
}

void gg() {
	system("cls");
	for(int i=0; i<=20; i++) {
		//cout<<30-i<<"s";
		if(i==0) {
			gs("            Mod牌笔记");
			cout<<endl;
		}
		if(i==1) {
			gs("        学习好助手,你值得拥有");
			cout<<endl;
		}
		if(i==2) {
			gs("     __    ___________");
			cout<<endl;
		}
		if(i==3) {
			gs("     ||    |    M    |");
			cout<<endl;
		}
		if(i==4) {
			gs("     ||    |    o    |");
			cout<<endl;
		}
		if(i==5) {
			gs("     ||    |    d    |");
			cout<<endl;
		}
		if(i==6) {
			gs("     ||    |    牌   |");
			cout<<endl;
		}
		if(i==7) {
			gs("     ||    |    笔   |");
			cout<<endl;
		}
		if(i==8) {
			gs("     \\\b\\/    |    记   |");
			cout<<endl;
		}
		if(i==9) {
			gs("           |_________|");
			cout<<endl;
		}
		if(i==10) {
			cout<<endl;
		}
		if(i==11) {
			cout<<endl;
		}
		if(i==12) {
			cout<<endl;
		}
		if(i==13) {
			gs("如有需要,请拨打445-2753-1756。");
		}
		if(i>13) {
			Sleep(1000);
		}
		//system("cls");
	}
	cout<<"获得15块"<<endl;
	f+=15;
	Sleep(200);
	system("cls");
	return ;
}

void cp() {
	system("cls");
	f-=3;
	for(int i=1; i<=100; i++) {
		cout<<"0-30选一个数,作为你的彩票编码第"<<i<<"位"<<endl;
		cin>>a;
		b=rand()%30+1;//概率可调
		if(a==b)ans*=100;
		else {
			if(ans==1){
				cout<<"你得到了0元"<<endl;
			}else{
				cout<<"你得到了"<<ans<<"元"<<endl;
				f+=ans;
			}
			Sleep(500);
			system("cls");
			break;
		}
	}
}

void tiger() {
	f-=15;
	ans=1;
	system("cls");
	cout<<"按下3后按下enter摇杆"<<endl;
	cin>>x;
	int c,d,e;
	c=rand()%30+1;//概率可调
	d=rand()%30+1;//概率可调
	e=rand()%30+1;//概率可调
	cout<<"|"<<c<<"|"<<d<<"|"<<e<<"|"<<endl;
	if(c==d) {
		ans*=10*e/2;
		if(d==e) {
			ans*=100*e;
			cout<<"大奖!";
			Sleep(500);
		}
	} else {
		if(d==e)ans*=e/2;
	}
	if(d==c+1&&e==d+1) {
		ans*=1000;
		cout<<"顺子";
	}
	if(d==c-1&&e==d-1) {
		ans*=900;
		cout<<"反顺子";
	}
	Sleep(500);
	if(ans==1){
		cout<<"你得了0元"<<endl;
	}else{
		cout<<"你得了"<<ans<<"元"<<endl;
		f+=ans;
		ans=1;
	}
	Sleep(500);
	system("cls");
}

void winer() {
	system("cls");
	f-=200;
	cout<<"你好,要点什么?"<<endl;
	cout<<"1:黄金酒,500元,可以将购买后你的总额翻十倍;"<<endl<<"2:生死酒,50%的概率死亡,50%的概率将总额翻10000倍"<<endl;
	cout<<"3:圣水,200元,可以免疫一次死亡;"<<endl<<"4.可口可乐,20元,可以获得1-500元不等的人民币"<<endl;
	cout<<"输入数字"<<endl;
	int wine;
	cin>>wine;
	if(wine==1) {
		f-=500;
		f*=10;
		cout<<"金子!金子!";
	} else if(wine==2) {
		int ed=rand()%2+1;
		if(ed==1) {
			if(water) {
				water-=1;
				cout<<"神明庇护了你";
			} else {
				cout<<"你死了"<<endl;
				cout<<"达成结局3:死亡";
				Sleep(1000);
				exit(0);
			}
		} else {
			cout<<"恭喜你,活下来了";
			f*=10000;
			Sleep(500);
		}
	} else if(wine==3) {
		f-=200;
		water++;
		cout<<"神明会庇佑你";
	} else {
		f-=20;
		int ed=rand()%500+1;
		cout<<"瓶盖上显示你得了"<<ed<<"元"<<endl;
		f+=ed;
	}
	Sleep(1000);
	system("cls");

}

int main() {
	int linshideeryi;
	cout<<"无尽模式开启啦,1:游玩体验,0:算鸟算鸟"<<endl;
	cin>>linshideeryi;
	system("cls");
	if(linshideeryi==0) {
		while(f>0) {
			if(f>=100000000) {
				cout<<"恭喜你通关本游戏"<<endl;
				cout<<"感谢游玩"<<endl;
				cout<<"达成结局1:亿万富翁";
				Sleep(1000);
				exit(0);
			}
			cout<<"3元一次,玩彩票:1|15元一次,玩老虎机:2|广告:3|VIP服务:4,200元,有惊喜"<<endl;
			cout<<"存款:"<<f<<endl;
			cin>>k;
			ans=1;
			if(k==1) {
				cp();
			} else if(k==3) {
				gg();
			} else if(k==2) {
				tiger();
			} else if(k==23) {
				system("cls");
				cout<<"这是一个未开放完全的程序"<<endl;
				cout<<"达成隐藏结局:掉入的未知区域";
				Sleep(1000);
				exit(0);
			} else if(k==4) {
				winer();
			}
			system("cls");
		}
		cout<<"你破产了,记得下载反诈APP"<<endl;
		cout<<"达成结局2:破产";
	} else {
		while(f>0) {
			cout<<"退出:0|3元一次,玩彩票:1|15元一次,玩老虎机:2|广告:3|VIP服务:4,200元,有惊喜"<<endl;
			cout<<"存款:"<<f<<endl;
			cin>>k;
			ans=1;

			if(k==0) {
				int sorry;
				system("cls");
				cout<<"真的要退出吗?接着退:1|点错了:0"<<endl;
				cin>>sorry;
				system("cls");
				if(sorry==0) {
					continue;
				} else {
					cout<<"好吧,说实话,我也不知道为啥要写这game,不过你倒是知道见好就收,好吧,你走吧"<<endl;
					Sleep(1000);
					system("cls");
					cout<<"达成结局4:见好就收"<<endl;
					Sleep(1000);
					exit(0);
				}

			} else if(k==1) {

				cp();

			} else if(k==3) {

				gg();

			} else if(k==2) {

				tiger();

			} else if(k==23) {

				system("cls");
				cout<<"这是一个未开放完全的程序"<<endl;
				cout<<"达成隐藏结局:掉入的未知区域";
				Sleep(1000);
				exit(0);

			} else if(k==4) {
				
				winer();
				
			}
			system("cls");
		}

		cout<<"你破产了,记得下载反诈APP"<<endl;
		cout<<"达成结局2:破产";
	}
	Sleep(1000);
	return 0;
}

下面是一种养成类小游戏

#include<iostream>//wenjing game
#include<windows.h>
using namespace std;

int ming=1,ton=90,li=5,food=3,water=1;

void fly(int l,int t){
	system("cls");
	if(l<2*t)cout<<"飞不起来了"<<endl;
	else{
		int fei=rand()%l+1;
		if(fei!=1){
			cout<<"飞起来了"<<endl;
			if(rand()%2+1==1){
				cout<<"飞走了~~~"<<endl;
				exit(0);
			} else{
				cout<<"不~,坠鸡了"<<endl; 
			}
		}
	} 
}

void eat(){
	system("cls");
	int ed=rand()%10+1;
	if(ed==5){
		cout<<"才刚吃饱"<<endl; 
		food++;
	}else{
		if(ed==9){
			cout<<"吃撑了"<<endl;
			ton+=10;
			food+=10; 
			li++; 
		}else{
			cout<<"吃饱了"<<endl;
			food+=3;
			ton+=1;
			li+=10;
		}
	}
	Sleep(1000);
}

void drink(){
	int ed=rand()%10+1;
	water+=ed;
}

void lian(int t){
	int ed=rand()%10+1;
	if(ed==1){
		cout<<"竟然累死了"<<endl;
		ming-=1; 
		exit(0);
	}else{
	    cout<<"健康每一天"<<endl;
		ton-=10; 
		li+=10;
	}
}

int main(){
	cout<<"here is a chicken,his name is wenjing"<<endl;
	while(ming>0){
		cout<<"你想喂它吗(用bool值,1:喂,0:不喂)"<<endl;
		int wen;
		cin>>wen; 
		if(wen==1){
			eat();
		}else{
			cout<<"鸡鸡有点饿"<<endl; 
			food-=1;
			ton-=10;
		}
		cout<<"想喝口水吗(1:喝,0:喝你个俄罗斯大贝塔)" <<endl;
		cin>>wen;
		if(wen==1){
			drink();
		}else{
			water-=1;
		}
		cout<<"带出去练练不?1:好,0:不)"<<endl;
		cin>>wen;
		if(wen==1){
			lian(ton);
		}
		if(food<=0){
			cout<<"饿爆了"<<endl; 
			ming-=1;
		}
		if(water<=0){
			cout<<"渴爆了"<<endl; 
			ming-=1;
		}
		cout<<"飞不飞(1:飞,2:飞个蛋)"<<endl;
		cin>>wen;
		if(wen==1){
			fly(li,ton);
		}
		cout<<"一肘"<<li<<"斤"<<endl;
		cout<<"重"<<ton<<"00g";
		Sleep(1000);
		system("cls"); 
	}
	cout<<"wenjing is death"<<endl;
	return 0;
} 

写字小程序python版

import turtle

a=input("输入你想要的汉字")

def write_text():
    t = turtle.Turtle()
    t.penup()
    t.goto(0, -50)
    t.color('black')
    t.write(a, align="center", font=("Arial", 24, "bold"))
    t.hideturtle()

screen = turtle.Screen()
screen.bgcolor('white')
write_text()
screen.mainloop()