Need help with C# semester project

Tarun

Intermediate
May 29, 2013
147
0
21
5híkàrpûr
Hey guys. My brother is doing CS and the project is need to be done in console application.

He needs to make a game or a simple application for this assignment, can you suggest me something that I can tell him?
 

ammarzubair

Perverted Gentleman
Feb 15, 2009
1,690
0
41
Karachi
If you give me that code. It would be awesome.
Code:
#include <iostream>#include <stdlib.h>
#include <conio.h>
using namespace std;


int main()
{
     char csq1('1');
     char csq2('2');
     char csq3('3');
     char csq4('4');
     char csq5('5');
     char csq6('6');
     char csq7('7');
     char csq8('8');
     char csq9('9');
     char cplmark;
     int turn(2);
	 int a(2);
     bool bgameover(true);


               cout << csq1 << "|" << csq2 << "|" << csq3 << endl;
               cout << "-+-+-" << endl;
               cout << csq4 << "|" << csq5 << "|" << csq6 << endl;
               cout << "-+-+-" << endl;
               cout << csq7 << "|" << csq8 << "|" << csq9 << endl;


     do
     {
          if(turn%2==0)
          {
                       cplmark='X';
          }
          else
          {
                       cplmark='O';
          }


          bool bvalidmove;
          do
          {


               bvalidmove= true;
               char cnextmove;
			   cout << endl << "Player" << (turn%2)+1 << "'s move:" << endl;
               cnextmove=getche();
               if(cnextmove=='1' && csq1=='1')
               {                 csq1=cplmark; }
               else if(cnextmove=='2' && csq2=='2')
               {                 csq2=cplmark; }
               else if(cnextmove=='3' && csq3=='3')
               {                 csq3=cplmark; }
               else if(cnextmove=='4' && csq4=='4')
               {                 csq4=cplmark; }
               else if(cnextmove=='5' && csq5=='5')
               {                 csq5=cplmark; }
               else if(cnextmove=='6' && csq6=='6')
               {                 csq6=cplmark; }
               else if(cnextmove=='7' && csq7=='7')
               {                 csq7=cplmark; }
               else if(cnextmove=='8' && csq8=='8')
               {                 csq8=cplmark; }
               else if(cnextmove=='9' && csq9=='9')
               {                 csq9=cplmark; }
               else
               {
                                 bvalidmove=false;
               }


               system("cls");
               cout << csq1 << "|" << csq2 << "|" << csq3 << endl;
               cout << "-+-+-" << endl;
               cout << csq4 << "|" << csq5 << "|" << csq6 << endl;
               cout << "-+-+-" << endl;
               cout << csq7 << "|" << csq8 << "|" << csq9 << endl;
               }
               while(!bvalidmove);


               bgameover= false;
               bool bwingame= true;


               if(csq1!='1')
               {
                            if(csq1==csq2 && csq2==csq3)
                            {             bgameover= true;  }
                            if(csq1==csq4 && csq4==csq7)
                            {             bgameover= true;  }
               }


               if(csq5!='5')
               {
                            if(csq1==csq5 && csq5==csq9)
                            {             bgameover= true;   }
                            if(csq3==csq5 && csq5==csq7)
                            {             bgameover= true;   }
                            if(csq2==csq5 && csq5==csq8)
                            {             bgameover= true;   }
                            if(csq4==csq5 && csq5==csq6)
                            {             bgameover= true;   }
               }


               if(csq9!='9')
               {
                            if(csq3==csq6 && csq6==csq9)
                            {             bgameover= true;   }
                            if(csq7==csq8 && csq8==csq9)
                            {             bgameover= true;   }
               }


               if (csq1 != '1' && csq2 != '2' && csq3 != '3' &&
               csq4 != '4' && csq5 != '5' && csq6 != '6' &&
               csq7 != '7' && csq8 != '8' && csq9 != '9' && !bgameover)
               {
                        bgameover = true;
                        bwingame = false;
               }


				if(bgameover)
				{
					if(bwingame)
					{
						cout << endl << "Player " << (turn%2)+1 << " WINS!!!" << endl;
					}
					else
					{
						cout << endl << "It's a TIE!!! " << endl;
					}




					cout << endl << "Game OVER!!" << endl;
					cout << endl << "Do you want to play again? (Y/N) " << endl;
					char cagain;
					cagain=getche();


					if(cagain=='Y' || cagain=='y')
					{
						bgameover= false;
						system("cls");
						csq1='1';
						csq2='2';
						csq3='3';
						csq4='4';
						csq5='5';
						csq6='6';
						csq7='7';
						csq8='8';
						csq9='9';
						cout << csq1 << "|" << csq2 << "|" << csq3 << endl;
						cout << "-+-+-" << endl;
						cout << csq4 << "|" << csq5 << "|" << csq6 << endl;
						cout << "-+-+-" << endl;
						cout << csq7 << "|" << csq8 << "|" << csq9 << endl;
						turn+=2;
					}
				}


				turn++;


				if(bgameover)
				{
					if(!bwingame)
					{
						a++;
						turn=a;
					}
				}
     }
     while(!bgameover);








     system("PAUSE");
     return EXIT_SUCCESS;
}
 

SohaibArif

Proficient
Apr 10, 2008
666
0
21
Karach,i Pakistan
A simple(just entering and searching data) database front end can easily be made in C#.
Took me less than 1 week from scratch, starting from C++ background(not knowing C#).
 
General chit-chat
Help Users
We have disabled traderscore and are working on a fix. There was a bug with the plugin | Click for Discord
  • No one is chatting at the moment.
    faraany3k faraany3k: I have heard that it is now unplayable in countries which do not support handful of third world...