Questions tagged [tic-tac-toe]
A game, also known as "Noughts and Crosses", in which players take turns placing marks on a 3 × 3 grid in an attempt to form a line of three consecutive marks. You can also use this tag for variants of the game.
636
questions
15
votes
5
answers
19k
views
Tic Tac Toe game in Java OOP
I have written a simple GUI Tic Tac Toe Application and since this is my first shot, I think it can be improved a lot.
Please tell me what you think about it and what you see I made wrong so I can ...
10
votes
2
answers
3k
views
OO design for Tic Tac Toe program
I am practicing object oriented design and have taken Tic Tac Toe as an example. I have written first all the requirements and then started writing code. I would like to get it reviewed so that I can ...
0
votes
1
answer
55
views
Cleaning up a class that contains the object it represents [closed]
I've recently started writing a tic-tac-toe game (following the Odin project) and am trying to write a class to hold the board game.
What I'm not sure about, is that the board class holds all the ...
5
votes
3
answers
1k
views
Making this Tic Tac Toe implementation more recursive
Here is a Tic Tac Toe game in C++ that I have been working on. My questions are as follows:
I tested it for bugs, but if you find any, please post the solution!
I want to make the code more recursive,...
17
votes
1
answer
1k
views
Tic-tac-toe in SQL with optimal AI
The simplest introduction to this code is to play it! Here's an SQL Fiddle. However, to enjoy it fully, you'll need a more interactive environment, like the psql ...
10
votes
1
answer
5k
views
SQL Tic-Tac-Toe attempt
In an attempt to practice conditional statements in SQL I decided to design a tic-tac-toe game with MySQL. Let me know if you think any of the steps could be done better.
Step 1: Create the game ...
7
votes
2
answers
526
views
Optimizing this inefficient TicTacToe configuration parser
On a programming contest I came upon this question:
Given a partially played 3 × 3 tic-tac-toe configuration, write a program to determine which player will have a better chance of winning if the ...
8
votes
1
answer
3k
views
Tic Tac Toe (2 players)
So here we have a little game of Tic Tac Toe I've made. It runs well on TI-83/84 calculators and it doesn't seem to have any problems. However, I'd like to eliminate some of the code that seems bulky ...
26
votes
5
answers
29k
views
Non-AI Tic-Tac-Toe program
I'm fairly new to C++ and to game programming itself. Today I decided to build a multiplayer Tic Tac Toe program using only elemental C++ syntax/data structures. I also implemented a text interface ...
7
votes
2
answers
2k
views
Checking for a win in TicTacToe
It looks like it should be shortened but I can't see how.
I have my methods <= 5 lines but that's as far as I got:
...
7
votes
3
answers
8k
views
Tic Tac Toe in C++
Here is my two-player Tic Tac Toe game. How can I improve it?
...
10
votes
3
answers
852
views
Conditionals validation for Tic Tac Toe
I have been working with Java for a little more than a year. I recently have built a Tic Tac Toe game as an assignment for my Java class. After my instructor graded it, he wrote a comment around my ...
20
votes
3
answers
4k
views
Recursive and flexible approach to Tic-Tac-Toe
Description
This is my code for the Weekend Challenge Reboot - Tic Tac Toe Ultimate.
The game can be played here: http://www.zomis.net/ttt (along with some other variations that are also use the ...
2
votes
1
answer
5k
views
Turning 1D array to 2D array in TicTacToe
To check a win in my TicTacToe game, I have created a 2D array that contains all the combination that a game can be won in, like so:
...
22
votes
5
answers
13k
views
Tic Tac Toe computer AI
I am creating a TicTacToe game for my college project, and when I finished the code for computer AI, I ended up with a big chunk of code.
It allows the computer to make the winning move, stopping the ...
39
votes
4
answers
8k
views
Ultimate Tic-Tac-Toe in C
Here is my attempt at the UTTT code-challenge (in response to the the Weekend-Challenge Reboot). Here is what I would like critiqued:
I tested the code a few times for bugs, but I may have missed ...
12
votes
3
answers
18k
views
4×4 Tic-Tac-Toe in C
While trying to teach myself C, I decided to take a stab at writing this Tic-Tac-Toe program on a 4x4 board. It will be great if somebody could review it and let me know of some ways of refining this.
...
14
votes
4
answers
758
views
Tic-Tactics implementation
I've tried to take the shortest, simplest path to a C# solution to the Ultimate Tic-Tac-Toe challenge. This implementation plays in the console. I admit the game logic could be hived off into a ...
10
votes
3
answers
413
views
TicTactics GameBoard Logic
This is my take at the current code-challenge, Ultimate Tic-Tac-Toe.
It all started with a CellValue and a BoardPosition:
<...
8
votes
1
answer
6k
views
Clean code and SOLID principles for a simple Python TicTacToe game
I recently read the book Clean Code and I also did some research on the SOLID principles. I'm looking for general feedback on if I was able to transpose the examples (written in Java) to Python while ...
5
votes
1
answer
115
views
Adding more responsibility to this endgame-analyzer class
I have written a Tic-Tac-Toe game. I have a class called GameEndAnalyzer that will check if the game has already ended or not.
Would it violate the Single ...
6
votes
1
answer
1k
views
Player VS player Tic-Tac-Toe game
This program is supposed to be a player VS player Tic-Tac-Toe game. The computer then checks whether you've won, lost, or tied. The code does work, but I don't want it to work through hacking; I want ...
14
votes
2
answers
9k
views
Unbeatable Tic-Tac-Toe program seems difficult to read
I've made an unbeatable Tic-Tac-Toe in Python 3.3. While it truly was unbeatable, it was an eyesore to look at and nigh impossible to read. That code is here.
I have since then optimized it for ...
1
vote
2
answers
353
views
Android class in Tic-Tac-Toe
CellDrawableProvider is an Android class used in the game Tic-Tac-Toe. It provides drawables for cells of game board (drawables for figures X and O, and "Fire" if ...
7
votes
4
answers
3k
views
Tic-Tac-Toe design
Kindly look at this code and point out design flaws or areas for improvement. I think I've done the last part right (the enum). I think the rest of the design is flawed but I am very new to object-...
1
vote
2
answers
141
views
Multiple independent or layered constructors for TicTacToe?
At first it was like this:
...
7
votes
2
answers
1k
views
Tic-Tac-Toe optimization
I've made a Tic-Tac-Toe program (non-AI) for 2 human players. I will implement AI for a computer player later on. I am a beginner programmer and am also new to classes, which I've implemented in this ...
3
votes
1
answer
649
views
Extremely Object Oriented Tic-Tac-Toe in Java
Please criticize the classes GameJudgeImpl and GameInfo so that I could make them clearer.
...
1
vote
1
answer
287
views
Ruby Tic-Tac-Toe using classes
This is Tic-Tac-Toe using negamax for AI. Help me make it better!
Some sore points are:
...
3
votes
1
answer
3k
views
Graphical Tic-Tac-Toe game using SFML
First of all, I'm really new to SFML and making GUIs. This is my first real program using this.
Right now, when I click outside the window when the program is first run, the first piece is placed in ...
2
votes
1
answer
2k
views
TicTacToe in Java
I created this game in Java:
...
4
votes
5
answers
34k
views
Tic Tac Toe victory check
I am writing Python code for a Tic Tac Toe game. I need to write a function that takes in three inputs: board, x, and y. Board being the current display of the board and then x and y being values of ...
4
votes
1
answer
13k
views
First JavaScript game: Tic Tac Toe
I'm pretty new to programming in general. I work with MySQL at my job but my knowledge of scripting language is rudimentary at best. I've been learning JavaScript via Codecademy but I got bored and ...
7
votes
1
answer
756
views
Clojure TicTacToe (logic, no GUI)
I whipped this up last night and was wondering if anyone had any thoughts/comments on it; for example, on:
Code organisation
Coding style
Other improvements
Semantic errors
...
13
votes
4
answers
6k
views
Tic Tac Toe game
I don't have any questions about this piece of code; it compiles just fine in Visual Studio 2010. I just wanted to post it to see if anyone has any good ideas on how to simplify it, or pointing out ...
16
votes
2
answers
16k
views
Simple Tic-Tac-Toe PHP/Pure HTML
I've been doing a simple Tic-Tac-Toe with PHP, generating only HTML code.
A few notes:
I didn't bother yet to give an AI to the opponents (the Os), and it is intentional.
There is no CSS style to ...