Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tic-tac-toe]

A game, also known as "Naughts 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.

1
vote
1answer
43 views

First Python game of Tic-Tac-Toe

I'm just getting started with Python and was hoping for some feedback on a simple Tic-Tac-Toe game I wrote. Specifically, is there a simpler way to check the win conditions for the game, and to break ...
4
votes
2answers
90 views

Tic Tac Toe with images

This is my first 'real' project in C# , i looked up some tutorials on the Internet for Tic Tac Toe. But they were not how i wanted it to be, so i came up with some own ideas and wanted some tips on ...
1
vote
1answer
116 views

TicTacToe game in C#

I have been studying C#, and I am trying to model the Tic Tac Toe game. Is my program reasonable or is there anything I need to improve? ...
1
vote
1answer
65 views

Tic tac toe game using C++

I wrote this C++ code for Tic-tac-toe for an interview (The basic skeleton was pre-provided) and got rejected because the code was too complex and inefficient. I'm not an expert programmer so I'd like ...
1
vote
1answer
38 views

mapping a tictactoe board in javascript

I'm creating a Tic Tac Toe solver algorithm. The idea is to iterate through each row, column and both diagonals and put them into a map in JavaScript. With that map I can run other logic to check for ...
0
votes
1answer
57 views

10 minute Tic Tac Toe

After seeing Snake coded in 10 minutes, I decided to try a similar challenge, albeit easier. The following is Tic Tac Toe that I coded in 10 minutes. Given the short time frame, I'm sure there are ...
2
votes
1answer
72 views

MiniMax Algorithm

This is my C implementation of the Minimax Algorithm to play tic-tac-toe. I consider myself a C beginner so any feedback on style, best practices, or efficiency is more than welcome. ...
3
votes
0answers
36 views

Tic Tac Toe game (Game logic, no UI)

I've implemented a simple class for managing a Tic-Tac-Toe game's logic and state in Typescript. This code is intended to be used by a larger program; it doesn't implement any aspects of a UI. I've ...
1
vote
0answers
31 views

Basic TicTacToe Game Number 1MillionAnd1

I put together a basic Tic Tac Toe game and would appreciate some feedback/advice on how to make it better. Specifically, the GUI is kinda awful. I would love to build more tests into this to test ...
3
votes
2answers
90 views

A simple Tic Tac Toe game

I am trying to learn some Common Lisp, except basically all of my computing background is the C family of languages. So, I'm starting small. I have made a Tic-Tac-Toe game, and I am looking for some ...
1
vote
1answer
83 views

TicTacToe solver in JavaScript

I come more from a frontend background and have been reading up on more backend approaches and algorithms while solving a TicTacToe grid to see if there are any wins normally, I'd probably use ...
2
votes
1answer
302 views

Text-based Tic Tac Toe in C

I have programmed Tic Tac Toe in C. How can I improve the code? I have been told that system("cls") is not secure, but I don't know any other way of clearing the ...
6
votes
1answer
102 views

C++/SDL2 Tic-Tac-Toe

This is my second attempt at creating a game. I think I have gotten the basic ideas of state machines and game loops down, but I'm sure there are still a lot of things I can learn. It is a basic Tic-...
4
votes
2answers
73 views

TicTacToe game in Python 3

I wrote this program in Python 3.I would like to know if there is some more functionality that could be added/removed/is missing.Any comments would be helpful! ...
4
votes
1answer
93 views

Tic Tac Toe in Browser Console

Anyone remember "War games?" I have a very long way to go, but I thought it would be interesting to make a version of Tic Tac Toe which plays itself. At present the AI is "choose a random available ...
3
votes
1answer
59 views

Noughts and crosses game for 2 players

This is my first program in Python that I have coded and I am relatively happy with how it turned out. I would like to know how I could make my code shorter and more efficient. ...
2
votes
0answers
107 views

Two-player Tic-tac-toe game in React.js

