Jump to content

So many languages!!!


PrateekSaxena

Recommended Posts

I know around 8 programming languages and when I am writing in a language that is relatively new to me(PHP) I start writing some other languag's syntax. Does this happen to you too?? How do you solve this problem?

Link to comment
Share on other sites

Same amount of languages for me! About.. But no that hasnt happened, I guess you will start getting to know the language you are learning and stop writing in another languages syntax X-D.

Link to comment
Share on other sites

He he...what a co-incidence...which ones do you know??I hope that i stop...coz there is no way i can find out my PHP errors Firbug does not point them out either

Link to comment
Share on other sites

I know 8 programming languages (C#,VB,C++,PERL,PHP,JavaScript,Java,TSQL). I don't consider HTML or CSS a programming language (because their not :)) and ASP and ASP.Net are written in C# or VB and JSP is written in Java so they really aren't seperate languages just defferent implementations of the same languages (although i definately list them as so on a resume :)).There is really only 4 I use regularly (weekly) (C#,TSQL,JavaScript, PHP) and there syntax is so similar there really isn't much to mix up except when it comes to OOP that is :)

Link to comment
Share on other sites

Firebug :). Actually if it is an error that is in the syntax in php then you can simply turn errors on, *calls steve*. I know XHTML, CSS, JavaScript, PHP, MySQL, some Java, and some Python.

Link to comment
Share on other sites

I'll admit that it happens to me. I can't tell you how many times I stick a semi-colon - ; - at the end of a line of VB. It drives me crazy. Also, when switching from C# to javascript, I'll occasionally try to use "foreach" rather than "for" and I'll also declare the variables as "string", "int", "float", "bool", etc. rather than "var". It usually only makes me stumble for about 2 seconds and then I'm past it, but the problem is there.

Link to comment
Share on other sites

I'll admit that it happens to me. I can't tell you how many times I stick a semi-colon - ; - at the end of a line of VB. It drives me crazy. Also, when switching from C# to javascript, I'll occasionally try to use "foreach" rather than "for" and I'll also declare the variables as "string", "int", "float", "bool", etc. rather than "var". It usually only makes me stumble for about 2 seconds and then I'm past it, but the problem is there.
now that you mention it I am forever declareing int i = 0; in javascript instead of var i = 0;The biggest problem I have is forgetting the $ in front of PHP variables.
Link to comment
Share on other sites

I have no such problem...
That is good for you!
I know 8 programming languages (C#,VB,C++,PERL,PHP,JavaScript,Java,TSQL). I don't consider HTML or CSS a programming language (because their not :)) and ASP and ASP.Net are written in C# or VB and JSP is written in Java so they really aren't seperate languages just defferent implementations of the same languages (although i definately list them as so on a resume :)).There is really only 4 I use regularly (weekly) (C#,TSQL,JavaScript, PHP) and there syntax is so similar there really isn't much to mix up except when it comes to OOP that is :)
Well! When I wrote down ten I included HTML and CSS, after all they are markup languages
Firebug :blink:. Actually if it is an error that is in the syntax in php then you can simply turn errors on, *calls steve*. I know XHTML, CSS, JavaScript, PHP, MySQL, some Java, and some Python.
How do I turn on errors??? What is *call steve* suppose mean?? I kinda did not understand!!!
Have the same porblem but reverse to jesh's case, trying to shift from VB.NET to C#, I never end with ; and always forget to use {} to start/end functions....
the ";" thing happens to me a lotI know the following langs -
  • QBASIC
  • C++
  • Visual Basic
  • VJ++
  • HTML
  • CSS
  • JavaScript
  • PHP

Link to comment
Share on other sites

Prateek, where did you learn C++?I've been trying to learn it for a while, and I never get the chance to go to the library and borrow books about it, but do you know the code for making it go fullscreen, instead of the dos box?

Link to comment
Share on other sites

Nope I dont I learnt it just like that...i used it last around 1.5 years ago to make ping pong game just like that :)

Link to comment
Share on other sites

Whoa! That's a long time for a game like that, hehe.I just found a .zip folder with Pacman, hehe. I'm trying to figure out stuff from the code, like how they got pictures in, how they got it going at fullscreen, buttons and more. It'll take a really long time, though.But yes, there are a lot of languages threadstarter :)

Link to comment
Share on other sites

