コンソールでC++で機能する迷路ゲームを作成しました。C++の迷路の数が通る時間
プレイヤーが迷路を通過するのに必要な時間をカウントする機能を追加したいと思います。
迷路を通過した後に合計時間を表示することができました。
本当にありがとうございました。しかし、基本的に
do {
show(); // function do display maze , 2d array
cout << "Your position: " << x << " " << y << endl;
cout << "Coins gained: " << coins << endl;
cout << "blahblahblah" : "<<endl;
m = getche();
cout << endl;
move(m); // function to recognize which way player want to go, including checking for not going through the wall
cout << endl;
system("CLS");
} while (x != 12 || y != 18 || coins < 10); //for pass the maze player have to move on these position and gain x coins
system("CLS");
cout << "You Won!" << endl;
cout << "Click enter to move on. \n";
あなたの投稿には、実際に何か助けが必要であるかについて明確ではありません。 _specific_質問や、あなたが助けが必要な特定のものがありますか? \ –
コンパイラがC++ 11をサポートしている場合は、 'std :: chrono'を起動する場所があります:http://en.cppreference.com/w/cpp/chrono – drescherjm