亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 9_2.cpp

?? 闖城堡游戲。城堡中設有一些房間和一些陷阱
?? CPP
?? 第 1 頁 / 共 2 頁
字號:

/*第2題	闖城堡游戲

2.2.1	課程設計的程序功能簡介:
    闖城堡游戲。城堡中設有一些房間和一些陷阱,玩的時候不小心,就落入陷阱。游戲要求玩家能夠安全離開城堡。

2.2.2	課程設計的任務要求: 
(1)一進入程序,顯示漢化命令提示,以便用戶選擇;
(2)擴充游戲規則,讓玩者按城堡的復雜程度選擇游戲的難易程度;
(3)記錄玩者獲勝次數,失敗次數到文件中,并打印輸出;
(4)將所有的函數與數據封裝到類中,并改寫主程序,使程序簡化。
(5)合做時,擴充游戲規則必須不同。
2.2.3	課程設計說明:
(1)可分三種難易程度:簡單;一般;較難。可以為程序增加了一個選擇難易程度的函數。
(2)由于游戲的難易程度不同,城堡的地圖也不同。
     簡單:玩家只能進入roomone,roomtwoeast,roomthreeeast,roomnorth,parlor。相對而言獲勝的機會就比較大,因此最簡單。是為初級者設計的
     一般:玩家能夠進入的地方要比"簡單"級的多一些。除了"簡單"級能進入的屋子外,還能進入roomwest,backdoor,fireplacre。
     較難:在這一級中城堡的地形會變的很復雜。
     為了實現以上的功能,需在原來的程序的基礎上增加了一些新的控制語句。
(3)游戲結束時,需自動顯示玩家的勝敗情況:一共玩了幾次,其中勝利幾次,失敗幾次。為實現該功能,可設了三個變量sum,win,lost..兩個函數printwin(), printlost()。并且在函數doyouquit()和bravesoul()中分別調用了這兩個函數。
(4)評定難易級別:B級,可合做。
2.2.4	課程設計的源代碼注解:*/
// This program was created by M. Carter Brown. Created  September 19, 2000.
// system("PAUSE"); in the program in a few places.  This allowed the program
// to pause until you hit a key before going on to the next step.

#include <iostream>
#include <stdlib.h>
using namespace std;

char outside();    //This is where the game starts
char roomone();    //This is when we step in the castle
char roomtwonorth();  //just what the name says is where we are going in the game
char roomtwoeast();
char roomtwowest();
char bravesoul();          // If you die first a consolation then char doyouquit();
char roomthreewest();
char dungeon();
char trapped();           // two choices here 1 == live, 2 == die
char roomthreeeast();     //I let you try and kill yourself here
char roomthreeeast2();     //Here's where I tell you that you can't
char backdoor();
char fireplace();
char fireplace2();        // I swear I'll have two for every room by the time I'm done this
char parlor();
char outside2();          //This is where you win the game.
char easttower();
char roomone2();  // this is roomone() but without the dramatics of the front door!
char outside3();  // bump on the head, beginning repeat!
char dungeon2();    // Gotta put this one in so we're not walking down the stairs again!!
char roomtwoeast2(); // another double room because of what I say.
char doyouquit();  //I figured instead of return 0; if you die I'll give you an option to keep playing
                // This will also work for invalid characters