How do I turn on errors???
ini_set("display_errors", 1);error_reporting(E_ALL);
do you know the code for making it go fullscreen, instead of the dos box?
Look into MFC for Windows. I'm not sure if MFC is still in use or not, newer languages like C# abstract a lot of that out. But the MFC libraries were useful in C++ to make Windows applications. A Windows GUI application is built totally different then a console application that runs in a DOS environment.
Link to comment
Share on other sites

I learned C++ by myself using mainly Shift+F1(Help Shortcut)I made Ping Pong because at that time I did not have a computer that could support any games, and I did not have any games CD as well, so I had to program a game to actually play it. I programmed many games in C++ some similar to Brick Breaker, Para Trooper and Mario kind of games!

Link to comment
Share on other sites

I learned C++ by myself using mainly Shift+F1(Help Shortcut)I made Ping Pong because at that time I did not have a computer that could support any games, and I did not have any games CD as well, so I had to program a game to actually play it. I programmed many games in C++ some similar to Brick Breaker, Para Trooper and Mario kind of games!
Do you still have the source code kicking around? It would be nice if you were willing to share it. What did you use for graphics? OpenGL, the built in Windows graphics?
Link to comment
Share on other sites

ha ha ha..openGL that is really funny...these kind of stupid games do not need such advance graphicsI used the graphics the are in C++initgraph()REMBMER??

Link to comment
Share on other sites

actually no, I have only written console apps with C++ or used the GUI of Visual Studio. I am studying OpenGL now. Would you mind sharing some of your code, it would be a big help.

Link to comment
Share on other sites

Hmm...I am not using OpenGL and I think that my code wont help you out cause at that time I used to write really messed up code. I am currently on my sister's laptop and when I come online through my desktop, I will try to find HangMan, ParaTrooper, and Pong in VJ++ or C++. I am not sure if I would have them or not cause while switching computers, I deleted a lot of crappy data. I have made a single player Tic Tac Toe in JS and Poing POng in JS too. But thet are not HTML files but .kon(Konfabulator)(Yahoo Widget Files) You can see the widgets of Tic Tac Toe and Pong.Pong38655-chit.pngThis is an old but captivating game for all ages. One of the first arcade games is now on your desktop with the original controls.It is a good break from work - try it out.[[Details]]Tic Tac Toe38538-chit.pngHere is the popular Tic Tac Toe game, packed with some artificial intelligence. It can keep you glued for quite some time. A good break from work - try it out.[[Detais]]

Link to comment
Share on other sites

Here is the HangMan code -

