From ff7d67c48af999368db9acc8fdbdec86f568f7b2 Mon Sep 17 00:00:00 2001 From: Rratic Date: Sun, 21 Feb 2021 14:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BC=BA=E5=A4=B1=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- cpp11/maze-game.cpp | 33 +++++++++++++++++---------------- save/README.txt | 1 + 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 26bb5e5..50e4598 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ e.g. (using g++,code path=`D:/C++`):`g++ -std=c++11 D:/C++/Maze/cpp11/main.cpp D #### And then然后…… your folder must at least include: ``` -data/levels.data +data/ maze.exe (or other excutable files) ``` Run maze.exe diff --git a/cpp11/maze-game.cpp b/cpp11/maze-game.cpp index f6dc259..89b01d3 100644 --- a/cpp11/maze-game.cpp +++ b/cpp11/maze-game.cpp @@ -14,6 +14,7 @@ void init(){ cout<<"Language package unfound!\nExpected file path:"<>input; } + savedgame.fill(setting.tag["saving"]); } bool game::set(string filename,string find){ ifstream fin; @@ -52,7 +53,7 @@ bool game::set(string filename,string find){ return true; } void end_with(string s){ - cout<>c; } @@ -62,25 +63,25 @@ unsigned short game::work(){ a=chunks[focusing].work(b,help_words); switch(a){ case 0:{ - end_with(lang.tag["win"]+'\n'+lang.tag["score"]+':'+tos(b)); + end_with(lang.search("win")+'\n'+lang.search("score")+':'+tos(b)); savedgame.tag[name]=tos(b); savedgame.save(setting.tag["saving"]); return 0; } - case 1:end_with(lang.tag["die-0"]);return 1; + case 1:end_with(lang.search("die-0"));return 1; case 4:return 4; } } return 0; } void menu(){ - cout<<"\033[92m"<>[ ]\033[2D"; + <<"1="<>[ ]\033[2D"; cin>>input; if(input=="0")exit(0); cls; @@ -95,23 +96,23 @@ void level_menu(){ while(true){ for(unsigned short i=1;i!=5;++i){ string te="1-"+tos(i); - cout<<"1-"<>[ ]\033[4D"; + cout<<"0 "<>[ ]\033[4D"; cin>>input; if(input=="0")return; if(all.set(setting.tag["level-data"],input)){ - all.help_words=lang.tag["help-"+input]; + all.help_words=lang.search("help-"+input); all.work(); cls; } else{ cls; - cout<<"\033[91m"<