Ich habe funktionierendes Labyrinth-Spiel in C++ in der Konsole erstellt.C++ maze count passing time
Ich möchte Funktion hinzufügen, um Zeit zu zählen, die benötigt wird, um das Labyrinth nach Spieler zu übergeben.
Gesamtzeit kann nach dem Labyrinth angezeigt werden.
Ich würde wirklich jede Hilfe oder Ideen schätzen. obwohl
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";
Ihr Beitrag ist nicht klar, auf was Sie eigentlich Hilfe brauchen. Haben Sie eine _spezielle_ Frage oder etwas _spezifisches_ benötigen Sie Hilfe? \ –
Wenn Ihr Compiler C++ unterstützt 11 'std :: chrono' wäre der Ort zu starten: http://en.cppreference.com/w/cpp/chrono – drescherjm