d2jsp
Log InRegister
d2jsp Forums > Off-Topic > International > Magyar > Official /care Topic
Prev1424342444245424642475001Next
Closed New Topic New Poll
Member
Posts: 33,712
Joined: Jan 7 2007
Gold: 0.00
Nov 4 2012 01:13pm
Quote (Csabi @ 4 Nov 2012 20:11)
Code
#include <iostream>
using namespace std;
#include <ctime>
#include <cstdlib>
char jatekosLepes()
{
char jatekos = 'Q';
do
{
cout << "Üdvözöllek a Kő, Papír, Olló játékban." << endl;
cout << "Válassz eszközt: [K mint kő, P mint papír, O mint Olló, és X a kilépéshez]: " << endl;
cin >> jatekos;
cin.ignore(1000, 10);
if (jatekos == 'K' || jatekos == 'k' || jatekos == 'P' || jatekos == 'p' || jatekos == 'O' || jatekos == 'o');
if (jatekos == 'X' || jatekos == 'x') break;
{
return tolower(jatekos);
}
}
while (true);
}
char ellenfel()
{
int ellenfelValaszt = rand() % 3;
if (ellenfelValaszt == 0) return 'k';
else if (ellenfelValaszt == 1) return 'p';
return 'o';
}
int kiNyer (char jatekosValaszt,char ellenfelValaszt)
{
if (jatekosValaszt == 'K' || jatekosValaszt == 'k')
{
if (ellenfelValaszt == 'K' || ellenfelValaszt == 'k')
return 2;
else if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'P' || jatekosValaszt == 'p')
{
if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 2;
else if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'O' || jatekosValaszt =='o')
{
if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 2;
else if (jatekosValaszt == 'K' || ellenfelValaszt == 'k')
return 1;
else
return 0;
}
return 0;
}
int main()
{
srand(time(0));
char jatekos,ai;
int gyoztes;
jatekos = jatekosLepes();
ai= ellenfel();
cout << "A gép választ " << ai;
gyoztes = kiNyer(jatekos, ai);
if (kiNyer == 0)
cout << "Te nyertél!";
else if(kiNyer == 1)
cout << "Vesztettél.. ";
else
cout << "Döntetlen";
return 0;
}

ha valaki megszakeri h mi benne a hiba azt fgvel jutalmazom!


>ctrl+f
>harag
>no results
Megtaláltam a problémát.
Banned
Posts: 5,212
Joined: Jul 24 2012
Gold: Locked
Trader: Scammer
Nov 4 2012 01:13pm
mi az? feldobom piros leesik kék ? :)
Member
Posts: 14,316
Joined: May 8 2006
Gold: 3.03
Nov 4 2012 01:14pm
Quote (Csabi @ 4 Nov 2012 20:11)
Code
#include <iostream>
using namespace std;
#include <ctime>
#include <cstdlib>
char jatekosLepes()
{
char jatekos = 'Q';
do
{
cout << "Üdvözöllek a Kő, Papír, Olló játékban." << endl;
cout << "Válassz eszközt: [K mint kő, P mint papír, O mint Olló, és X a kilépéshez]: " << endl;
cin >> jatekos;
cin.ignore(1000, 10);
if (jatekos == 'K' || jatekos == 'k' || jatekos == 'P' || jatekos == 'p' || jatekos == 'O' || jatekos == 'o');
if (jatekos == 'X' || jatekos == 'x') break;
{
return tolower(jatekos);
}
}
while (true);
}
char ellenfel()
{
int ellenfelValaszt = rand() % 3;
if (ellenfelValaszt == 0) return 'k';
else if (ellenfelValaszt == 1) return 'p';
return 'o';
}
int kiNyer (char jatekosValaszt,char ellenfelValaszt)
{
if (jatekosValaszt == 'K' || jatekosValaszt == 'k')
{
if (ellenfelValaszt == 'K' || ellenfelValaszt == 'k')
return 2;
else if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'P' || jatekosValaszt == 'p')
{
if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 2;
else if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'O' || jatekosValaszt =='o')
{
if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 2;
else if (jatekosValaszt == 'K' || ellenfelValaszt == 'k')
return 1;
else
return 0;
}
return 0;
}
int main()
{
srand(time(0));
char jatekos,ai;
int gyoztes;
jatekos = jatekosLepes();
ai= ellenfel();
cout << "A gép választ " << ai;
gyoztes = kiNyer(jatekos, ai);
if (kiNyer == 0)
cout << "Te nyertél!";
else if(kiNyer == 1)
cout << "Vesztettél.. ";
else
cout << "Döntetlen";
return 0;
}

ha valaki megszakeri h mi benne a hiba azt fgvel jutalmazom!


túl sok benne a

>>> és <<< és aposztrófból sem kell ennyi. ;)
Member
Posts: 37,908
Joined: Apr 28 2009
Gold: 0.02
Nov 4 2012 01:14pm
Quote (asyouwish @ 4 Nov 2012 21:13)
mi az? feldobom piros leesik kék ? :)