int main()
{
      cout << "  *---*   *---*          *---*   *---* \n";
      cout << "  |   |___|   |          |   |___|   | \n";
      cout << "  |           |          |           | \n";
      cout << "  |    __     |__________|    __     | \n";
      cout << "  |   /  \\                   /  \\    | \n";
      cout << "  |   |  |       ______      |  |    | \n";
      cout << "  |   |__|      /      \\     |__|    | \n";
      cout << "  |             |      |             | \n";
      cout << "  |             |      |             | \n";
      cout << "  |             |      |             |  \n";
      cout << "  |_____________|______|_____________|  \n";
      cout << "\nWelcome to The Castle";
      cout << "\n\n\n";
      system("PAUSE");
      cout << outside();
}
char outside()
{
      int x;
      cout << "You are standing in front of the castle.\n";
      cout << "Next to you is a mailbox.  The castle is to the north.\n";
      cout << "What do you want to do\?\n";
      cout << "(1) North: \n";
      cout << "(2) East:  \n";
      cout << "(3) West: \n";
      cout << "(4) South: \n";
      cout << "(5) Look inside Mailbox: \n";
      cin >> x;
if (x == 1){  cout << roomone(); }
else if (x == 2)
{
      cout << "\nOUCH!  You run into a tree!\nTry again.\n\n";
      system("PAUSE");
      return outside3();
}
else if (x == 3)
{
     cout << "You can not go that way. \n\n";
     system("PAUSE");
     return outside();
}
else if (x == 4)
{
 cout << "You sink into the swamp!\n\nNext time you should be more careful.\n\nEnd Game\n\n";
 system("PAUSE");
 return bravesoul();
}
else if (x == 5)
{
     cout << "*------------------------------------------------*\n";
     cout << "| Thank you for trying and playing The Castle    |\n";
     cout << "| By M. Carter Brown, written in C++             |\n";
     cout << "|                                                |\n";
     cout << "| The object of this game is simply to get       |\n";
     cout << "| through the castle alive.                      |\n";
     cout << "| Good Luck!                                     |\n";
     cout << "|                           - M. Carter Brown    |\n";
     cout << "*------------------------------------------------*\n";
     cout << "\n\n\n\n";
     system("PAUSE");
     return outside();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4) || (x != 5))
{
     return doyouquit();
}
}
char roomone()
{
     int x;
     cout << "\nYou open the creaky wooden door.  You step into the castle\n";
     cout << "and notice that it is very dark except for the scattered light coming\n";
     cout << "through the windows.  All of a sudden, you feel a large gust of wind.\n";
     cout << "The heavy front door slams shut.  The door is locked.  You look around.\n";
     cout << "There are 3 doors, one to the North, East, and West.\n\n";
     cout << "Where do you want to go?\n";
     cout << "(1) North: \n";
     cout << "(2) East: \n";
     cout << "(3) West: \n";
     cout << "(4) South: \n";
     cout << "(5) Look around: \n";
     cin >> x;
if (x == 1)
{
     cout << roomtwonorth();
}
else if (x == 2)
{
     cout << roomtwoeast();
}
else if (x == 3)
{
     cout << roomtwowest();
}
else if (x == 4)
{
     cout << "You just tried the door, you know it is locked.\n";
     cout << "Why are you trying again?\n\n";
     system("pause");
     return roomone2();
}
else if (x == 5)
{
     return roomone2();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4) || (x != 5))
{
     cout << "\n\nInvalid Character\n\n";
     system("pause");
     return doyouquit();
}
}
char roomtwonorth()
{
     int x;
     cout << "\nYou walk North and into a room so bright that is hurts your eyes.\n";
     cout << "You still can't believe that a drab Castle such as this could be this\n";
     cout << "bright.  You can see high up the winding stairs.  You must be able to \n";
     cout << "get to the stairs from another room.  To the North is a closed door. \n";
     cout << "To the east is another door with a sign that reads \"Backdoor\". \n";
     cout << "You think to yourself \"They wouldn't make it that easy, would they?\"\n";
     cout << "Where do you want to go?\n";
     cout << "(1) North: \n";
     cout << "(2) South: \n";
     cout << "(3) East: \n";
     cin >> x;
if (x == 1)
{
     cout << "\n\n";
     return parlor();
}
else if (x == 2)
{
     cout << "\n\n";
     return roomone2();
}
else if (x == 3)
{
     cout << "\n\n";
     return backdoor();
}
else if ((x != 1) || (x != 2) || (x != 3))
{
     cout << "\n\n";
     return doyouquit();
}
}
char roomtwoeast()
{
     int x;
     cout << "You walk into a nicely funished room.  There is a large table in\n";
     cout << "the middle of the room with ten chairs around it.  There is a large\n";
     cout << "painting on the wall with an inscription.  There are three doors.\n";
     cout << "North, West, and East.\n";
     cout << "Where do you want to go?\n";
     cout << "(1) West: \n";
     cout << "(2) East: \n";
     cout << "(3) North:  \n";
     cout << "(4) South:  \n";
     cout << "(5) Look at the painting: \n";
     cin >> x;

if (x == 1)
{
     cout << "\n\n" << roomone2();
}
else if (x == 2)
{
     cout << "\n\n" << roomthreeeast();
}
else if (x == 3)
{
     cout << "You look but the door has no handles.  You can not open it.\n\n";
     system("pause");
     return roomtwoeast();
}
else if (x == 4)
{
     cout << "There is no window to look out of in this room.\n\n";
     system("pause");
     return roomtwoeast();
}
else if (x == 5)
{
     cout << "Looking at the painting closely you can read the writing at the bottom.\n\n";
     cout << "\"Three lefts make a right, do none of these\n";
     cout << "and you\'ll be alright!\"\n\n\n";
     system("pause");
     return roomtwoeast2();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4) || (x != 5))
{
     cout << "\n\nInvalid Character\n\n";
     system("pause");
     return doyouquit();
}
}
char roomtwoeast2()
{
     int x;
     cout << "You are back in the nicely funished room.  There is a large table in\n";
     cout << "the middle of the room with ten chairs is still here.  And so is the large\n";
     cout << "painting on the wall.  There are three doors.\n";
     cout << "North, West, and East.\n";
     cout << "Where do you want to go?\n";
     cout << "(1) West: \n";
     cout << "(2) East: \n";
     cout << "(3) North:  \n";
     cout << "(4) South:  \n";
     cout << "(5) Look at the painting: \n";
     cin >> x;
if (x == 1)
{
     cout << "\n\n" << roomone2();
}
else if (x == 2)
{
     cout << "\n\n" << roomthreeeast();
}
else if (x == 3)
{
     cout << "You look but the door has no handles.  You can not open it.\n\n";
     system("pause");
     return roomtwoeast();
}
else if (x == 4)
{
     cout << "There is no window to look out of in this room.\n\n";
     system("pause");
     return roomtwoeast();
}

else if (x == 5)
{
     cout << "Looking at the painting closely you can read the writing at the bottom.\n\n";
     cout << "\"Three lefts make a right, do none of these\n";
     cout << "and you\'ll be alright!\"\n\n\n";

     system("pause");
     return roomtwoeast2();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4) || (x != 5))
{

     return doyouquit();
}
}
char roomtwowest()
{
     int x;
     cout << "\nYou are now in a large room with a vaulted ceiling.\n";
     cout << "There are these old swords on the wall.  They look like they might be useful.\n";
     cout << "You look around the rest of the room.\n";
     cout << "There are 3 doors, one to the West, North, and East (Back where you came).\n\n";
     cout << "What do you want to do?\n";
     cout << "(1) West: \n";
     cout << "(2) North: \n";
     cout << "(3) South: \n";
     cout << "(4) East: \n";
     cin >> x;
if (x == 1)
{
    cout << roomthreewest();
}
else if (x == 2)
{
     cout << "The door won't open.  You assume that it must be locked.\n\n";
     system("pause");
     return roomtwowest();
}
else if (x == 3)
{
     cout << "\nYou look outside the front window.  Not a spectacular view.\n\n";
     system("pause");
     return roomtwowest();
}
else if (x == 4)
{
     cout << "\n\n";
     return roomone2();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4))
{
     return doyouquit();
}
}
char roomthreewest()
{
   int x;
   cout << "\nAs you enter the room you feel shiver as a chill runs\n";
   cout << "ove your body.  The room is bright with two rather large windows\n ";
   cout << "You hear thumping coming from the door to your right.\n";
   cout << "There are 2 doors, one to the North and one to the East (Back where you came).\n\n";
   cout << "What do you want to do?\n";
   cout << "(1) East: \n";
   cout << "(2) North: \n";
   cout << "(3) South: \n";
   cout << "(4) West: \n";
   cin >> x;
if (x == 1)
{
     cout << "You look out of the rather large window expecting to see something.\n";
     cout << "Nope.\n\n";
     system("pause");
     return roomthreewest();
}
else if (x == 2)
{
     cout << dungeon();
}
else if (x == 3)
{
     cout << "\nYou look outside the front window.  Not a spectacular view.\n\n";
     system("pause");
     return roomthreewest();
}
else if (x == 4)
{
     cout << "\n\n";
     return roomtwowest();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4))
{
     return doyouquit();
}
}
char dungeon()
{
     int x;
     cout << "You open the door and head down a flight of concrete stairs.\n";
     cout << "Your eyes start to focus on the room ahead.  They are adjusting\n";
     cout << "to the dark.  As you enter the room, you notice chains on the walls.\n";
     cout << "You look around and finally realize that you're in a dungeon!\n";
     cout << "You can make out a door to the east, and the one behind you.\n";
     cout << "Where do you want to go?\n";
     cout << "(1) North: \n";
     cout << "(2) East: \n";
     cout << "(3) West: \n";
     cout << "(4) South: \n";
     cin >> x;
if (x == 1)
{
     cout << "You step forward and loose your footing.\nYou fall down a hole in the floor.\n";
     cout << "You are so disorientated that you don\'t even realize you were impailed.\n\n";
     system("pause");
     return doyouquit();
}
else if (x == 2)
{
     cout << trapped();
}
else if (x == 3)
{
     cout << "\nYou feel something soft against the wall.  Not being sure what";
     cout << "it is you decide to leave it alone.\n\n";
     system("pause");
     return dungeon2();
}
else if (x == 4)
{
     cout << "THE DOOR IS LOCKED!!!\n\n";
     system("pause");
     return dungeon2();
}
else if ((x != 1) || (x != 2) || (x != 3) || (x != 4))
{
     return doyouquit();
}
}
char dungeon2()
{
     int x;
     cout << "You look around and realize that you're still in the dungeon!\n";
     cout << "Wish there was a way to get out of here?  Did you try the door\?\n";
     cout << "You can make out a door to the east, and the one behind you.\n";
     cout << "Where do you want to go?\n";
     cout << "(1) North: \n";
     cout << "(2) East: \n";
     cout << "(3) West: \n";
     cout << "(4) South: \n";
     cin >> x;
if (x == 1)
{
     cout << "You step forward and loose your footing.\nYou fall down a hole in the floor.\n";
     cout << "You are so disorientated that you don\'t even realize you were impailed.\n\n";
     system("pause");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一级日本不卡的影视| 日韩一级免费观看| 亚洲免费看黄网站| 91福利在线导航| 亚洲一区影音先锋| 在线综合视频播放| 99精品在线观看视频| 国产欧美精品一区二区色综合 | 国产精品福利在线播放| 99热精品国产| 午夜精品久久久久久久蜜桃app | 91国模大尺度私拍在线视频| 日韩和欧美一区二区| 日韩亚洲欧美综合| 成人黄色电影在线| 亚洲午夜羞羞片| 精品久久久三级丝袜| 成人一区二区三区| 天堂成人免费av电影一区| 欧美一区二区三区公司| 丁香五精品蜜臀久久久久99网站| 亚洲另类在线一区| 日韩欧美国产午夜精品| 国产成人在线免费| 亚洲国产成人va在线观看天堂 | 久久综合九色综合97婷婷| 95精品视频在线| 日韩制服丝袜av| 中文字幕高清不卡| 欧美日韩国产综合草草| 国产成人精品午夜视频免费| 亚洲成人一二三| 国产视频视频一区| 欧美精品v国产精品v日韩精品| 懂色一区二区三区免费观看| 亚洲成人动漫av| 国产精品乱人伦| 日韩女优制服丝袜电影| 色综合视频在线观看| 国产在线精品一区二区不卡了| 一区二区三区鲁丝不卡| 日本一区免费视频| 日韩午夜在线影院| 欧美性生交片4| 99麻豆久久久国产精品免费 | 中文字幕日韩精品一区| 欧美一区二区性放荡片| 色又黄又爽网站www久久| 国产福利91精品| 日韩精品成人一区二区三区| 一区二区国产视频| 91视频.com| 亚洲精品一区二区在线观看| 亚洲一区在线视频观看| 久久久国产精品午夜一区ai换脸| 精品国产免费一区二区三区香蕉| 欧美一区二区观看视频| 99re66热这里只有精品3直播| 国产一区二区三区最好精华液| 亚洲自拍偷拍麻豆| 亚洲情趣在线观看| 中文字幕中文字幕一区二区| 亚洲精品一区在线观看| 精品入口麻豆88视频| 91精品国产一区二区| 欧美日韩一区二区三区高清| 色综合激情久久| 91视频在线看| 色婷婷综合久色| 99国产麻豆精品| 色婷婷亚洲精品| 91麻豆蜜桃一区二区三区| 成人a级免费电影| 成人黄色电影在线 | 久久免费的精品国产v∧| 日韩欧美国产综合| 日韩三级中文字幕| 精品成人佐山爱一区二区| 精品国产第一区二区三区观看体验| 欧美一级欧美一级在线播放| 欧美一卡在线观看| 日韩一级片网址| 精品国产免费人成在线观看| 国产亚洲综合在线| 国产精品久久精品日日| 亚洲欧洲中文日韩久久av乱码| 中文字幕一区二区三区色视频| 1024国产精品| 亚洲aaa精品| 久久国内精品自在自线400部| 久久成人久久鬼色| 粉嫩aⅴ一区二区三区四区| 99久久精品一区| 欧美色综合网站| 欧美成人一区二区三区片免费| 久久久久久夜精品精品免费| 中文字幕在线观看不卡| 亚洲国产aⅴ天堂久久| 日本美女一区二区三区视频| 国产美女精品在线| 91在线你懂得| 3d动漫精品啪啪1区2区免费| 精品国产露脸精彩对白| 亚洲视频在线观看一区| 午夜精品福利一区二区三区蜜桃| 久久99精品国产麻豆婷婷洗澡| 国产不卡在线视频| 欧美天堂一区二区三区| 欧美成人a在线| 国产精品久久久久久久岛一牛影视 | 亚洲激情五月婷婷| 国产99久久精品| 99久久国产综合精品女不卡| 欧美天天综合网| 国产午夜亚洲精品理论片色戒| 日韩理论片一区二区| 亚洲444eee在线观看| 国产成人福利片| 欧美高清视频www夜色资源网| 蜜臀精品一区二区三区在线观看| 日韩欧美中文字幕制服| 国产夜色精品一区二区av| 亚洲美女屁股眼交3| 麻豆91免费观看| av一区二区不卡| 精品国产1区2区3区| 一区二区三区精品| 国产大片一区二区| 欧美久久久一区| 亚洲欧洲av在线| 国产一区二区三区最好精华液| 欧美性色黄大片| 中文字幕一区二区在线播放| 久久er99热精品一区二区| 欧美日韩情趣电影| 一区在线播放视频| 精品在线免费视频| 欧美日韩一卡二卡| 亚洲精品一卡二卡| 国产精品白丝av| 日韩视频在线永久播放| 亚洲国产视频a| 91丝袜美腿高跟国产极品老师 | 欧美一区二区成人| 亚洲国产视频一区二区| 97se亚洲国产综合自在线| 国产亚洲欧洲997久久综合| 麻豆久久久久久| 欧美日韩成人一区| 亚洲免费看黄网站| 99精品欧美一区二区三区小说| 久久亚洲精品国产精品紫薇| 麻豆成人91精品二区三区| 欧美日免费三级在线| 亚洲色欲色欲www| caoporm超碰国产精品| 国产情人综合久久777777| 国产在线一区观看| 欧美刺激脚交jootjob| 麻豆中文一区二区| 日韩一区二区视频| 蜜桃精品视频在线观看| 欧美一区二区三区播放老司机| 亚洲超丰满肉感bbw| 欧美欧美午夜aⅴ在线观看| 亚洲一区二区三区免费视频| 欧美午夜片在线观看| 亚洲一二三四在线| 欧美色成人综合| 亚洲在线视频免费观看| 欧美图区在线视频| 日韩精品一卡二卡三卡四卡无卡| 欧美日韩国产另类一区| 亚洲成人动漫精品| 日韩视频一区在线观看| 久久aⅴ国产欧美74aaa| 久久久噜噜噜久久人人看 | 日本高清不卡视频| 亚洲免费在线看| 欧美日韩aaa| 久久精品久久综合| 日本一区二区久久| 色综合天天综合网天天看片| 亚洲一二三四在线观看| 91精品国产综合久久福利| 国内精品久久久久影院薰衣草 | 在线观看日韩av先锋影音电影院| 亚洲一区二区综合| 日韩丝袜美女视频| 粉嫩av一区二区三区在线播放 | 日韩不卡在线观看日韩不卡视频| 日韩视频一区二区在线观看| 国产伦精品一区二区三区视频青涩| 国产精品热久久久久夜色精品三区 | 日本亚洲最大的色成网站www| 欧美一区二区三区人| 国产河南妇女毛片精品久久久 | 亚洲高清免费视频| 精品欧美一区二区久久| 成人黄色一级视频|