Práctica de juegos en lenguaje C (4): simulador de reinicio de vida

 Prefacio:

El simulador de reinicio de vida es un juego muy popular hace algún tiempo. A continuación, aprenderemos a escribir una versión simple del simulador de reinicio de vida usando lenguaje C. 

Versión web del juego:

Simulador de reinicio de vida (ytecn.com)

1. Implementar una versión simplificada del simulador de reinicio de vida.

(1) Cuando comience el juego, establece los atributos iniciales: apariencia, físico, inteligencia, antecedentes familiares.

(2) Inicie el juego y genere aleatoriamente el género y el punto de nacimiento.

(3) Generar algunas experiencias de vida para cada año (basándose en ciertos factores aleatorios + los atributos del personaje actual)

2.Imprimir menú

void menu()
{
	printf("---------------------------------------------------\n");
	printf("|                                                 |\n");
	printf("|             欢迎来到人生重开模拟器              |\n");
	printf("|                    1.play                       |\n");
	printf("|                    2.exit                       |\n");
	printf("|                                                 |\n");
	printf("---------------------------------------------------\n");

}
void game()
{

}
int main()
{
	int input = 0;
	do
	{
		menu();
		printf("请选择>:");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("退出游戏\n");
			break;
		default:
			printf("选择错误,请重新选择\n");
		}
	} while (input);
	return 0;
}

3.Establecer propiedades iniciales

(1) La suma de apariencia, sistema, inteligencia y antecedentes familiares no puede exceder de 20, y el valor de cada ítem está entre 1 y 10.

printf("请设置初始属性(可用点数总数为 20)>:\n");
printf("请输入颜值(1-10):");
scanf("%d", &face);
printf("请输入体质(1-10):");
scanf("%d", &strong);
printf("请输入智力(1-10):");
scanf("%d", &iq);
printf("请输入家境(1-10):");
scanf("%d", &home);

(2) Verificar el contenido ingresado por el usuario

Puede escribir un bucle while que finalice el bucle si el reproductor ingresa correctamente; de ​​lo contrario, el bucle continúa. Aquí podemos tomar el valor de marca count=1. Si el jugador ingresa correctamente, simplemente count-1=0 para salir del bucle. De lo contrario, count+1 continúa el bucle.

int face = 0, strong = 0, iq = 0, home = 0;
int count = 1;
while (count)
{
	printf("请设置初始属性(可用点数总数为 20)>:\n");
	printf("请输入颜值(1-10):");
	scanf("%d", &face);
	printf("请输入体质(1-10):");
	scanf("%d", &strong);
	printf("请输入智力(1-10):");
	scanf("%d", &iq);
	printf("请输入家境(1-10):");
	scanf("%d", &home);
	if (face > 10 || face < 1 || strong>10 || strong < 1 || iq>10 || iq < 1 || home>10 || home < 1)
	{
		printf("属性点输入有误,请重新输入\a\n");
		count++;
	}
	else if (face + strong + iq + home > 20)
	{
		printf("属性总和大于20,请重新输入\a\n");
		count++;
	}
	count--;
}
printf("初始属性输入完毕!\n");
printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);

4. Generar el género del personaje.

Usando la función rand, la función srand y la función de tiempo para generar un número aleatorio, puede generar indirectamente un género al azar.

#include<stdio.h>
#include<time.h>
#include<stdlib.h>
srand((unsigned int)time(NULL));
int sex = rand() % 2;
if (sex == 1)
{
	printf("你是个男孩.\n");
}
else
{
	printf("你是个女孩.\n");
}

5. Establece el punto de nacimiento del personaje.

Idea general:

El primer nivel de estado familiar es 10, lo que aporta algunas bonificaciones de atributos.

El segundo nivel de estatus familiar 7-9 también traerá bonificaciones de atributos.

Antecedentes familiares 4-6 El tercer nivel, algunas bonificaciones de atributos

Estado familiar 1-3, cuarto nivel, se deducirán los atributos

