Skip to main content
The 2024 Developer Survey results are live! See the results

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.

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 ...
Taha Ishfaq Bhutta's user avatar
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 ...
Ankur's user avatar
  • 101
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 ...
Nescio's user avatar
  • 153
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,...
JohnBobSmith's user avatar
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 ...
200_success's user avatar
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 ...
Phrancis's user avatar
  • 20.4k
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 ...
Unihedron's user avatar
  • 522
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 ...
Timtech's user avatar
  • 920
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 ...
leansie's user avatar
  • 361
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: ...
Michael Durrant's user avatar
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? ...
Twooey's user avatar
  • 974
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 ...
Erick's user avatar
  • 101
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 ...
Simon Forsberg's user avatar
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: ...
Seeker's user avatar
  • 341
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 ...
Seeker's user avatar
  • 341
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 ...
syb0rg's user avatar
  • 21.8k
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. ...
sc_ray's user avatar
  • 1,213
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 ...
Rafe's user avatar
  • 1,360
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: <...
Mathieu Guindon's user avatar
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 ...
Asics's user avatar
  • 275
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 ...
Sarawut Positwinyu's user avatar
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 ...
Julii Giambelluca's user avatar
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 ...
Gavin Feriancek's user avatar
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 ...
leonideveloper's user avatar
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-...
Prasanna's user avatar
1 vote
2 answers
141 views

Multiple independent or layered constructors for TicTacToe?

At first it was like this: ...
leonideveloper's user avatar
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 ...
Anirudha Adibhatla's user avatar
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. ...
leonideveloper's user avatar
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: ...
itsdavem's user avatar
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 ...
Atom's user avatar
  • 175
2 votes
1 answer
2k views

TicTacToe in Java

I created this game in Java: ...
LazySloth13's user avatar
  • 1,301
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 ...
chh's user avatar
  • 143
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 ...
bad_sample's user avatar
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 ...
LiamGoodacre's user avatar
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 ...
Oblivious's user avatar
  • 131
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 ...
Eldros's user avatar
  • 449

15 30 50 per page
1
9 10 11 12
13