I followed React Official Tutorial and before implementing time travel, I wanted to add a "New Game" button, and a LockBoard method that graphically prevents further inputs. Since I'm new to React, ...
3
votes
2answers
98 views

TicTacToe in Python 3

I have just started learning Python. This is code for a TicTacToe game. Can you please suggest any improvements? ...
2
votes
1answer
84 views

A simple TicTacToe

A simple game of TicTacToe. Please review for style and other. Is this a proper ViewModel? ...
7
votes
2answers
138 views

2 player TicTacToe

Can I optimize this Tic-tac-toe game or make it smaller? Known optimizations: string turn = "X"; can be changed to ...
0
votes
2answers
105 views

Java Tic Tac Toe implementation

I am looking for some feedback regarding my Java Tic-Tac-Toe implementation. Player.java ...
5
votes
1answer
69 views

Console TicTacToe implementation

I am new to assembly and I want to know how I can improve this implementation both by speed and/or binary size optimization and making code to read and support easily. Platform: Linux, x64 Assembler:...
1
vote
0answers
33 views

Python Pygame Tic tac toe PVP [closed]

I am trying to make a player vs player Tic Tac Toe game using pygame. So far I got a simple grid setup that shows me the coordinates and changes the box color to green when it's clicked. How do I ...
6
votes
3answers
132 views

Modularized Tic Tac Toe in C

I know several there have been several posts about Tic Tac Toe games previously, nonetheless I was really hoping that you may take a look at my attempt. I have tried to keep it as modularized as ...
2
votes
0answers
79 views

Tic Tac Toe game becomes more inefficient as time goes on

I designed a tic tac toe using 4 classes. The game class being the main class, the board class being the board, the player class being the decision making, and the AI class keeping the previous game ...
3
votes
1answer
81 views

Console Based Tic-Tac-Toe in C++

I recently began learning C++ and would appreciate your review of this simple tic-tac-toe game I made. I know the "3-in-a-row algorithm" is inefficient, but in what other ways could I improve the code?...
4
votes
2answers
58 views

Flexible 2P TicTacToe

I have spent hours on this code. I am a beginner and open to advice and improvements. I've put # where I feel insecure about the code. It lets you pick your marker,...
-1
votes
1answer
69 views

Tic-Tac-Toe in python 3.5.2 [closed]

I am trying to make a fun, easy game of tic-tac-toe, but my code editor is very limiting. If anyone has a suggestion to make this better, or a good, free code editor, I would love to know. By running ...
3
votes
1answer
401 views

Simple 2 player Tic tac toe game

This is a simple TicTacToe game which allows 2 human players to play together. This involves no AI. I am fairly new to programming and have only been learning python for 20 days. I need to know if ...
8
votes
2answers
118 views

Tic-Tac-Toe Console Game

After providing an answer on this question, I decided to try writing my own version of a console based tic-tac-toe game that will later be converted into an ultimate tic-tac-toe game. My goals for ...
10
votes
2answers
153 views

Tic-Tac-Toe console application (as foundation for Ultimate Tic-Tac-Toe)

For the purpose of becoming better at C++ programming, I wanted to program Ultimate Tic-Tac-Toe as a console application for Windows in C++. However, I thought it would be sensible to create the plain ...
5
votes
3answers
658 views

Tic-Tac-Toe program

My code can play the tic-tac-toe game with two human players. How can I can make it better ? I will be making a new version that plays tic-tac-toe against a computer later. ...
5
votes
1answer
64 views

Extendable version of TicTacToe

I am self-teaching Python. I wrote a simple and extendable version of Tic-Tac-Toe. As far as I know, I did some immature handling with too many function parameters and multiple creation of list. ...
11
votes
1answer
154 views

A Tic-Tac-Toe game in MonoGame

I've started learning MonoGame and C# lately, so in order to get more confident with both and do something not completely trivial, I've built a Naughts and Crosses game. I am using 7.1 version of C# (...
5
votes
1answer
86 views

