MM- Mohol by si poradit?
-> Mam script kde: (Hrac 1)Zadas nake jmeno, kteremu se po vlozeni prohodi pismenka a (Hrac 2) musi uhadnout o jake slovo jde.
-> Nevis jakym prikazem udelat to, aby se pri kazde volbe obnovila(smazala) obrazovka a text nezustaval stale videt v radkach?(takle od zacatku hrac 2 vidi vysledek.)
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
string melangerLettres(string mot)
{
string melange;
int position(0);
while (mot.size() != 0)
{
position = rand() % mot.size();
melange += mot[position];
mot.erase(position, 1);
}
}
int main()
{
string motMystere, motMelange, motUtilisateur;
srand(time(0));
cout << "Vlozte nejake slovo:";
cin >> motMystere;
motMelange = melangerLettres(motMystere);
do
{
cout << endl << "Co je to za slovo ? " << motMelange << endl;
cin >> motUtilisateur;
if (motUtilisateur == motMystere)
{
cout << "Bravo !" << endl;
}
else
{
cout << "Spatne !" << endl;
}
}while (motUtilisateur != motMystere); //opakovat
return 0;
}