Search This Blog


My Works | Tic-Tac-Toe Game [Model]

Problem: We hope we are all known with the game Tic-Tac-Toe. Well..if we are not, we will be soon. You will not have to build any artificial intelligence for the game as the game will be played by two human, I mean users. Lets get into it.....

In a Tic Tac Toe game there will be a board with minimum 9 cells as follows.

Two player will have to select two different symbols to play with. Such as,

Player 1 taken '0'
Player 2 taken 'X'

Now they will put their symbols in the cells one at each turn. If a player become able to put 3 of his/her symbol in the cells on the board diagonally or horizontally or vertically then the player will be the winner.

Let us mark the cells of the above given picture as follows,

So some of the winning combinations are (1,2,3), (1,4,7), (1,5,9) etc. That is if a player can put his or her symbol in cells 1 and 2 and 3, the player will be the winner. Again if a player can put his or her symbol in cells 1 and 5 and 9, the player will be the winner. [Find out other winning combinations yourself]

Remember, one player can put his or her symbol only once in a turn.

Well, I think all of you are known with this game, so for this specific problem I advice you to download my program on this problem, to see what I was trying to explain at all. Just download and play.

This program will ask you to enter the name of the two players, then this will take you to the board where it will ask the player by given name to enter symbol. To enter symbol, you will have to press the cell number in which the player wants to put the symbol.

Initial Screen:

Next Screen:

Pressing "Y" to play again:

I wish all of you will like it. I am really sorry that I think, I didn't explain it well. I am weak at explaining things.

Happy Coding.

No comments:

Post a Comment

Leave your valuable thoughts before leaving..

More Recent Posts

They are following, won't you ! Follow now.

Al Topics

-- (FCFS) (RR) (SJF) #define directive #include #include directive ++ 8086 Micorprocessor 8086 microprocessor About HTML Absolute URL Ackerman Function advantages of user defined functions AIFF All LIST Tags AMV Android Application of OOP Arithmetic arithmetic and logic unit Arrays Assignment Audio File Types Audio Formats AX B Backslash character Basic Features Basic Features of OOP basic structure of C BIG Bill Gates Bill Gates Speech at Harvard University Bitwise BMP BODY BP BPS BR Breadth First Search BX C History C Language Categories of operators character set in C character test functions Character types characteristics POP Class Notes: C Programming Class Notes: Chemistry Class Notes: Data Strcuture Class Notes: Digital Image Processing Class Notes: Economics Class Notes: HTML Class Notes: Microprocessor and Computer Architecture Class Notes: OOP Class Notes: Physics I Class Notes: Software Engineering Class Notes: Theory of Computation compile time Compile time initialization compiling and running a C program flowchart Conditional conditions for variables Cons of POP counter controlled loop Counter controlled loop VS Sentinel controlled loop Creating Creating a web site CX Data types decision making declaration of one dimensional array declare a function in C declare a function in C Plus Plus decrement decrement operator Define Operating System Definition deleting Depth First Search DI different operators different type of constant different types of arrays discuss function call document different folder document of the web document same folder Documentation Domain name Domain name selection guidelines DPS draw multifunction program DX Dynamic arrays elements of user defined functions Else If Ladder Entry controlled loop Entry controlled loops VS Exit controlled loops evolutionary software process model Executable part Executing a C program Exit controlled loop Explain Explain and Solve explain function call explain function definition FCFS First Come First Served Floating point type flow chart of the process FONT FOR loop VS WHILE loop VS DO....WHILE Friend Function function function call function definition function nesting function parameters fundamental steps of digital image processing fundamental steps of DIP general registers GIF GIF File viewer Harvard University HEAD Heat & Thermodynamics HR HTML HTML Tags Hypertext I identifier IF Else statement IF statement Image Formats image processing with a neat block diagram IMG Increment increment operator information initialization of one dimensional array initialization of two dimensional array input output operations inserting Integer constants Integer types Interference & Diffraction internal architecture 8086 Internet IP address Isolated I/O J. K. Rowling J. K. Rowling at Harvard University J. K. Rowling Speech at Harvard University JPEG JPG keyword Like Password. Link Linked List Linking Links llop in C Local web page Logical Loop in Programming main () function managing I/O Matrix Problem Mecached Memcahce Memory Mapped I/O merging microprocessor MIDI MOV Movies and Videos MP3 MPEG multi-function program Multidimensional array multifunction program My Choice: Software My Diary My Games | HTML CSS JQuery My Movies: Horror My Poems My Tutorials | Blogspot My Tutorials | C++ My Tutorials | Java Script My Tutorials | Programming My Tutorials | Software My Tutorials | Visual Basic My Tutorials | Web My Works | Programs MySQL Database .NET MySQL Database VB MySQL Database VB.NET mysql with necessity of website Nested If Else Statement nesting of functions Object Oriented Programming One dimensional array OOP Operating System Concepts Operator Organizing OS OS Scheduling P pass by reference Pass by value Pass object to function Password Technique Pattern Pattern Password Technique Performance personal website Photo Viewer Picture Formats Picture Game Picture Puzzle Picture Puzzle Game Planning PNG POP POP programming PRE preprocessor Priority Scheduling Problems of POP Procedural programming Procedure Oriented Programming program Programming Languages Pros and cons of POP Publicizing Publishing Queue RAW Re-test or updating Real constants recursion recursive Relational Relative URLs Remote web page Round Robin RR rules for identifier rules to create a domain name run time Run time initialization S scanf format codes Scheduling search engine procedure Search Engines Search Engines vs Web Directories searching sentinel controlled loop server sever Short Questions Shortest Job Shortest Job First SI Simulation Simulation Viewer Simulation Viewer Software Single character constants SJF Slow Slow Speed Slow Website SMALL small business website software process model Solutions to problems of POP Solve sorting SP Special Speed Up Stack Stanford University statements used in C Static arrays Steps of looping process Steve Jobs Steve Jobs at Stanford University Steve Jobs Speech at Stanford University String STRONG structure of C programming SUB Subprogram section SUP syntax rules or grammar and syntax errors. tags Testing TITLE traversing Trees TT Two dimensional array types of arrays U URL user defined functions Using MySQL Using MySQL Database with Visual Basic variables Video File Types Video Formats Visual Basic .NET Visual Basic .NET 2010 Void types WAV Waves and Oscillation web browser Web Directories Web page web site What is constant What is friend function What is HTML What is link What is operating system what is recursion What is user defined functions Why search engine created Why we need search engines. why website Windows Photo Viewer WMA WMV World Wide Web WWW