Python tic tac toe class

I'm fairly new at programming and made a tic tac toe game to see if I could handle it. I managed to get it to work but I feel like my code is faaaar from perfection. I wanted to ask for some advices ...
8
votes
2answers
602 views

Tic-Tac-Toe Recursive Solver

I am attempting to create a Tic-Tac-Toe game that uses a recursively checks every possible game board, and finds which boards result in a victory for X. (I ultimately plan to turn this into an AI ...
0
votes
0answers
62 views

TicTacToe which attempts to implement Elixir style pipeline pattern

Code in Google colaboratory Elixir Design Patterns - The Pipeline - Matt Pruitt I would appreciate any/all comments regarding stylistic as well as performance-oriented issues. Tldr: Elixir has this ...
2
votes
1answer
156 views

Tic Tac Toe / Noughts and Crosses - First Program

This is my first program. Its a two player noughts and crosses game. I would really appreciate any comments on how to improve my code or make it more efficient. Many Thanks. It is written in Python 3....
3
votes
2answers
72 views

TicTacToe in Python

This is my second attempt to make Tic Tac Toe in Python. It's a part of my learning. Tomorrow I'll work on some simple AI and better menu. What do you think about it? What changes do you suggest? Code:...
6
votes
1answer
396 views

Tic-Tac-Toe AI in C# Unity

So I have a working game of Tic-Tac-Toe with an AI that plays random moves. Is anyway to maybe shorten the endturn() function so it's not so long? Also is this set up well enough to add a mode where ...
5
votes
2answers
92 views

Python TicTacToe

This is a console based Tic Tac Toe Game I programmed to practice my python. It is object oriented with a few standalone functions for getting user input. The game also has a basic AI that is ...
1
vote
1answer
230 views

TicTacToe with MiniMax algorithm (C#)

A friend of mine asked me to help him with his Tic-Tac-Toe implementation. He's a beginner, so we ended up implementing a simple state-machine that reacts to the moves. I was curious how I might ...
5
votes
2answers
492 views

C++ implementation of Tic-Tac-Toe game

I have written this simple code for Tic Tac Toe. ...
4
votes
2answers
584 views

Tic-Tac-Toe game made with JavaScript, HTML, and CSS

I am a beginner programmer. In a prototype function of the game function, called game.prototype.restart, I repeated some lines of code to reset variables I used to ...
3
votes
1answer
330 views

Noughts and crosses bot in Delphi

I hope someone can guide me in a way to make this code more efficient. Please explain the things you do simply because I'm no pro so more complex things I am unlikely to get. If you have issues with ...
18
votes
2answers
3k views

4x4 tic tac toe

I just started coding 10 days back. This is my first program using classes in C++. It is a two player 4x4 tic tac toe game. It works perfectly. If there are any improvements I can make, please let me ...
2
votes
1answer
138 views

Find winning move in Tic-Tac-Toe with boolean arrays in VBA

I've been trying to mess around with boolean arrays in VBA since I started to try to write an algorithm to solve sudoku puzzles. I thought I'd first try to solve codeabbey tic-tac-toe. I might be ...
4
votes
2answers
151 views

Java TicTacToe MVC with Singleplayer mode

To practice the MVC pattern and Unittesting in Java I decided to make a simple TicTacToe Console Application. The features of this App are: Multiplayer-Mode Singleplayer-Mode (that should always ...
3
votes
1answer
296 views

Tic-Tac-Toe engine in JavaScript

I just cloned (Github clone, not literal clone) someone's Tic-Tac-Toe game and I was originally going to make a pull request, but I ended up making too many changes, the code is simply unrecognizable ...
3
votes
3answers
727 views

Check for a win on the board

This code is part of a tic tac toe game. It uses a 2D array for the board. The functionality of the following code is to check for a win on the board, in rows, columns and diagonals. How can I ...