/*HEADER FILES*/#include <iostream.h>#include <fstream.h>#include <process.h>#include <conio.h>#include <stdlib.h>#include <ctype.h>#include <graphics.h>#include <string.h>#include <dos.h>void BACKGROUND(int color) //The function that makes the background of the interface each time{ setfillstyle(11,color);//This sets the color as well as the texture of the background bar(0,0,1300,1300);     //This makes a bar from the top most corner to the end of the screen}void DRAW_BOX(int x1,int y1,int x2,int y2,int color){ setcolor(color);//This sets the color of the boundary as given by the user rectangle(x1,y1,x2,y2);//This makes a rectangle rectangle(x1+1,y1+1,x2-1,y2-1);//This makes a rectangle smaller than the other one so as to make a border setfillstyle(1,0);//It sets the fill style as black bar(x1+2,y1+2,x2-2,y2-2);//It makes a black box in whic one can write.}/*CLASS HANGMAN AND ITS FUNCTIONS*/class HANGMAN{ private:  char file[10000];  int score;  int nofg;  int ltbg;  int i, now, flag, c, k,u;  char word[50], g;  int wrg;  char gsf[50];  char guess[50]; public:  void ARENA();  void LOST();  void WON();  void READ_FILE();  void PLAY();  void SHOW_BODY(int);}game;void HANGMAN::WON(){ delay(1000); BACKGROUND(4); DRAW_BOX(120,100,500,200,4); gotoxy(35,10); cout<<"YOU WON!"; delay(5000);}void HANGMAN::LOST(){ delay(1000); BACKGROUND(4); DRAW_BOX(120,100,500,200,4); gotoxy(35,10); cout<<"YOU LOST!"; gotoxy(20,11); cout<<"and the word to be guessed was "<<word; delay(5000);}void HANGMAN::SHOW_BODY(int part){ switch (part) { case 1:  gotoxy(73,8);  cout<<"0";  break; case 2:  gotoxy(72,9);  cout<<"\\";  break; case 3:  gotoxy(73,9);  cout<<"|";  break; case 4:  gotoxy(74,9);  cout<<"/";  break; case 6:  gotoxy(72,11);  cout<<"/";  break; case 7:  gotoxy(74,11);  cout<<"\\";  break; } if (part==5) {  gotoxy(73,10);  cout<<"|"; }}void HANGMAN::ARENA(){ i=now=flag=score=ltbg=c=k=u=wrg=0; gotoxy(1,1); BACKGROUND(4); DRAW_BOX(450,70,620,220,4); for(int j=0;j<50;j++) {  word[j]='\';  guess[j]='\';  gsf[j]='\'; } while(file[i]!='\') {  if(file[i]==' ' && file[i+1]!='\')  {   now++;  }  i++; } now++; randomize(); int r=random(now); i=now=0; while(file[i]!='\') {  if(now==r)  {   word[c]=file[i];   c++;  }  if(file[i]==' ')  {   if (flag==1)   {    break;   }   now++;  }  i++; } u=c; word[c-1]='\'; c=c-2; DRAW_BOX(480,400,610,450,4); gotoxy(63,27); cout<<"Score: "; DRAW_BOX(20,250,620,330,4);  //FOR ENTERING THE LETTER DRAW_BOX(70,85,150,120,4);   //FOR CLUE HEADING gotoxy(11,7); cout<<"CLUE  ->"; DRAW_BOX(195,85,380,120,4);  //FOR CLUE, I.E BLANKS int counter=0; gotoxy(27,7); for(i=0;i<=c;i++) {  char curr;  curr=toupper(word[i]);  if(curr=='A'|| curr=='E' || curr=='I' || curr=='O' || curr=='U')  {   cout<<curr<<"";   gsf[counter]=curr;   counter++;  }  else  {   cout<<"_";   ltbg++;   gsf[counter]='_';   counter++;   guess[k]=curr;   k++;  } } gotoxy(1,1); nofg=k; gotoxy(60,7); cout<<"--------------"; gotoxy(60,8); cout<<"|            "; gotoxy(60,9); cout<<"|           "; gotoxy(60,10); cout<<"|            "; gotoxy(60,11); cout<<"|           "; gotoxy(60,12); cout<<"|"; gotoxy(60,13); cout<<"=========="; PLAY();}void HANGMAN::PLAY(){ char g; int guessed=0; gotoxy(7,18); g='\'; int wr=0,r=0; while(wrg<7 && ltbg!=guessed) {  wr=0;  r=0;  gotoxy(7,18);  cout<<"Guess a letter:";  gotoxy(23,18);  g=getch();  cout<<g;  for(int i=0;i<=u;i++)  {   char did;   did=toupper(g);   char curr;   if(did==word[i] && (did!='A'&& did!='E' && did!='I' && did!='O' && did!='U'))   {    gsf[i]=did;    gotoxy(27,7);    cout<<"                ";    gotoxy(27,7);    cout<<gsf;    gotoxy(1,1);    guessed++;    score+=10;    r=1;   }   else   {    if(did!='A'&& did!='E' && did!='I' && did!='O' && did!='U')    {     wr=1;    }   }  }  if (wr==1 && r==0)  {   wrg++;   score-=5;   SHOW_BODY(wrg);  }  gotoxy(70,27);  cout<<" "<<score<<" "; } if (ltbg==guessed) {  WON(); } else {  LOST(); }}void HANGMAN::READ_FILE(){ ifstream words("words.txt"); file[10000]; char j; int counter=0; while(words!='\') {  words.get(j);  cout<<j;  file[counter]=j;  counter++; } words.close(); ARENA();}/*THE CLASS INTERFACE AND ITS FUNCTIONS*/class INTERFACE{ private:  int menuChoice; public:  void INTRO(void);//This is the introduction page.  void MAIN_MENU(void);//This function has the main menu  void PLAY();  void HISCORE();  void HELP();  void QUIT();}menu;void INTERFACE::MAIN_MENU(){ BACKGROUND(1); DRAW_BOX(235,10,400,35,1); //To draw the box for putting main menu heading gotoxy(33,2); cout<<"<< MAIN MENU >>"; DRAW_BOX(170,90,470,240,1); gotoxy(34,8); cout<<"1: PLAY GAME"; gotoxy(34,10); cout<<"2: HELP"; gotoxy(34,12); cout<<"3: QUIT"; DRAW_BOX(170,260,470,330,1); gotoxy(27,18); cout<<"Enter your choice : "; menuChoice='\'; gotoxy(47,18); cin>>menuChoice; if(menuChoice>3 || menuChoice<1) {   gotoxy(27,20);   cout<<"Invalid Input\a";   delay(1000);   MAIN_MENU(); } switch(menuChoice) {  case 3:   QUIT();   break;  case 2:   HELP();   break;  case 1:   game.READ_FILE();   break; } MAIN_MENU();}void INTERFACE::INTRO(void){ BACKGROUND(1);//This sets the background with a blue color DRAW_BOX(100,40,540,280,1);//This draws the box where the title is written gotoxy(24,10); cout<<"<<<<<<<<<<<< HANGMAN >>>>>>>>>>>>"; DRAW_BOX(450,370,610,450,1); gotoxy(59,25); cout<<"Developed by-"; gotoxy(59,26); cout<<"Pooja Saxena &"; gotoxy(59,27); cout<<"Krishanu Mathur"; delay(2000);  //To delay the main menu screen for 2sec approx. MAIN_MENU();}void INTERFACE::QUIT(){ BACKGROUND(1);//This sets the background with a blue color DRAW_BOX(100,40,540,280,1);//This draws the box where the title is written gotoxy(30,9); cout<<"Thank You for playing"; gotoxy(37,11); cout<<"HANGMAN"; delay(2000); exit(0);}void INTERFACE::HELP(){ BACKGROUND(1); DRAW_BOX(235,10,400,35,1); //To draw the box for putting help heading gotoxy(36,2); cout<<"<< HELP >>"; DRAW_BOX(120,90,520,280,1); gotoxy(17,7); cout<<"Hangman is a game where you try to guess a "; gotoxy(17,8); cout<<"word one letter at time. Initially the player is"; gotoxy(17,9); cout<<"shown a pattern with only the vowels and a '_'"; gotoxy(17,10); cout<<"at the other places. Each time you guess a wrong"; gotoxy(17,11); cout<<"letter one part of the persons body appears.Like"; gotoxy(17,12); cout<<"so first the head then the hands then the upper"; gotoxy(17,13); cout<<"torso then the lower torso and finally the legs"; gotoxy(17,14); cout<<"appear on the screen after every wrong guess."; gotoxy(17,15); cout<<"The aim of the game is to guess the word shown"; gotoxy(17,16); cout<<"before the man fully apeears on the screen and"; gotoxy(17,17); cout<<"is hung at the gallows."; getch();}/*MAIN*/void main(void){ clrscr(); int gdriver=DETECT,gmode; 	//This is to initialize the graphics. initgraph(&gdriver, &gmode, "c:\\tc\\bgi");//This is the to open the graph in which we will draw. menu.INTRO(); getch();//This is to get a character before closing the graph. closegraph();//This is to close the graph.}// gotoxy(60,7);// cout<<"--------------";// gotoxy(60,8);// cout<<"|            O";// gotoxy(60,9);// cout<<"|           \\|/";// gotoxy(60,10);// cout<<"|            |";// gotoxy(60,11);// cout<<"|           / \\ ";// gotoxy(60,12);// cout<<"|";// gotoxy(60,13);// cout<<"==========";