Cada archivo se divide en tres situaciones mediante números aleatorios.

int point = rand() % 3;
//第一档
if (home == 10)
{
	printf("你出生在帝都,你的父母是高管政要.\n");
	home += 1;
	iq += 1;
	face += 1;
}
//第二档
else if (home <= 9 && home >= 7)
{
	if (point == 1)
	{
		printf("你出生在大城市,你的父母是公务员.\n");
		face += 2;
	}
	else if (point == 2)
	{
		printf("你出生在大城市,你的父母是企业高管.\n");
		home += 2;
	}
	else
	{
		printf("你出生在大城市,你的父母是大学教授.\n");
		iq += 2;
	}
}
//第三档
else if (home <= 6 && home >= 4)
{
	if (point == 1)
	{
		printf("你出生在三线城市,你的父母是医生.\n");
		strong += 1;
	}
	else if (point == 2)
	{
		printf("你出生在镇上,你的父母是老师.\n");
		iq += 1;
	}
	else
	{
		printf("你出生在镇上,你的父母是个体户.\n");
		home += 1;
	}
}
//第四档
else
{
	if (point == 1)
	{
		printf("你出生在农村,你的父母是辛苦劳作的农民.\n");
		strong += 1;
		face -= 2;
	}
	else if (point)
	{
		printf("你出生在穷乡僻壤,你的父母是无业游民.\n");
		home -= 1;
	}
	else
	{
		printf("你出生在镇上,你的父母感情不和.\n");
		strong -= 1;
	}
}
printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);

6.Etapa de la infancia (1-10 años)

Idea general:

Primero use un bucle for para bucle del 1 al 10 según la edad.

Para cada año, se genera un número aleatorio (1-3)

Se activan varios eventos según el rol, el amor, la edad, varios atributos y los números aleatorios afectarán el resultado del evento.

Los eventos aquí pueden traer cambios en las propiedades.

Al final de la ejecución de cada año, se imprimen los eventos que ocurrieron en este año (de modo que solo ocurra un evento cada año)

También puedes encontrarte con una muerte prematura.

Dificultades del código:

1. Utilice la matriz de preguntas de estructura para asignar valores de cadena a la matriz:

La función strcpy se usa y debe llamarse usando #include<string.h>.

2. Dejar que algunos eventos se ejecuten repetidamente

Aquí, la instrucción switch, el bucle while y la función rand, la función time, se utilizan para generar números aleatorios.

Debido a que esto solo imprime eventos de 1 a 10 años, asigné un valor de 10 para contar aquí y luego contar, para poder imprimir de 1 a 10 años en un bucle, y luego usé números aleatorios aquí para hazlo aleatorio Seleccione un evento para imprimir de los eventos que he escrito.

3. Puede imprimir más lento al imprimir.

Utilizo la función Suspender aquí, que debe llamarse usando #include<windows.h>.

4. Para enriquecer el contenido de la historia, agregué eventos de noticias similares a , y la diferencia entre este evento y los eventos afectados por los atributos de los personajes es: 1. Este evento no se ve afectado por los atributos de los personajes y no puede afectar a los personajes. , su generación es aleatoria. 2. Este evento solo se puede ejecutar (imprimir) una vez, mientras que los eventos afectados por atributos de carácter se pueden ejecutar varias veces.

