資源簡介
#include
#include
using namespace std;
int choice;
int a=0,b=0,c=0,d=0;
int user_input;
void S(int Color)
{
HANDLE hCon=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon,Color);
}
void wait()
{
Sleep(100);
user_input=getchar();
}
void cls()
{
Sleep(100);
system("cls");
}
int main(int argc, char *argv[])
{
S(172);
start:cls();
goto a1;
gameover:printf("游戲結束。");
printf("按回車鍵繼續");
user_input=getchar();
goto start;
a1:printf("現在游戲開始。");
user_input=getchar();
printf("一天,你正在開飛機經過一片雪山區。");
wait();
printf("忽然你的操作系統失控了,飛機直直地墜入山中。");
wait();
printf("你朝兩旁看了看,左邊是雪地,右邊是樹林。而你正前方是懸崖,所以你不得不轉彎。\n1-左轉。\n2-右轉。\n");
s1:wait();
switch(user_input)
{
case'1':goto a8;
case'2':goto a13;
default:goto s1;
}
a2:cls();
printf("你下了飛機,走向樹林。");
wait();
printf("過了一會兒,你感到又餓又冷,就喝了一點威士忌,坐下休息。");
wait();
printf("但是,威士忌并沒有讓你覺得溫暖。你只是覺得很冷、很冷。\n");
goto gameover;
a3:cls();
printf("你吃了一些果實,還摘了一些放在口袋,想晚一點吃。");
wait();
printf("過了一會兒,你的肚子劇烈的痛起來。這時,你才意識到,果子有毒!\n");
goto gameover;
a4:cls();
printf("你是否要繼續往隧道里走?\n1-是。\n2-不了。\n");
s4:wait();
switch(user_input)
{
case'1':goto a18;
case'2':goto a22;
default:goto s4;
}
a5:cls();
printf("你能帶三件東西下飛機。請選擇:\n1-香蕉、打火機、外套。\n2-威士忌、外套、匕首。\n");
s5:wait();
switch(user_input)
{
case'1':goto a10;
case'2':goto a2;
default:goto s5;
}
a6:cls();
printf("你走到了隧道里,隧道里很黑,忽然你被一個東西絆倒了。\n");
wait();
printf("你爬起來,看了看地上的東西,原來是一條麻繩。\n1-撿起來。\n2-置之不理。\n");
s6:wait();
switch(user_input)
{
case'1':goto a11;
case'2':goto a23;
default:goto s6;
}
a7:cls();
printf("你呆在飛機里,感到越來越冷,你不得不離開了飛機。\n");
goto a5;
a8:cls();
printf("隨著“噗”地一聲悶響,你的飛機安全降落在雪地上。");
wait();
printf("你要離開飛機去找東西嗎?\n1-離開。\n2-待著。\n");
s8:wait()

代碼片段和文件信息
評論
共有 條評論