Link to comment
Share on other sites

This is a hangman that has sort of an AI and it learns as it plays with you --

#include<fstream.h>#include<conio.h>#include <graphics.h>#include <stdlib.h>struct game_data{int who[10];int where[10];};int winc=1,losec=1,tiec=1;game_data current;game_data win[100];game_data lose[100];game_data tie[100];int game=1;void chck(int c1,int c2,int c3,int c4,int c5,int c6,int c7,int c8,int c9,int who){	if((c1==1 && c2==1 && c3==1)||(c4==1 && c5==1 && c6==1)||(c7==1 && c8==1 && c9==1)||(c1==1 && c4==1 && c7==1)||(c2==1 && c5==1 && c8==1)||(c3==1 && c6==1 && c9==1)||(c1==1 && c5==1 && c9==1)||(c3==1 && c5==1 && c7==1)){		gotoxy(30,1);		if (who==1){			cout<<"X has won!";			lose[losec]=current;			losec++;		}else{			cout<<"The human has won";			lose[losec]=current;			losec++;		}		c1=0;		game=0;	}	if((c1==2 && c2==2 && c3==2)||(c4==2 && c5==2 && c6==2)||(c7==2 && c8==2 && c9==2)||(c1==2 && c4==2 && c7==2)||(c2==2 && c5==2 && c8==2)||(c3==2 && c6==2 && c9==2)||(c1==2 && c5==2 && c9==2)||(c3==2 && c5==2 && c7==2)){		gotoxy(30,1);		if(who==1){			cout<<"O has won!";			win[winc]=current;			winc++;		}else{			cout<<"The computer has won!";			win[winc]=current;			winc++;		}		c1=0;		game=0;	}	if (c1!=0 && c2!=0 && c3 !=0 && c4!=0 && c5!=0 && c6!=0 && c7!=0 && c8!=0 && c9!=0){		gotoxy(30,1);		cout<<"Cat's game";		tie[tiec]=current;		tiec++;		game=0;	}}void makeboard(){	setcolor(BLUE);	rectangle(1,1,100,100);//1	rectangle(100,1,200,100);//2	rectangle(200,1,300,100);//3	rectangle(1,100,100,200);//4	rectangle(100,100,200,200);//5	rectangle(200,100,300,200);//6	rectangle(1,200,100,300);//7	rectangle(100,200,200,300);//8	rectangle(200,200,300,300);//9}void x(int pos){	setcolor(RED);	switch(pos){	case 1:		line(10,10,90,90);		line(90,10,10,90);	break;	case 2:		line(110,10,190,90);		line(190,10,110,90);	break;	case 3:		line(210,10,290,90);		line(210,90,290,10);	break;	case 4:		line(10,110,90,190);		line(90,110,10,190);		break;	case 5:		line(110,110,190,190);		line(110,190,190,110);		break;	case 6:		line(210,110,290,190);		line(210,190,290,110);		break;	case 7:		line(10,210,90,290);		line(10,290,90,210);		break;	case 8:		line(110,210,190,290);		line(110,290,190,210);		break;	case 9:		line(210,210,290,290);		line(210,290,290,210);	}}void o(int pos){	switch(pos){	case 1:		setcolor(RED);		circle(50,50,40);		break;	case 2:		setcolor(RED);		circle(150,50,40);		break;	case 3:		setcolor(RED);		circle(250,50,40);		break;	case 4:		setcolor(RED);		circle(50,150,40);		break;	case 5:		setcolor(RED);		circle(150,150,40);		break;	case 6:		setcolor(RED);		circle(250,150,40);		break;	case 7:		setcolor(RED);		circle(50,250,40);		break;	case 8:		setcolor(RED);		circle(150,250,40);		break;	case 9:		setcolor(RED);		circle(250,250,40);		break;	}}void ps(int pos){	setcolor(WHITE);	switch(pos){	case 1 :		rectangle(1,1,100,100);		break;	case 2:		rectangle(100,1,200,100);		break;	case 3:		rectangle(200,1,300,100);		break;	case 4:		rectangle(1,100,100,200);		break;	case 5:		rectangle(100,100,200,200);		break;	case 6:		rectangle(200,100,300,200);		break;	case 7:		rectangle(1,200,100,300);		break;	case 8:		rectangle(100,200,200,300);		break;	case 9:		rectangle(200,200,300,300);		break;	}}void playone(){	setfillstyle(1,BLACK);	bar(0,0,700,700);	makeboard();	int ch=1,temp=0;	char ans;	game=1;	int y,pos=1;	int chnc=1;	int taken[19]={0,0,0,0,0,0,0,0,0,0,0,0,0};	while (y!=27 && game==1){		if (chnc%2==0){			ans=getch();			y=ans;		}		switch(y){		case 72:			if(pos!=1 && pos!=2 && pos!=3){				pos=pos-3;			}			break;		case 80:			if(pos!=7 && pos!=8 && pos!=9){				pos=pos+3;			}			break;		case 77:			if (pos!=9){				pos++;			}			break;		case 75:			if (pos!=1){				pos--;			}			break;		case 32:			if ( taken[pos]!=1 && taken[pos]!=2 && chnc%2==0){				x(pos);				taken[pos]=1;				current.who[chnc]=1;				current.where[chnc]=pos;				chnc++;			}			break;		}		int c;		if (chnc%2!=0){			int w=0,t=0;			for(int i=1;i<=winc;i++){				int c=0;				for(int j=1;j<chnc;j++){					if(win[i].who[j]!=current.where[j] && win[i].where[j]!=current.where[j]){						c=1;					}				}				if (c==0 && taken[win[i].where[chnc]]!=1 && taken[win[i].where[j]]!=2){					ps(win[i].where[chnc]);					pos=win[i].where[chnc];					taken[win[i].where[chnc]]=2;					o(win[i].where[chnc]);					current.who[chnc]=2;					current.where[chnc]=pos;					chnc++;					i=winc+3;					w=1;				}			}			if(w!=1){				for(int i=1;i<=tiec;i++){					int c=1;					for (int j=1;j<chnc;j++){						if(tie[i].who[j]!=current.who[j] && tie[i].where[j]!=current.where[j]){							c=0;						}					}					if (c==1 && taken[tie[i].where[chnc]]!=1 && taken[tie[i].where[chnc]]!=2){						pos=tie[i].where[chnc];						taken[pos]=2;						o(pos);						ps(pos);						current.who[chnc]=2;						current.where[chnc]=pos;						chnc++;						i=tiec+4;						t=1;					}				}			}			if(t!=1 && w!=1){				randomize();				int rnd=rand()%9;				if(rnd==0){					rnd=9;				}				pos=rnd;				ps(pos);				if(taken[pos]!=1 && taken[pos]!=2){					taken[pos]=2;					o(pos);					current.who[chnc]=2;					current.where[chnc]=pos;					chnc++;				}			}		}		makeboard();		ps(pos);		gotoxy(1,20);		chck(taken[1],taken[2],taken[3],taken[4],taken[5],taken[6],taken[7],taken[8],taken[9],0);	}}void playtwo(){	setfillstyle(1,BLACK);	bar(0,0,700,700);	makeboard();	int ch=1,temp=0;	char ans;	game=1;	int y,pos=1;	win[1].who[1]=1;	win[1].who[2]=2;	win[1].who[3]=1;	win[1].who[4]=2;	win[1].who[5]=1;	win[1].who[6]=2;	win[1].who[7]=1;	win[1].who[8]=2;	win[1].who[9]=1;	win[1].where[1]=1;	win[1].where[2]=2;	win[1].where[3]=3;	win[1].where[4]=4;	win[1].where[5]=5;	win[1].where[6]=6;	win[1].where[7]=7;	win[1].where[8]=8;	win[1].where[9]=9;	winc++;	int chnc=1;	int taken[19]={0,0,0,0,0,0,0,0,0,0,0,0,0};	while (y!=27 && game==1){		ans=getch();		y=ans;		switch(y){		case 72:			if(pos!=1 && pos!=2 && pos!=3){				pos=pos-3;			}			break;		case 80:			if(pos!=7 && pos!=8 && pos!=9){				pos=pos+3;			}			break;		case 77:			if (pos!=9){				pos++;			}			break;		case 75:			if (pos!=1){				pos--;			}			break;		case 32:			if ( taken[pos]!=1 && taken[pos]!=2 && chnc%2==0){				x(pos);				taken[pos]=1;				current.who[chnc]=1;				current.where[chnc]=pos;				chnc++;			}			else if (taken[pos]!=1 && taken[pos]!=2 && chnc%2!=0){				o(pos);				taken[pos]=2;				current.who[chnc]=2;				current.where[chnc]=pos;				chnc++;			}			break;		}		makeboard();		ps(pos);		chck(taken[1],taken[2],taken[3],taken[4],taken[5],taken[6],taken[7],taken[8],taken[9],1);	}}void reset(){	game=1;	for (int i=0;i<=10;i++){		current.who[i]=0;		current.where[i]=0;	}}void main(){	main:	int gdriver=DETECT,gmode;	initgraph(&gdriver, &gmode, "c:\\tc");	setcolor(BLUE);	gotoxy(1,1);	cout<<"1.One player.";	cout<<"\n2.Two player.";	int choice;	cout<<"\nEnter the choice from the above menu : ";	cin>>choice;	if (choice==1){		playone();	}else if(choice==2){		playtwo();	}	  getch();	closegraph();	cout<<"Do you wan't to play again?";	char ans;	cin>>ans;	if (ans=='y'){		reset();		goto main;	}	getch();}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...