Jump to content

ssjninja

Active Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by ssjninja

  1. i personaly think that my school shouldn't use turbo c++ because it sucks and it makes me barely ablle to read ur code but i know its most likely written better lol
  2. thanks the reason those includes are there its because our C++ teacher requires us to put all the includes we know how to use in a progam yea i know stupid
  3. well duh its not pro code i have only been programing for about 2 months or so
  4. hey guys i have been having some problems with this tic tac toe program im working on could u guys help me out the problem is taht player x wins randomly //Programed by viro //Email:***** //Release Date: //Description: #include <iostream.h> #include <conio.h>//used for clrscr() #include <iomanip.h> //used for setw() and other stuff like it #include <math.h> //used for all upper math functions #include <ctype.h> //used for conversion or mesurement of an char or string #include <fstream.h>// used for writing and opening data files #include <string.h> #include "matrix.h" //gobal variables // //prototypes // main() { char board[3][3] ; int row=0; int col=0; int z=0; int winner=0; char choice_x; char choice_o; clrscr(); board[0][0]=97; board[0][1]=98; board[0][2]=99; board[1][0] =100; board[1][1]=101; board[1][2] =102; board[2][0]=103; board[2][1]=104 ; board[2][2]=105; do { cout<< " Welcome To TicTacToe " << endl << "please enter the letter that is in the spot you would like to move" << " " << " ³" << " " << "³" << " " << endl << " "<< board[0][0] <<" " << "³" << " "<< board[0][1] <<" " << "³" << " "<< board[0][2] <<" " << endl << " ÄÄÄ" << "Å" << "ÄÄÄ" << "Å" << "ÄÄÄ" << endl << " " << "³" << " " << "³" << " " << endl; cout << " "<< board[1][0] <<" " << "³" << " "<< board[1][1] <<" " << "³" << " "<< board[1][2] <<" " << endl << " ÄÄÄ" << "Å" << "ÄÄÄ" << "Å" << "ÄÄÄ" << endl << " " << "³" << " " << "³" << " " << endl << " "<< board[2][0] <<" " << "³" << " "<< board[2][1] <<" " << "³" << " "<< board[2][2] <<" " << endl << "enter letter x : " ; cin >> choice_x; switch(choice_x) { case 'a': if (board[0][0]==97) { board[0][0]=88; z++; } break; case 'b': if (board[0][1]==98) { board[0][1]=88; z++; } break; case 'c': if (board[0][2]==99) { board[0][2]=88; z++; } break; case 'd': if (board[1][0]==100) { board[1][0]=88; z++; } break; case 'e': if (board[1][1]==101) { board[1][1]=88; z++; } break; case 'f': if (board[1][2]==102) { board[1][2]=88; z++; } break; case 'g': if (board[2][0]==103) { board[2][0]=88; z++; } break; case 'h': if (board[2][1]==104) { board[2][1]=88; z++; } break; case 'i': if (board[2][2]==88) { board[2][2]=88; z++; } break; default: cout <<"what part of letter do u not understand"; break; } cout<< " Welcome To TicTacToe " << endl << "please enter the letter that is in the spot you would like to move" << " " << " ³" << " " << "³" << " " << endl << " "<< board[0][0] <<" " << "³" << " "<< board[0][1] <<" " << "³" << " "<< board[0][2] <<" " << endl << " ÄÄÄ" << "Å" << "ÄÄÄ" << "Å" << "ÄÄÄ" << endl << " " << "³" << " " << "³" << " " << endl; cout << " "<< board[1][0] <<" " << "³" << " "<< board[1][1] <<" " << "³" << " "<< board[1][2] <<" " << endl << " ÄÄÄ" << "Å" << "ÄÄÄ" << "Å" << "ÄÄÄ" << endl << " " << "³" << " " << "³" << " " << endl << " "<< board[2][0] <<" " << "³" << " "<< board[2][1] <<" " << "³" << " "<< board[2][2] <<" " << endl << "enter letter O : " ; cin >> choice_o; switch(choice_o) { case ''a': if (board[0][0]==97) { board[0][0]=79; z++; } break; case ''b': if (board[0][1]==98) { board[0][1]=79; z++; } break; case 'c': if (board[0][2]==99) { board[0][2]=79; z++; } break; case 'd': if (board[1][0]==100) { board[1][0]=79; z++; } break; case ''e': if (board[1][1]==101) { board[1][1]=79; z++; } break; case 'f': if (board[1][2]==102) { board[1][2]=79; z++; } break; case 'g': if (board[2][0]==103) { board[2][0]=79; z++; } break; case 'h': if (board[2][1]==104) { board[2][1]=79; z++; } break; case 'i': if (board[2][2]==105) { board[2][2]=79; z++; } break; default: cout <<endl <<"what part of letter do u not understand"; break; } if(z==9) {cout <<endl<< "OMGS CATS!lawl!noob";} if(board[0][0]==79&&board[0][1]==79&&board[0][2]||board[0][0]==79&&board[1][0]==79&&board[2][0]==79||board[0][0]==79&&board[1][1]==79&&board[2][2]==79||board[0][1]==79&&board[1][1]==79&&board[2][1]==79||board[0][2]==79&&board[1][1]==79&&board[2][0]==79||board[0][2]==79&&board[1][2]==79&&board[2][2]==79||board[1][0]==79&&board[1][1]==79&&board[1][2]==79||board[2][0]==79&&board[2][1]==79&&board[2][2]==79) { cout << " player O wins"; winner++ ; } if(board[0][0]==88&&board[0][1]==88&&board[0][2]||board[0][0]==88&&board[1][0]==88&&board[2][0]==88||board[0][0]==88&&board[1][1]==88&&board[2][2]==88||board[0][1]==88&&board[1][1]==88&&board[2][1]==88||board[0][2]==88&&board[1][1]==88&&board[2][0]==88||board[0][2]==88&&board[1][2]==88&&board[2][2]==88||board[1][0]==88&&board[1][1]==88&&board[1][2]==88||board[2][0]==88&&board[2][1]==88&&board[2][2]==88) { cout << " player X wins"; winner++ ; } }while(z>9||winner==0); getch(); return 0; } // ³=alt179 Å=alt197 Ä=alt196
  5. ok heres the question i have a magnetic stripe reader(the swipe type) is there a way i could mod a a old cd drive to push out the swiper when i press the button and also it connects to the computer useing the standard keyboard port is there any way i could mod my pc to have it connect to the keyboard port without haveing it look llike crap?
×
×
  • Create New...