anyád
Banned
Posts: 5,212
Joined: Jul 24 2012
Gold: Locked
Trader: Scammer
Nov 4 2012 01:15pm
hát dinnye
Member
Posts: 35,964
Joined: Dec 27 2007
Gold: 0.00
Nov 4 2012 01:15pm
Quote (Csabi @ Nov 4 2012 07:11pm)
Code
#include <iostream>
using namespace std;
#include <ctime>
#include <cstdlib>
char jatekosLepes()
{
char jatekos = 'Q';
do
{
cout << "Üdvözöllek a Kő, Papír, Olló játékban." << endl;
cout << "Válassz eszközt: [K mint kő, P mint papír, O mint Olló, és X a kilépéshez]: " << endl;
cin >> jatekos;
cin.ignore(1000, 10);
if (jatekos == 'K' || jatekos == 'k' || jatekos == 'P' || jatekos == 'p' || jatekos == 'O' || jatekos == 'o');
if (jatekos == 'X' || jatekos == 'x') break;
{
return tolower(jatekos);
}
}
while (true);
}
char ellenfel()
{
int ellenfelValaszt = rand() % 3;
if (ellenfelValaszt == 0) return 'k';
else if (ellenfelValaszt == 1) return 'p';
return 'o';
}
int kiNyer (char jatekosValaszt,char ellenfelValaszt)
{
if (jatekosValaszt == 'K' || jatekosValaszt == 'k')
{
if (ellenfelValaszt == 'K' || ellenfelValaszt == 'k')
return 2;
else if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'P' || jatekosValaszt == 'p')
{
if (ellenfelValaszt == 'P' || ellenfelValaszt == 'p')
return 2;
else if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 1;
else
return 0;
}
else if (jatekosValaszt == 'O' || jatekosValaszt =='o')
{
if (ellenfelValaszt == 'O' || ellenfelValaszt == 'o')
return 2;
else if (jatekosValaszt == 'K' || ellenfelValaszt == 'k')
return 1;
else
return 0;
}
return 0;
}
int main()
{
srand(time(0));
char jatekos,ai;
int gyoztes;
jatekos = jatekosLepes();
ai= ellenfel();
cout << "A gép választ " << ai;
gyoztes = kiNyer(jatekos, ai);
if (kiNyer == 0)
cout << "Te nyertél!";
else if(kiNyer == 1)
cout << "Vesztettél.. ";
else
cout << "Döntetlen";
return 0;
}

ha valaki megszakeri h mi benne a hiba azt fgvel jutalmazom!


nézem
Member
Posts: 33,712
Joined: Jan 7 2007
Gold: 0.00
Nov 4 2012 01:15pm
Quote (asyouwish @ 4 Nov 2012 20:15)
hát dinnye


Birthday: 16 Jan 1998 (Male)
Menj innen el.
Banned
Posts: 5,212
Joined: Jul 24 2012
Gold: Locked
Trader: Scammer
Nov 4 2012 01:16pm
én is de semmire nemjutok,én csak diablo 2 bot átírásához értek xD
Banned
Posts: 5,212
Joined: Jul 24 2012
Gold: Locked
Trader: Scammer
Nov 4 2012 01:16pm
Quote (Rawen @ Nov 4 2012 09:15pm)
Birthday: 16 Jan 1998 (Male)
Menj innen el.


te meg mit sírsz ? :)
Member
Posts: 37,908
Joined: Apr 28 2009
Gold: 0.02
Nov 4 2012 01:17pm
Code
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
int main()
{
   string playerName;
   char replay;
   int cpuPick, playerPick, gamesPlayed, win, loss;
   gamesPlayed = 0;
   win = 0;
   loss = 0;
   cout << "Hello player, please enter your name" << endl;
   cin >> playerName;
   cout << endl << "Welcome " << playerName << ", are you feeling lucky?" << endl;
   cout << "So we are going to play a game of Rock, Paper, Scissors." << endl;
   cout << "Are you ready to test your luck?" << endl << endl;
   restart:
   srand( time(0) );
   cpuPick = rand() % 3 + 1;
   cout << "Please select from the following:" << endl;
   cout << "1 - Rock" << endl;
   cout << "2 - Paper" << endl;
   cout << "3 - Scissors" << endl << endl;
   cout << "Please make your selection." << endl;
   cin >> playerPick;
   cout << endl <<"Lets see how you do." << endl;
   switch (cpuPick)
   {
       case 1:
           if ( playerPick == 1 )
           cout << "Rock and rock, nobody wins." << endl;
           cout << "Try again:" << endl;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 2 )
           cout << "Paper covers rock." << endl;
           cout << "Great job." << endl;
           win++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 3 )
           cout << "Scissors are crushed by rock." << endl;
           cout << "Maybe next time." << endl;
           loss++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
       case 2:
           if ( playerPick == 1 )
           cout << "Paper covers rock." << endl;
           cout << "Maybe next time." << endl;
           loss++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 2 )
           cout << "Paper and paper do nothing." << endl;
           cout << "Try again." << endl;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 3 )
           cout << "Scissors cut paper." << endl;
           cout << "Great job." << endl;
           win++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
       case 3:
           if ( playerPick == 1 )
           cout << "Rock breaks scissors." << endl;
           cout << "Great job." << endl;
           win++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 2 )
           cout << "Scissors cut paper." << endl;
           cout << "Maybe next time." << endl;
           loss++;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
           if ( playerPick == 3 )
           cout << "Scissors and scissors do nothing." << endl;
           cout << "Try again." << endl;
           gamesPlayed++;
           cout << "Want to play again? Press 'Y' or 'y' if you do." << endl << endl;
           cin >> replay;
           if (replay == 'Y' || replay == 'y')
           {
               system("CLS");
               goto restart;
           }
           else
           {
               system("CLS");
               cout << "You won " << win << " out of " << gamesPlayed << ". Thats great." << endl;
               cout << "And you only lost " << loss << " times." << endl;
               return(0);
           }
           break;
   }
}

vagy átirni ezt magyarra vagy kurvára mind1 csak legyen meg ez a szar es mukodjon :DD
Go Back To Magyar Topic List
Prev1424342444245424642475001Next
Closed New Topic New Poll