-
C++ 미니 방탈출C++ 2018. 7. 4. 04:05반응형#include<iostream>#include<string>#include<Windows.h>#include<conio.h>#include<time.h>#include<vector>using namespace std;void gotoxy(int x, int y){COORD young;young.X = x;young.Y = y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), young);}class Screen{public:void PrintStart(){cout << endl;cout << endl;cout << endl;cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << " " << endl;cout << " 비 트 실 탈 출 게 임 " << endl;cout << " 게임시작 = Y , 종료 = N " << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << endl;cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" << endl;cout << endl;cout << " ";}void PrintBit(){system("cls");cout << endl;cout << endl;cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 1 1 . 강 사 님 p c ] [ 1 2 . 빔 프 로 젝 터 ] [ 1 3 . 보 드 판 ] " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 1 . 1 번 p c ] [ 2 . 2 번 p c ] " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 3 . 3 번 p c ] [ 4 . 4 번 p c ] " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 5 . 5 번 p c ] [ 6 . 6 번 p c ] " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 7 . 정 수 기] [ 8 . 옷 걸 이] " << endl;cout << " - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " " << endl;cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << " [ 1 4 . 출 입 문 ] [ 9 . 냉 장 고 ] [ 1 0 . 책 장 ] " << endl;cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << endl;cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" << endl;cout << " - 게임종료 0 " << endl;}void PrintRefrigerator(){system("cls");cout << endl;cout << endl;cout << endl;cout << " ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ " << endl;cout << " / /ㅣ" << endl;cout << " ===================================== ㅣ" << endl;cout << " l lㅣ" << endl;cout << " l - lㅣ" << endl;cout << " l l l lㅣ" << endl;cout << " l - lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " ===================================== ㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l - lㅣ" << endl;cout << " l l l lㅣ" << endl;cout << " l l l lㅣ" << endl;cout << " l - lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l lㅣ" << endl;cout << " l l/ " << endl;cout << " ===================================== " << endl;cout << endl << endl;cout << "냉장고가 보인다. 배도 고픈데 한번 열어볼까?" << endl;cout << " 냉장고를 연다: 1 뒤로가기: 0" << endl;}void PrintRefrigerator2(){system("cls");cout << " ===================================== " << endl;cout << " l l " << endl;cout << " l - l " << endl;cout << " l l l l " << endl;cout << " l - l " << endl;cout << " l l " << endl;cout << " l l " << endl;cout << " ===================================== ------------------------------------- " << endl;cout << " l ___________________________________ l |" << endl;cout << " l l |" << endl;cout << " l l |" << endl;cout << " l ∂ ≠ ∵ ジ ㅅ l ____________________________________ |" << endl;cout << " l l |" << endl;cout << " l ___________________________________ l |" << endl;cout << " l l |" << endl;cout << " l l |" << endl;cout << " l l |" << endl;cout << " l ‰ ㅱ δ ~~~~~~~~~ l ____________________________________ |" << endl;cout << " l l |" << endl;cout << " l l |" << endl;cout << " ===================================== ======================================" << endl;cout << endl;cout << " \" << endl;cout << " \________" << endl;cout << " | |" << endl;cout << " \_______□□| ⓞㅣ|" << endl;cout << " □| > | ♨" << endl;cout << " \_______□□□| ⓞㅣ|" << endl;cout << " |________|" << endl;cout << " /" << endl;cout << " /" << endl;cout << endl;cout << " 냉장고 냄새를 맡고 질식했다 " << endl;cout << " -뒤로가기 0" << endl;}void PrintBookcase(){system("cls");cout << endl;cout << endl;cout << "┌-----------┬------------┬------------┬--------------┐ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ____ㅣ ㅣ ㅣ ▽ ▼ ㅣ " << endl;cout << "ㅣ / / /ㅣ ㅣ ㅣ ▷◁ ▶◀ ㅣ " << endl;cout << "ㅣ / / / ㅣ ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ / / / ㅣ =! =! ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ /_/_/ ㅣ (_) (_) ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "├-----------┼------------┼------------┼--------------┤ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ○ ㅣ ㅣ " << endl;cout << "ㅣ ∧_∧ ㅣ ㅣ ○○ ㅣ ㅣ " << endl;cout << "ㅣ ☞(⊙ ⊙)ㅣ ㅣ ○○○ ㅣ ㅣ " << endl;cout << "├-----------┼------------┼------------┼--------------┤ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ________ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ / / / / /ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ! ㅣ / / / / / ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ! [_]! ㅣ / / / / / ㅣ ㅣ " << endl;cout << "ㅣ ㅣ [_] [_] ㅣ/_/_/_/_/ ㅣ ㅣ " << endl;cout << "├-----------┼------------┼------------┼--------------┤ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ __ ㅣ ㅣ ┌ㅡ┐ ㅣ " << endl;cout << "ㅣ ㅣ ┌└-┘┐ ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ______ ㅣ ㅣ☆ ★ㅣ ㅣ ㅣ ┌┴┬┴┐ ㅣ " << endl;cout << "ㅣ ㅣ______ㅣㅣ ㅣ★ ☆ㅣ ㅣ ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ______ㅣㅣ └-----┘ ㅣ ㅣ └--┴--┘ ㅣ " << endl;cout << "└-----------┴------------┴------------┴--------------┘ " << endl;cout << endl;cout << " 물건이 들어있는 책장이다. 잘 기억해 놔야겠다! (돌아가기 0) ";}void PrintComputer(){system("cls");cout << endl;cout << endl;cout << " ********************************************************" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** 전원이 들어오지 않습니다. **" << endl;cout << " ** ( 뒤로가기 0번 ) **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ********************************************************" << endl;cout << " ***********" << endl;cout << " ***********" << endl;cout << " *********** " << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;}void PrintUsb(){cout << endl;cout << " ┌ - ┐" << endl;cout << " ㅣ ㅣ" << endl;cout << " ┌┴ - ┴┐" << endl;cout << " ㅣ ㅣ" << endl;cout << " ㅣ U ㅣ" << endl;cout << " ㅣ S ㅣ" << endl;cout << " ㅣ B ㅣ" << endl;cout << " ㅣ ㅣ" << endl;cout << " └-------┘" << endl;cout << " *****************************" << endl;cout << endl;}void Printwater(){cout << "□□□□□□□□□□□□□□□□" << endl;cout << "□□□●●●●●●●●●●□□□" << endl;cout << "□□□●●●●●○○●●●□□□" << endl;cout << "□□□●○●●●●○○●●□□□" << endl;cout << "□□□●●●●●●○●●●□□□" << endl;cout << "□□□●●●●●●○○●●□□□" << endl;cout << "□□□●●○○●●○●●●□□□" << endl;cout << "□□□●●●●●○●●●●□□□" << endl;cout << "□□□□□●●○○●●□□□□□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■□□□□□□□□□□■■□" << endl;cout << "□■■□□■■□□■■□□■■□" << endl;cout << "□■■□□■■□□■■□□■■□" << endl;cout << "□■■□□□□□□□□□□■■□" << endl;cout << "□■■□□□□□□□□□□■■□" << endl;cout << "□■■□□□□□□□□□□■■□" << endl;cout << "□■■□□□□□□□□□□■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□■■■■■■■■■■■■■■□" << endl;cout << "□□□□□□□□□□□□□□□□" << endl;cout << " 상태가 안 좋아 보이는 정수기가 있다" << endl;cout << " 뒤로간다 : 1" << endl;cout << " 물을 마신다 : 2" << endl;}void PrintRemocon(){system("cls");cout << endl;cout << " 딱따구리가 지우지않은 보드판. " << endl;cout << "빔프로젝트를 켤수있는 리모콘을 주웠다." << endl;cout << " ┎-----------┓ " << endl;cout << " ㅣ ● 0 ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " ㅣ 0 0 0 ㅣ " << endl;cout << " ㅣ 0 0 0 ㅣ " << endl;cout << " ㅣ 0 0 0 ㅣ " << endl;cout << " ㅣ 0 0 0 ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " ㅣ □ □ ㅣ " << endl;cout << " ㅣ ○ ㅣ " << endl;cout << " ㅣ ■ ■ ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " ㅣ - - - ㅣ " << endl;cout << " ㅣ - - - ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " ㅣ ㅣ " << endl;cout << " └-----------┘ 뒤로가기 0" << endl;}void PrintQuiz(){system("cls");cout << endl;cout << " ************************************************************************* " << endl;cout << " * ______ ______ * " << endl;cout << " * | | | | * " << endl;cout << " * | 89 |----------| 99 | * " << endl;cout << " * |______| | |______| * " << endl;cout << " * | * " << endl;cout << " * | * " << endl;cout << " * ------ ______ * " << endl;cout << " * | | | | * " << endl;cout << " * | 35 |-----| 69 | * " << endl;cout << " * |______| | |______| * " << endl;cout << " * | * " << endl;cout << " * | * " << endl;cout << " * ------ ______ * " << endl;cout << " * | | | | * " << endl;cout << " * | 23 |-----| 14 | * " << endl;cout << " * |______| | |______| * " << endl;cout << " * | * " << endl;cout << " * | * " << endl;cout << " * ------ ______ * " << endl;cout << " * | | | | * " << endl;cout << " * | 10 |-----| 31 | * " << endl;cout << " * |______| | |______| * " << endl;cout << " * | * " << endl;cout << " * | * " << endl;cout << " * ----- * " << endl;cout << " * | | * " << endl;cout << " * | ? | * " << endl;cout << " * |_____| * " << endl;cout << " * * " << endl;cout << " ************************************************************************* " << endl;cout << " (뒤로가기 0) " << endl;cout << " ?에 들어갈 숫자를 입력하시오. " << endl;}void PrintFirst(){cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << " " << endl;cout << " 이겼습니다!! " << endl;cout << " " << endl;cout << " " << endl;cout << " 첫 번째 숫자는 " << endl;cout << " " << endl;cout << " ▤▤▤ " << endl;cout << " ▨ ▥ " << endl;cout << " ▨ ▥ " << endl;cout << " ▥ " << endl;cout << " ▥ " << endl;cout << " ▥ " << endl;cout << " ▥ " << endl;cout << " ▥ " << endl;cout << " ▥ " << endl;cout << " ▤▤▤▤▤▤▤▤ 입니다." << endl;cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << " -뒤로가기 0" << endl;}void PrintSecond(){system("cls");cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << endl;cout << " 두 번째 숫자는" << endl;cout << endl;cout << " ▨▥" << endl;cout << " ▨ ▥" << endl;cout << " ▨ ▥" << endl;cout << " ▨ ▥" << endl;cout << " ▨ ▥" << endl;cout << " ▨ ▥" << endl;cout << " ▨ ▥" << endl;cout << " ▤▤▤▤▤▤▤▤▤▤" << endl;cout << " ▥" << endl;cout << " ▥" << endl;cout << " ▥" << endl;cout << " ▥" << endl;cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << " -뒤로가기 0" << endl;}void PrintThird(){system("cls");cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << endl;cout << " 세 번째 숫자는" << endl;cout << endl;cout << " ▤▤▤▤▤▤▤" << endl;cout << " ▥" << endl;cout << " ▥" << endl;cout << " ▥" << endl;cout << " ▥ " << endl;cout << " ▥ ▨▨▨▨" << endl;cout << " ▨▨ ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨ ▨" << endl;cout << " ▨ ▨" << endl;cout << " ▨ ▨" << endl;cout << " ▨▨▨▨ " << endl;cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << " -뒤로가기 0" << endl;}void PrintFourth(){system("cls");cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << endl;cout << " 네 번째 숫자는" << endl;cout << endl;cout << " ▤▤▤▤▤▤▤▥" << endl;cout << " ▥" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨" << endl;cout << " ▨ "<< endl;cout << endl;cout << "★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆" << endl;cout << " -뒤로가기 0" << endl;cout << endl;}void PrintFinish(){cout << "" << endl;cout << " ▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣ " << endl;cout << " ▣ ▣" << endl;cout << " ▣ ▣" << endl;cout << " ▣ ▣" << endl;cout << " ▣ ▣" << endl;cout << " ▣ ▩▩▩ ▧▧▧ ▧▧▧ ▣ " << endl;cout << " ▣ ▩▩▩ ▩ ▧▧▧ ▧▧▧ ▧▧▧ ▣" << endl;cout << " ▣ ▩▩▩ ▩ ▧▧ ▧▧▧▧▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▩▩ ▩ ▧▧ ▧▧▧▧▧▧▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▩▩▩ ▩ ▧▧ ▧▧▧▧▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▒▒▩▩ ▩ ▧▧ ▧▧▧▧▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▩▩ ▩ ▧▧ ▧▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▩▩ ▩ ▧▧ ▧▧ ▧▧ ▣ " << endl;cout << " ▣ ▩▒▒▒▒▒ ▩▩▩ ▩ ▧▧▧▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒ ▩▩▩ ▩ ▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣ " << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧ ▣ " << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧▧▧▧▧▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧▧ ▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▩ ▧ ▧▧ ▧▧ ▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▧▧▧▧ ▧▧▧▧ ▣ " << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▧▧▧ ▧▧▧ ▣" << endl;cout << " ▣ ▩▒▒▒▒▒▒▒▒▒▒▩ ▧ ▧ ▣ " << endl;cout << " ▣ ▩▩ ▒▒▒▒▒▒▒▒▩ ▣" << endl;cout << " ▣ ▩▩▒▒▒▒▒ ▩ ▣" << endl;cout << " ▣ ▩▩▒▒▒▩ ▦▦▦▦ ▦ ▦ ▦ ▦ ▦▦▦ ▦ ▦ ▣" << endl;cout << " ▣ ▩▩▩ ▦ ▦ ▦▦ ▦ ▦ ▦ ▦ ▦ ▣" << endl;cout << " ▣ ▦▦▦▦ ▦ ▦ ▦ ▦ ▦ ▦▦▦▦ ▦▦▦▦ ▣" << endl;cout << " ▣ ▦ ▦ ▦ ▦▦ ▦ ▦ ▦ ▦ ▣" << endl;cout << " ▣ ▦ ▦ ▦ ▦ ▦ ▦▦▦▦ ▦ ▦ ▣ " << endl;cout << " ▣ ▣" << endl;cout << " ▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣ " << endl;}void PrintScissors(){cout << " ┌--┬--┐" << endl;cout << " ㅣ▒ㅣ▒ㅣ" << endl;cout << " ㅣ▒ㅣ▒ㅣㅡㅡ┐" << endl;cout << " ┌-------┐ㅣ▒ㅣ" << endl;cout << " ㅣ▒┌---- ㅣ▒ㅣ " << endl;cout << " └┐▒▒▒▒▒ㅣ" << endl;cout << " └┐▒▒▒┌┘" << endl;cout << " └┐ ┌┘" << endl;}void PrintRock(){cout << " ┌--┬--┬--┬--┐" << endl;cout << " ㅣ▒ㅣ▒ㅣ▒ㅣ▒ㅣ" << endl;cout << " ┌-----┐┘--┘▒ㅣ" << endl;cout << " ㅣ▒┌-┘▒▒▒▒ㅣ" << endl;cout << " └┐▒▒▒▒▒┌-┘" << endl;cout << " └┐ ┌┘" << endl;}void PrintPaper(){cout << " ┌--┬--┬--┬--┐" << endl;cout << " ㅣ▒ㅣ▒ㅣ▒ㅣ▒ㅣ" << endl;cout << " ㅣ▒ㅣ▒ㅣ▒ㅣ▒ㅣ--┐" << endl;cout << " ㅣ▒ㅣ▒ㅣ▒ㅣ▒ㅣ▒ㅣ" << endl;cout << " ㅣ▒▒▒▒▒▒▒ㅣ▒ㅣ" << endl;cout << " ㅣ▒▒▒▒▒▒▒ㅣ▒ㅣ" << endl;cout << " └┐▒▒▒▒▒┌┘ ┘" << endl;cout << " ㅣ▒▒▒▒▒ㅣ" << endl;}void PrintDoor(){system("cls");cout << " ==========================================" << endl;cout << " ∥ ▤▤▤ ▧ ▨ ▤▤▤ ▤▤▤ ∥" << endl;cout << " ∥ ▥ ▧ ▨ ▥ ▥ ∥" << endl;cout << " ∥ ▤▤▤ ▒ ▥ ▥ ∥ " << endl;cout << " ∥ ▥ ▨ ▧ ▥ ▥ ∥" << endl;cout << " ∥ ▤▤▤ ▨ ▧ ▤▤▤ ▥ ∥" << endl;cout << " ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ┌ㅡ┬ㅡ┬ㅡ┬ㅡ┐ ㅣ" << endl;cout << "ㅣ ├ㅡ┼ㅡ┼ㅡ┼ㅡ┤ ㅣ" << endl;cout << "ㅣ ├ㅡ┼ㅡ┼ㅡ┼ㅡ┤ ㅣ" << endl;cout << "ㅣ └ㅡ┴ㅡ┴ㅡ┴ㅡ┘ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ┌ㅡ┐ ㅣ" << endl;cout << "ㅣ ㅣ ㅣ 출입문이 잠겨있다. ㅣ" << endl;cout << "ㅣ ㅣ ㅣ 비밀번호 4자리를 입력하시오. ㅣ" << endl;cout << "ㅣ ㅣ ㅣ (뒤로가기 0) ㅣ" << endl;cout << "ㅣ ㅣ ㅣ [____] ㅣ" << endl;cout << "ㅣ └ㅡ┘ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << "ㅣ ㅣ" << endl;cout << " ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ" << endl;}void PrintTeacher(){system("cls");cout << endl;cout << " ********************************************************" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** ※USB를 연결하시오.※ **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** 강사님 컴퓨터 화면이 비어 있다. **" << endl;cout << " ** **" << endl;cout << " ** 0. 돌아간다. 1. usb를 연결한다. **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ********************************************************" << endl;cout << " ***********" << endl;cout << " ***********" << endl;cout << " *********** " << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;cout << endl;}void PrintUsbcomputer(){system("cls");cout << endl;cout << endl;cout << " ********************************************************" << endl;cout << " ** **" << endl;cout << " ** --------------------- **" << endl;cout << " ** | ‡ A | B | C | D | **" << endl;cout << " ** ===================== **" << endl;cout << " ** | 1 ‡ | ★ | | | **" << endl;cout << " ** --------------------- **" << endl;cout << " ** | 2 ‡ ★ | | | | **" << endl;cout << " ** --------------------- **" << endl;cout << " ** | 3 ‡ | | ★ | | **" << endl;cout << " ** --------------------- **" << endl;cout << " ** | 4 ‡ | | | ★ | **" << endl;cout << " ** --------------------- **" << endl;cout << " ** **" << endl;cout << " ** 비밀번호를 입력하시오. **" << endl;cout << " ** [ ] **" << endl;cout << " ** **" << endl;cout << " ** **" << endl;cout << " ********************************************************" << endl;cout << " ***********" << endl;cout << " ***********" << endl;cout << " *********** " << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;cout << " *********************************************************" << endl;}void PrintHandLight(){cout << " ▒ " << endl;cout << " ▒▒ " << endl;cout << " ▒▒▒ " << endl;cout << " ▒▒▒▒ " << endl;cout << " /ㅣ ▒▒▒▒▒ " << endl;cout << " / ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅡㅡㅡㅡㅡㅡㅡㅡㅡ/ ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ ㅣ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ l ▒▒▒▒▒▒ " << endl;cout << " ㅣ ㅣ l ▒▒▒▒▒▒ " << endl;cout << " ㅡㅡㅡㅡㅡㅡㅡㅡㅡ↘ l ▒▒▒▒▒▒ " << endl;cout << " ↘ l ▒▒▒▒▒▒ " << endl;cout << " ↘l ▒▒▒▒▒ " << endl;cout << " ▒▒▒▒▒ " << endl;cout << " ▒▒▒▒ " << endl;cout << " ▒▒▒ " << endl;cout << " ▒▒ " << endl;cout << " ▒ " << endl;}void PrintFire(){cout << " ▒▒▒▒▒▒▒▒▒ " << endl;cout << " ▒▒▒▒▒▒▒ △ " << endl;cout << " ▒▒▒▒▒ △△ △ " << endl;cout << " ▒▒▒▒ △△ △ △ △ △△ △ " << endl;cout << " ▒▒▒▒ △ △△♨ △△ △△ △△ △△△ △△ " << endl;cout << " ▒▒▒▒ ▒▒▒▒♨△△△△△△△△△△△△△△△△△ △ " << endl;cout << " ▒▒▒▒▒▒▒△△□□△△△△△△△△△△△△△△△△△△△ " << endl;cout << " △△△△△△▨▨▨△△△ ▨▨▨△△△△△△△△ " << endl;cout << " △△△△△ ▨▨▨ △△ ▨▨▨▨▨△△△△△△△ △ " << endl;cout << " △△△△△▨▨ △△△ ▨▨▨▨△△△△△△△△△△△ " << endl;cout << " △△△△▨▨▨ △△△ ▨▨△△△△△△△△△△△△ △ " << endl;cout << " △△△△△△△△▨▨▨▨▨▨▨▨▨▨▨▨▨△△△△△△ △△ " << endl;cout << " △△△△△△△△△△△▨▨▨▨▨▨△ ▨▨△△△△△△△△△△ " << endl;cout << " △△△△△△△△△△△▨▨▨▨▨△△△▨▨△△△△△△ " << endl;cout << " △△△△△△△△△△△▨▨▨▨△△△ ▨▨△△△△△ " << endl;cout << " △△△△△△△△▨▨▨▨▨▨△△△△△△△△△△△ " << endl;cout << " △△△△△△△▨▨△△△▨▨△△△△△△△△ " << endl;cout << " △△△△△△▨▨△△△△▨▨△△△△△△△△ " << endl;cout << " △△△△△▨▨△△△△△▨▨△△△△△△ " << endl;cout << " △△△△▨▨▨△△△△△▨▨▨△△△ " << endl;cout << " ▦▦▦▦ ▦ ▦ ▦ ▦ " << endl;cout << " ▦▦▦▦ ▦ ▦▦ ▦ ▦▦▦▦ ▦ ▦▦ ▦▦▦ ▦▦ ▦ " << endl;cout << " ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦▦▦▦ ▦ ▦ ▦ ▦ " << endl;cout << " ▦▦▦▦ ▦▦ ▦ ▦ ▦ ▦▦▦ ▦▦ ▦ ▦▦▦ ▦ ▦ " << endl;cout << " ▦ ▦ ▦▦ ▦ ▦ ▦ ▦▦▦▦▦ ▦▦▦ " << endl;cout << " ▦▦▦▦ ▦ ▦ ▦▦▦ ▦ ▦ " << endl;cout << " ▦▦▦ ▦▦▦ ▦ " << endl;cout << " ▦ ▦ " << endl;cout << " ▦ ▦▦▦ " << endl;}void PrintCup(){cout << " " << endl;cout << " " << endl;cout << " ■■■■■■■■■ " << endl;cout << " ■■ ■ " << endl;cout << " ■■ ■ " << endl;cout << " ■■ ■ " << endl;cout << " ■■■ ■ " << endl;cout << " ■ ■■ ■■ ■ " << endl;cout << " ■ ■■■■■■■■■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■ " << endl;cout << " ■ ■■■■■■■■■ ■ " << endl;cout << " ■ ■▒▒▒▒▒▒▒▒▒■ ■ " << endl;cout << " ■ ■▒▒▒▒▒▒▒▒▒▒▒■■ " << endl;cout << " ■▒▒▒▒▒▒▒▒▒▒▒▒▒■ " << endl;cout << " ■■▒▒▒▒▒▒▒▒▒▒▒■ " << endl;cout << " ■▒▒▒▒▒▒▒▒▒■■ " << endl;cout << " ■ ■■■■■■■ " << endl;}void PrintEmptyBookcase(){system("cls");cout << "┌-----------┬------------┬------------┬--------------┐ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "├-----------┼------------┼------------┼--------------┤ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ ===================================" << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ 어두워서 책장이 잘 보이지 않는다... " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ 뭔가가 필요할것같은데..." << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ ===================================" << endl;cout << "├-----------┼------------┼------------┼--------------┤ -돌아가기 : 0 " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "├-----------┼------------┼------------┼--------------┤ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "ㅣ ㅣ ㅣ ㅣ ㅣ " << endl;cout << "└-----------┴------------┴------------┴--------------┘ " << endl;cout << endl;}void PrintComputer3(){cout << endl;cout << " =============================================================" << endl;cout << " 손전등과 컵이 보인다." << endl;cout << endl;cout << " 뒤로 가기 : 1 손전등을 줍는다 : 2 컵을 줍는다 : 3" << endl;cout << endl;cout << " ==============================================================" << endl;}};class Start{public:bool Go(){Screen screen;screen.PrintStart();while (1){char c;gotoxy(58, 17);cin >> c;if (c == 'Y')return true;else if (c == 'y')return true;else if (c == 'N')return false;else if (c == 'n')return false;elsesystem("cls");}}};class Gababo{Screen screen;public:void RSP1(int user, int com){if (user == 0){cout << "user : 가위, " << endl;screen.PrintScissors();}else if (user == 1){cout << "user : 바위, " << endl;screen.PrintRock();}else{cout << "user : 보, " << endl;screen.PrintPaper();}if (com == 0){cout << "com : 가위 " << endl;screen.PrintScissors();}else if (com == 1){cout << "com : 바위 " << endl;screen.PrintRock();}else{cout << "com : 보 " << endl;screen.PrintPaper();}}int RSP(int user, int com){user = user - 1;RSP1(user, com);if (user == com){cout << endl;cout << " 비겼습니다." << endl;}else if (user - com == 1){cout << " 이겼습니다." << endl;return 1;}else if (user - com == -2){cout << " 이겼습니다" << endl;return 1;}else{cout << endl;cout << " 졌습니다" << endl;}cout << endl;return 0;}int Game(){int user, com;system("cls");srand((unsigned)time(NULL));cout << " ※컴퓨터와 가위 바위 보 게임을 시작합니다.※" << endl;while (1){cout << "가위:1번, 바위:2번, 보:3번, 강제종료 : 4번" << endl;cin >> user;if (user == 4){break;}else if (user == 1 || user == 2 || user == 3){com = rand() % 3;if (RSP(user, com)){cout << endl;Sleep(500);system("cls");screen.PrintFirst();int num;cin >> num;if (num == 0)return 1;}cout << endl;}elsecout << "정확한 값을 입력 하시오." << endl;}return 0;}};class Puzzle{public:#define LEFT 75#define RIGHT 77#define UP 72#define DOWN 80int get_directionkey()//방향키를 입력받는 함수{int key;key = _getch();if (key == 224)//방향키{return _getch(); //어떤 방향 키인지 반환}return 0; //방향키가 아님}void print_puzzle(int puzzle[][3]){system("cls"); //콘솔 화면을 지우기cout << endl;cout << "<정답화면>" << endl;cout << "1 2 3" << endl;cout << "4 5 6" << endl;cout << "7 8" << endl;cout << "************" << endl;cout << endl;for (int r = 0; r < 3; r++)//열 반복{for (int c = 0; c < 3; c++)//행 반복{if (puzzle[r][c])//참이면(0이 아니면){cout << puzzle[r][c] << " ";//퍼즐의 수를 출력}else//거짓(0)이면{cout << " ";//공백 출력}}cout << endl;//개행}}int is_ending(int puzzle[][3]){for (int r = 0; r < 3; r++)//열 반복{for (int c = 0; c < 3; c++)//행 반복{if (puzzle[r][c] != r * 3 + c + 1){return (r == 2) && (c == 2);}}}return 0;}int Game(){int puzzle[3][3] = { { 1,3,2 },{ 7,8,4 },{ 6,5,0 } };int row = 2;int col = 2;int key = 0;while (!is_ending(puzzle)){print_puzzle(puzzle);cout << ">> 방향키 선택 " << endl;key = get_directionkey();switch (key){case RIGHT:if (col > 0){puzzle[row][col] = puzzle[row][col - 1];puzzle[row][col - 1] = 0;col--;}break;case LEFT:if (col < 3 - 1){puzzle[row][col] = puzzle[row][col + 1];puzzle[row][col + 1] = 0;col++;}break;case UP:if (row < 3 - 1){puzzle[row][col] = puzzle[row + 1][col];puzzle[row + 1][col] = 0;row++;}break;case DOWN:if (row > 0){puzzle[row][col] = puzzle[row - 1][col];puzzle[row - 1][col] = 0;row--;}break;}}return 1;}};class Water{public:void Drink(){Screen screen;int num, num2;system("cls");screen.Printwater();cin >> num;if (num == 1)return;if (num == 2){system("cls");cout << " ======================================= " << endl;cout << " 정수기 물이 썩어서 배탈이 났다..." << endl;cout << " =======================================" << endl;cout << " 돌아간다 : 0" << endl;cin >> num2;if (num2 == 0)return;}}};class Refrigerator{public:void Open(){Screen screen;int a;screen.PrintRefrigerator();cin >> a;if (a == 0)return;if (a == 1){screen.PrintRefrigerator2();int num;cin >> num;if(num==0)return;return;}}};class Cloth{public:int Find(){Screen screen;int a, b, c;cout << " ================================================" << endl;cout << " 뒤로가기 : 1" << endl;cout << " 옷을 뒤져본다 : 2" << endl;cout << " ================================================" << endl;cout << " ";cin >> a;system("cls");if (a == 1)return 0;if (a == 2){cout << endl;cout << " =================================================================================================" << endl;cout << " 옷 안에 라이터와 usb가 있다! " << endl;cout << " 뒤로가기 : 1" << endl;cout << " 라이터를 켠다 : 2" << endl;cout << " usb를 획득한다 : 3" << endl;cout << " =================================================================================================" << endl;cout << " ";cin >> b;system("cls");if (b == 1)return 0;if (b == 2){screen.PrintFire();cout << " 라이터가 터져 화상입었다" << endl;cout << " 뒤로 가기 : 0 ";cout << " ";cin >> c;if (c == 0)return 0;}if (b == 3){cout << endl;cout << " *** usb를 획득했다! ***" << endl;cout << " -뒤로가기 0" << endl;screen.PrintUsb();int num;cin >> num;if (num == 0)return 1;}}return 0;}};class Computer3{public:int Com3(){Screen screen;screen.PrintComputer3();gotoxy(50, 39);int num;cin >> num;system("cls");if (num == 1)return 0;else if (num == 2){system("cls");screen.PrintHandLight();cout << "손전등을 획득했다!" << endl;cout << "뒤로가기 : 0" << endl;int num2;cin >> num2;if (num2 == 0)return 1;return 1;}else if (num == 3){system("cls");screen.PrintCup();cout << endl;cout << " 컵을 획득했다!" << endl;cout << " 뒤로가기 : 0" << endl;int num2;cin >> num2;if (num2 == 0)return 2;return 2;}return 0;}};class Teacher{public:int On(){Screen screen;screen.PrintUsbcomputer();int num;gotoxy(28, 17);cin >> num;if (num == 2143){screen.PrintFourth();int num2;cin >> num2;if (num2 == 0)return 1;return 1;}else{cout << "비밀번호가 틀렸습니다 ( 뒤로가기 0)" << endl;int num2;cin >> num2;if (num2 == 0)return 0;return 0;}}};class Quiz{public:int Solve(){Screen screen;screen.PrintQuiz();while (1){int num;cin >> num;if (num == 5){system("cls");cout << endl;cout << "세번째 숫자는 5입니다." << endl;screen.PrintThird();int num;cin >> num;if (num == 0)return 1;return 1;}else if (num == 0)return 0;elsecout << " 틀렸습니다." << endl;}}};class Door{public:int Excape(){Screen screen;while (1){screen.PrintDoor();int num;gotoxy(26, 17);cin >> num;if (num == 1457){system("cls");cout << endl;cout << " 탈출 성공" << endl;screen.PrintFinish();return 1;}if (num == 0){return 0;}}}};class ExcapeBit{vector <string> item;vector <string> password;Screen screen;int remocon;int usb;int handlight;int cup;public:ExcapeBit() :remocon(0), usb(0), handlight(0), cup(0) {}void ExcapeStart(){Start st;bool brun = st.Go();while (brun){system("cls");screen.PrintBit();cout << "획득한 아이템 : ";for (vector<string>::iterator iter = item.begin(); iter != item.end(); iter++)cout << *iter << " ";cout << endl;cout << "획득한 숫자 : ";for (vector<string>::iterator iter2 = password.begin(); iter2 != password.end(); iter2++)cout << *iter2 << " ";cout << endl;cout << " 이동할곳을 입력하시오. ";int position;cin >> position;switch (position){case 0:return;case 1:{screen.PrintComputer();int num;cin >> num;if (num == 0)break;break;}case 2:{Gababo gbb;if (gbb.Game())password.push_back("첫번째 숫자:1 ");break;}case 3:{Computer3 cp3;int num=cp3.Com3();if (num == 0)break;else if (num == 1){item.push_back("handlight");handlight = 1;break;}else if (num == 2){item.push_back("cup");cup = 1;break;}}case 4:{screen.PrintComputer();int num;cin >> num;if (num == 0)break;break;}case 5:{screen.PrintComputer();int num;cin >> num;if (num == 0)break;break;}case 6:{Puzzle pz;if (pz.Game()){system("cls");screen.PrintSecond();password.push_back("두번째 숫자:4 ");int num;cin >> num;if (num == 0)break;}break;}case 7:{Water wt;if (cup == 1)wt.Drink();else{cout << endl;cout << " =================================" << endl;cout << " 컵이 없어서 물을 마실 수 없다" << endl;cout << " =================================" << endl;cout << " -뒤로가기 0" << endl;int num;cin >> num;if (num == 0)break;}break;}case 8:{Cloth ct;if (usb == 1){cout << "이미 usb가 있습니다" << endl;cout << "뒤로 돌아가기 : 0" << endl;int num;cin >> num;if (num == 0)break;}if (ct.Find()){usb = 1;item.push_back("usb");}break;}case 9:{Refrigerator rf;rf.Open();break;}case 10:{if (handlight == 1){screen.PrintBookcase();int num;cin >> num;if (num == 0)break;break;}else{screen.PrintEmptyBookcase();gotoxy(74, 13);int num;cin >> num;if (num == 0)break;break;}}case 11:{Teacher th;screen.PrintTeacher();int num;cin >> num;if (num == 1){if (usb == 1){if (th.On())password.push_back("네번째 숫자:7 ");}else if(usb == 0){cout << endl;cout << "※※※usb가 없다.※※※ (뒤로가기 0)" << endl;int num2;cin >> num2;if (num2 == 0)break;break;}}break;}case 12:{Quiz qz;if (remocon == 1){if (qz.Solve())password.push_back("세번째 숫자:5 ");}else{cout << endl;cout << " ===============================================" << endl;cout << " 리모컨이 없어서 빔프로젝트를 킬 수가 없다..." << endl;cout << " ===============================================" << endl;cout << " -뒤로가기 0" << endl;int num;cin >> num;if (num == 0)break;break;}break;}case 13:{int num;if (remocon == 1){cout << "※※※이미 remocon이 있습니다※※※" << endl;cout << "뒤로 돌아가기 : 0" << endl;cin >> num;if (num == 0)break;break;}screen.PrintRemocon();remocon = 1;item.push_back("remocon");cin >> num;if (num == 0)break;break;}case 14:{Door dr;if (dr.Excape())brun=0;break;}}}}};void main(){ExcapeBit EB;EB.ExcapeStart();}반응형
'C++' 카테고리의 다른 글
C++ 공튀기기 (0) 2018.07.05 C++ 전화번호부 만들기 (0) 2017.11.17 댓글