La dificultad aquí es cómo evitar que tales acontecimientos noticiosos se repitan. Utilicé la instrucción goto aquí, primero asigno un elemento a 0, lo ejecuto una vez y lo incremento en 1, y luego juzgo a través de la instrucción if. Si el elemento asignado no es igual a cero, ejecuto la instrucción goto para regenerar un número aleatorio . y vuelva a ejecutar la instrucción switch.

	struct Event
{
	char eve[80];
};
void even(int face,int strong,int iq,int home,int sex,int point)
{
	int t = 0, o = 0, w = 0, r = 0, f = 0, v = 0, s = 0, e = 0, n = 0, g = 0;
	int count = 10;
	int age = 1;
	while (count)
	{
		
		int a = rand((unsigned int)time(NULL)) % 10;
		struct Event arr[10];
	again:
		switch (a + 1)
		{
		case 1:
			if (sex == 0 && home <= 3 && point == 1)
			{
				strcpy(arr[0].eve, "你的家里人重男轻女观念非常严重,你被遗弃了!\n游戏结束!");
				printf("%s\n", arr[0].eve);
				count = 1;
			}
			else
			{
				if (o == 0)

				{
					strcpy(arr[0].eve, "全球范围实现碳中和。");
					o++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
			break;
		case 2:
			if (strong < 6 && point < 3)
			{
				if (home >= 5)
				{
					strcpy(arr[1].eve, "你生了一场病,在你的父母悉心照顾下,你康复了");
					strong += 1;
					home -= 1;
				}
				else
				{
					strcpy(arr[1].eve, "你生了一场病,你的父母没精力管你,你的身体状况更糟糕了");
					strong -= 1;
				}
			}
			else
			{
				if (w == 0)

				{
					strcpy(arr[1].eve, "火星建立永久性人类居住基地。");
					w++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
				
			}
			break;
		case 3:
			if (face <= 4&& age >= 7)
			{
				if (iq > 5)
				{
					strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你决定用学习填充自己");
				}
				else
				{
					if (sex == 1)
					{
						strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你和别的小朋友经常打架!");
						strong += 1;
						iq -= 1;
					}
					else
					{
						strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你进常被被别的小朋友欺负");
						strong -= 1;
					}
				}
			}
			else
			{
				if (r == 0)

				{
					strcpy(arr[2].eve, "全球范围内的无人驾驶汽车技术普及。");
					r++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
				
			}
			break;
		case 4:
			if (iq < 5)
			{
				if (home >= 8 && age >= 6)
				{
					strcpy(arr[3].eve, "你看起来傻傻的,你的父母把你送到更好的学校学习。");
					iq += 1;
				}
				else if (home >= 4 && home <= 7)
				{
					if (sex == 1)
					{
						strcpy(arr[3].eve, "你看起来傻傻的,你的父母鼓励你多运动,争取成为运动员。");
						strong += 1;
					}
					else
					{
						strcpy(arr[3].eve, "你看起来傻傻的,你的父母鼓励你多打扮自己。");
						face += 1;
					}
				}
				else
				{
					strcpy(arr[3].eve, "你看起来傻傻的,你的父母为此经常吵架。");
					if (point == 1)
						strong -= 1;
					else if (point == 2)
						iq -= 1;
				}
			}
			else
			{
				if (f == 0)

				{
					strcpy(arr[3].eve, "人工智能与人类共同创造新文化。");
					f++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
			break;
		case 5:
		{
			if (point == 1)
			{
				strcpy(arr[4].eve, "你健康成长,你看起来更结实了。");
				strong += 1;
			}
			else if (point == 2)
			{
				strcpy(arr[4].eve, "你健康成长,你看起来更好看了。");
				face += 1;
			}
			else
			{
				if (v == 0)

				{
					strcpy(arr[4].eve, "人类开始探索宇宙深处,与外星文明建立联系。");
					v++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
		}
		break;
		case 6:
			if (s == 0)
			{
				strcpy(arr[5].eve, "人类成功实现核聚变能源的商业化应用,彻底解决能源危机问题。");
				s++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 7:
			if (e == 0)
			{
				strcpy(arr[6].eve, "虚拟实现技术发展到一个全新的高度,人们可以随时地沉浸到虚拟世界中。");
				e++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 8:
			if (n == 0)
			{
				strcpy(arr[7].eve, "全球范围内的高速交通网络初步建成,人们可以在几小时内穿越地球。");
				n++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 9:
			if (g == 0)

			{
				strcpy(arr[8].eve, "高考取消英语这门科目。");
				g++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
				}
			break;
		case 10:
			if (t == 0)
			{
				strcpy(arr[9].eve, "全球实现无国界教育,世界各地的学生都能接受优质的教育。");
				t++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		}
		if (strong <= 0)
		{
			printf("你今年 %d 岁\n", age);
			if (point == 1)
			{
				printf("你染上了新冠病毒,没能抗住病毒的侵袭,你死了!\n");
				printf("游戏结束!\n");
				break;
			}
			else if (point == 2)
			{
				printf("你得了白血病,不幸去世!\n");
				printf("游戏结束!\n");
				break;
			}
			else                          
			{
				printf("你吃东西的时候不小心被呛死了!\n");
				printf("游戏结束!\n");
				break;
			}
		}
		else if (iq <= 0)
		{
			printf("你今年 %d 岁\n", age);
			if (point == 1)
			{
				printf("你发高烧的时候,由于治疗不及时变成了一个智障!\n");
				printf("游戏结束!\n");
				break;
			}
			else if (point == 2)
			{
				printf("你不小心喝了日本核污水变成了一个智障!\n");
				printf("游戏结束!\n");
				break;
			}
			else
			{
				printf("由于酒精中毒,你变成了一个智障\n");                                                                         
				printf("游戏结束!\n");
				break;
			}
		}
			printf("---------------------------------------------------------------\n");
			printf("你今年 %d 岁了\n", age);
			printf("%s\n", arr[a].eve);
			printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);
			printf("---------------------------------------------------------------\n");
			Sleep(1000);
			age++;
			count--;
		
	}
}

7. Otros grupos de edad:

 Si está interesado, puede dar rienda suelta a su imaginación y completar los eventos de otros grupos de edad. Por ejemplo, en un determinado grupo de edad, despierta su talento para cultivar inmortales y luego escapa del mundo de los mortales y entra al país de las hadas. ; otro ejemplo es en un determinado grupo de edad. Después de estar expuesto a los deportes electrónicos, me volví extremadamente talentoso en los juegos y me convertí en un jugador profesional.

Código completo:

#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<windows.h>
#include<string.h>
void menu()
{
	printf("---------------------------------------------------\n");
	printf("|                                                 |\n");
	printf("|             欢迎来到人生重开模拟器              |\n");
	printf("|                    1.play                       |\n");
	printf("|                    2.exit                       |\n");
	printf("|                                                 |\n");
	printf("---------------------------------------------------\n");

}
struct Event
{
	char eve[80];
};
void even(int face, int strong, int iq, int home, int sex, int point);
void game()
{
	srand((unsigned int)time(NULL));
	//输入初始属性
	int face = 0, strong = 0, iq = 0, home = 0;
	int count = 1;
	while (count)
	{
		printf("请设置初始属性(可用点数总数为 20)>:\n");
		printf("请输入颜值(1-10):");
		scanf("%d", &face);
		printf("请输入体质(1-10):");
		scanf("%d", &strong);
		printf("请输入智力(1-10):");
		scanf("%d", &iq);
		printf("请输入家境(1-10):");
		scanf("%d", &home);
		if (face > 10 || face < 1 || strong>10 || strong < 1 || iq>10 || iq < 1 || home>10 || home < 1)
		{
			printf("属性点输入有误,请重新输入\a\n");
			count++;
		}
		else if (face + strong + iq + home > 20)
		{
			printf("属性总和大于20,请重新输入\a\n");
			count++;
		}
		count--;
	}
	printf("初始属性输入完毕!\n");
	printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);
	//生成角色的性别
	int sex = rand() % 2;
	if (sex == 1)
	{
		printf("你是个男孩.\n");
	}
	else
	{
		printf("你是个女孩.\n");
	}
	//设定角色的出生点
	int point = rand() % 3;
	//第一档
	if (home == 10)
	{
		printf("你出生在帝都,你的父母是高管政要.\n");
		home += 1;
		iq += 1;
		face += 1;
	}
	//第二档
	else if (home <= 9 && home >= 7)
	{
		if (point == 1)
		{
			printf("你出生在大城市,你的父母是公务员.\n");
			face += 2;
		}
		else if (point == 2)
		{
			printf("你出生在大城市,你的父母是企业高管.\n");
			home += 2;
		}
		else
		{
			printf("你出生在大城市,你的父母是大学教授.\n");
			iq += 2;
		}
	}
	//第三档
	else if (home <= 6 && home >= 4)
	{
		if (point == 1)
		{
			printf("你出生在三线城市,你的父母是医生.\n");
			strong += 1;
		}
		else if (point == 2)
		{
			printf("你出生在镇上,你的父母是老师.\n");
			iq += 1;
		}
		else
		{
			printf("你出生在镇上,你的父母是个体户.\n");
			home += 1;
		}
	}
	//第四档
	else
	{
		if (point == 1)
		{
			printf("你出生在农村,你的父母是辛苦劳作的农民.\n");
			strong += 1;
			face -= 2;
		}
		else if (point)
		{
			printf("你出生在穷乡僻壤,你的父母是无业游民.\n");
			home -= 1;
		}
		else
		{
			printf("你出生在镇上,你的父母感情不和.\n");
			strong -= 1;
		}
	}
	printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);
	even(face, strong, iq, home, sex, point);
}
int main()
{
	int input = 0;
	do
	{
		menu();
		printf("请选择>:");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("退出游戏\n");
			break;
		default:
			printf("选择错误,请重新选择\n");
		}
	} while (input);
	return 0;
}
void even(int face,int strong,int iq,int home,int sex,int point)
{
	int t = 0, o = 0, w = 0, r = 0, f = 0, v = 0, s = 0, e = 0, n = 0, g = 0;
	int count = 10;
	int age = 1;
	while (count)
	{
		
		int a = rand((unsigned int)time(NULL)) % 10;
		struct Event arr[10];
	again:
		switch (a + 1)
		{
		case 1:
			if (sex == 0 && home <= 3 && point == 1)
			{
				strcpy(arr[0].eve, "你的家里人重男轻女观念非常严重,你被遗弃了!\n游戏结束!");
				printf("%s\n", arr[0].eve);
				count = 1;
			}
			else
			{
				if (o == 0)

				{
					strcpy(arr[0].eve, "全球范围实现碳中和。");
					o++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
			break;
		case 2:
			if (strong < 6 && point < 3)
			{
				if (home >= 5)
				{
					strcpy(arr[1].eve, "你生了一场病,在你的父母悉心照顾下,你康复了");
					strong += 1;
					home -= 1;
				}
				else
				{
					strcpy(arr[1].eve, "你生了一场病,你的父母没精力管你,你的身体状况更糟糕了");
					strong -= 1;
				}
			}
			else
			{
				if (w == 0)

				{
					strcpy(arr[1].eve, "火星建立永久性人类居住基地。");
					w++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
				
			}
			break;
		case 3:
			if (face <= 4&& age >= 7)
			{
				if (iq > 5)
				{
					strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你决定用学习填充自己");
				}
				else
				{
					if (sex == 1)
					{
						strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你和别的小朋友经常打架!");
						strong += 1;
						iq -= 1;
					}
					else
					{
						strcpy(arr[2].eve, "你长得太丑了,别的小朋友不喜欢你,你进常被被别的小朋友欺负");
						strong -= 1;
					}
				}
			}
			else
			{
				if (r == 0)

				{
					strcpy(arr[2].eve, "全球范围内的无人驾驶汽车技术普及。");
					r++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
				
			}
			break;
		case 4:
			if (iq < 5)
			{
				if (home >= 8 && age >= 6)
				{
					strcpy(arr[3].eve, "你看起来傻傻的,你的父母把你送到更好的学校学习。");
					iq += 1;
				}
				else if (home >= 4 && home <= 7)
				{
					if (sex == 1)
					{
						strcpy(arr[3].eve, "你看起来傻傻的,你的父母鼓励你多运动,争取成为运动员。");
						strong += 1;
					}
					else
					{
						strcpy(arr[3].eve, "你看起来傻傻的,你的父母鼓励你多打扮自己。");
						face += 1;
					}
				}
				else
				{
					strcpy(arr[3].eve, "你看起来傻傻的,你的父母为此经常吵架。");
					if (point == 1)
						strong -= 1;
					else if (point == 2)
						iq -= 1;
				}
			}
			else
			{
				if (f == 0)

				{
					strcpy(arr[3].eve, "人工智能与人类共同创造新文化。");
					f++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
			break;
		case 5:
		{
			if (point == 1)
			{
				strcpy(arr[4].eve, "你健康成长,你看起来更结实了。");
				strong += 1;
			}
			else if (point == 2)
			{
				strcpy(arr[4].eve, "你健康成长,你看起来更好看了。");
				face += 1;
			}
			else
			{
				if (v == 0)

				{
					strcpy(arr[4].eve, "人类开始探索宇宙深处,与外星文明建立联系。");
					v++;
				}
				else
				{
					a = rand((unsigned int)time(NULL)) % 10;
					goto again;
				}
			}
		}
		break;
		case 6:
			if (s == 0)
			{
				strcpy(arr[5].eve, "人类成功实现核聚变能源的商业化应用,彻底解决能源危机问题。");
				s++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 7:
			if (e == 0)
			{
				strcpy(arr[6].eve, "虚拟实现技术发展到一个全新的高度,人们可以随时地沉浸到虚拟世界中。");
				e++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 8:
			if (n == 0)
			{
				strcpy(arr[7].eve, "全球范围内的高速交通网络初步建成,人们可以在几小时内穿越地球。");
				n++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		case 9:
			if (g == 0)

			{
				strcpy(arr[8].eve, "高考取消英语这门科目。");
				g++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
				}
			break;
		case 10:
			if (t == 0)
			{
				strcpy(arr[9].eve, "全球实现无国界教育,世界各地的学生都能接受优质的教育。");
				t++;
			}
			else
			{
				a = rand((unsigned int)time(NULL)) % 10;
				goto again;
			}
			break;
		}
		if (strong <= 0)
		{
			printf("你今年 %d 岁\n", age);
			if (point == 1)
			{
				printf("你染上了新冠病毒,没能抗住病毒的侵袭,你死了!\n");
				printf("游戏结束!\n");
				break;
			}
			else if (point == 2)
			{
				printf("你得了白血病,不幸去世!\n");
				printf("游戏结束!\n");
				break;
			}
			else                          
			{
				printf("你吃东西的时候不小心被呛死了!\n");
				printf("游戏结束!\n");
				break;
			}
		}
		else if (iq <= 0)
		{
			printf("你今年 %d 岁\n", age);
			if (point == 1)
			{
				printf("你发高烧的时候,由于治疗不及时变成了一个智障!\n");
				printf("游戏结束!\n");
				break;
			}
			else if (point == 2)
			{
				printf("你不小心喝了日本核污水变成了一个智障!\n");
				printf("游戏结束!\n");
				break;
			}
			else
			{
				printf("由于酒精中毒,你变成了一个智障\n");                                                                         
				printf("游戏结束!\n");
				break;
			}
		}
			printf("---------------------------------------------------------------\n");
			printf("你今年 %d 岁了\n", age);
			printf("%s\n", arr[a].eve);
			printf("颜值:%d,体质:%d,智力:%d,家境:%d\n", face, strong, iq, home);
			printf("---------------------------------------------------------------\n");
			Sleep(1000);
			age++;
			count--;
		
	}
}

Capturas de pantalla del juego: 

Supongo que te gusta

Origin blog.csdn.net/weixin_58252863/article/details/136638090
Recomendado
Clasificación