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.

Filter by
Sorted by
Tagged with
1
vote
1answer
464 views

C# Events in a Tic Tac Toe game

I am new to coding and am trying to understand events what is an annoying stage but super important I guess. I just made a Tic Tac Toe game and it is working but not really "beautiful" coded. I really ...
2
votes
1answer
1k views

Determine if someone has won a game of Tic-Tac-Toe on a board of any size

I was asked this question in interview yesterday: Write the code for winning condition in an NxN matrix for tick tack toe.For example A function named "input_event(player_info, x_position, ...
4
votes
2answers
210 views

TicTacToe Logic

I've started to write a small Tic-Tac-Toe game. I am pretty sure everyone knows how this game works so I don't have to explain that part. I've decided to represent the grid using 2 bitsets which ...
6
votes
1answer
99 views

TicTacToe game | Starting with python after learning JS

I've been coding since about one year in JS now, and started with Python this week. I've created this TicTacToe game to get familiar with Python and would like to know what you think about this code, ...
4
votes
1answer
1k views

Simple Tic-Tac-Toe Game in python3

Thank you for reviewing my code. I know C++ and I am learning python. As a beginner project I wrote a simple tic-tac-toe game using python3. It would be helpful if you could: Tell whether there is ...
-2
votes
2answers
484 views
2
votes
0answers
1k views

TicTacToe in Python with MiniMax/AlphaBeta

I know barely anything about Python, I just jumped into this project as I've already coded it in different languages and it's my go-to when figuring things out in a new one, any feedback will be ...
3
votes
0answers
446 views

React Tic Tac Toe

This is a project that grew out of the React Tutorial and is one of my first efforts at solving React problems on my own. There is a lot of code here and I am sure that there are more concise ways ...
5
votes
1answer
1k views

TicTacToe with MiniMax algorithm

I just got into C++ a few days ago and decided to make a MiniMax based TicTacToe game, I don't really know much about the conventions and best uses of the C++ language so I'd really appreciate any ...
2
votes
2answers
341 views

Tic-tac-toe with many enumerated computer moves

This code is able to create a tic tac toe game, user vs a computer. For every move the user makes in a check board 3⨉3 abc⨉123. The functions setup the instance of the game along with creating the ...
7
votes
1answer
296 views

TicTacToe (again!), but with difficulty levels, undo, and hints

I'm learning Python after a 30+ year break from programming, got bored with the usual TicTacToe exercise, so went a bit wild adding functionality to it to make something that's a bit more fun to play ...
3
votes
2answers
483 views

Noughts and Crosses winner declaration in a game of variable square board size

I have made a tic tac toe for two players and written down some functions to do the decision making about who is the winner. I have gone through some cases while testing but need advice to see if I am ...
5
votes
1answer
859 views

Design Tic tac toe game

Today I had an interview, where I was asked to solve this question: Design Tic tac toe game Game rules: Design a simple tic tac game with 2 modes for 3*3 matrix. At the beginning, ask if single ...
6
votes
1answer
263 views

TicTacToe in MVP Winforms

I took the source code from this question, (thank you gaessaki for the motivation!) and did a lot of refactoring. I use 4 projects: Common: contains mainly interfaces and enumerations referenced by ...
3
votes
1answer
875 views

Tic Tac Toe in Python, converted to use classes

I am new to using Classes and Objects, and as such thought i would edit a previous Tic Tac Toe game i created, this time using Classes. I found it easier using entirely public (Class?) variables (ie, ...
2
votes
2answers
592 views

Tic Tac toe in React

I wrote this tic tac toe game in react. I am learning react now. Feedback is welcome. I deliberately used single file, to focus on React and not other aspects. ...
3
votes
1answer
337 views

Evaluation function for minimax/alphabeta algorithm for Tic Tac Toe AI

I am trying to develop an optimal evaluation function to use in minimax/alpha-beta algorithm for developing tic-tac-toe AI. I am counting number of circles/crosses in a row/column/diagonal with ...
8
votes
4answers
768 views

Noughts and Crosses in Python using the pygame module

I've created a Noughts and Crosses game in Python using pygame, and I'm quite pleased with the result that I've produced. I've managed to reduce the code to what it is now, as it used to be much ...
11
votes
1answer
2k views

Simple Tic-Tac-Toe Application in WPF

I made a Tic-Tac-Toe game in WPF and was just hoping for some input as I am pretty new to WPF and I am still a student so I'm sure that my C# code in general may be lacking XAML: ...
8
votes
1answer
659 views
7
votes
1answer
6k views

Simple Tic-Tac-Toe using tkinter

I've been learning programming using a book about Python for a few months. To explore object-oriented programming, I built a few things in tkinter. When I started this code, I wanted to be able to ...
2
votes
1answer
331 views

Tic-Tac-Toe class and methods

I'm trying to learn python and am still a bit foggy on classes. Am i using them right in this tic-tac-toe game? Everything function like i want it too but not sure if i am really getting how to use ...
11
votes
1answer
2k views

Real time Tic Tac Toe game in Javascript using Socket.IO

This is my first attempt at building a full project. I've recently learned using prototypical inheritance in JS. Please tell me how I can improve the quality of this code. The game is available here:...
2
votes
2answers
238 views

Tic-Tac-Toe game requiring two players

I have a working Tic-Tac-Toe game, which requires two players. The game also keeps track of the result of each game and assigns score to each player based on the result of the game. For this, I have ...
6
votes
1answer
1k views

Single player Tic-Tac-Toe game

I have made an attempt to make a single player mode for the Tic-Tac-Toe game. I am not sure if this is the right way to do it and wanted a second opinion. ...
2
votes
2answers
549 views

Tic-Tac-Toe game code

I am new to programming and wrote this code for a Tic-Tac-Toe game. The game works as desired, however, I feel the code can be condensed a bit especially within the functions, ...
5
votes
1answer
2k views

Tic Tac Toe in PyGame

This is my first python/pygame program. Instead of using images I tried drawing with pygame.draw.line() and pygame.draw.arc() ...
1
vote
1answer
7k views

Tic Tac Toe game in Java vs computer

I am trying to create a Tic Tac Toe game in Java using a 2 dimensional array. The computer has to do the smartest move. ...
7
votes
1answer
3k views

Simple Tic-Tac-Toe game in React.js

I'm relatively new to react and attempted to create a simple Tic-Tac-Toe game. Would be great if i could get some feedback on this. Again, at this point using only React (no Redux). main.js - main ...
4
votes
1answer
478 views

Noughts and crosses command line game in Python 3.5

Based on this Code Review answer, I have created a noughts and crosses game in Python, which asks for an index (1 to 9) and updates the grid, and displays it on the screen. I have done some very ...
9
votes
2answers
1k views

TicTacToe in Python3 w/ Simple AI

Here is my version of TicTacToe on python 3.x I'm learning python for a several weeks and I will be very appretiated if you take a look on my script and review it! P.S. I've used NumPad to input ...
3
votes
1answer
382 views

Basic Noughts & Crosses

So I got bored and made a simple noughts and crosses game with colours instead of symbols. The colours are red and blue and I made the GUI in NetBeans with my own code in combination with the ...
5
votes
1answer
719 views

Tic Tac Toe game tree generator minimax

I have coded a working Tic Tac Toe game tree generator. It doesn't only generate the game tree, it also applies minimax values to each node. The code works fine on a board that already has 2 or more ...
6
votes
2answers
221 views

Another Tic Tac Toe In Ruby

I am messing with Ruby a little bit and would like to get some feedback about the Spaghettii below :) ...
2
votes
1answer
212 views

Python tic-tac-toe game - procedural programming only

I made a tic-tac-toe game that is a player vs. player version (no AI). I have tried not to utilize objects because I haven't really gotten there yet. A previous version (see here) utilized global ...
3
votes
1answer
282 views

Tic Tac Toe implemented in WinForms using Model-Viewer-Presenter Pattern

I had to build a 2-player Tic Tac Toe app in C# w/ WinForms for a pre-interview screen. I got past that stage successfully and the app works flawlessly, but I would like to get some feedback. ...
4
votes
1answer
545 views

Object Oriented TicTacToe

I have been trying to learn to program in a more object oriented manner and I am at the moment working on a Tic Tac Toe game. I have tried to split my classes so that it would make sense, OOP wise. I ...
3
votes
1answer
537 views

Java - Tic Tac Toe

I am a self - taught coder, and have been learning Java for the last 2 years. I have recently created a tic tac toe game in Java. I have rearranged the program into separate classes & methods. I ...
3
votes
0answers
581 views

Python TicTacToe AlphaBeta Program

I am looking for a review of my perfect TicTacToe algorithm. It will be split up into 3 parts: The function The GameState Class The game (NOT well designed) I am mainly looking for tips and comments ...
1
vote
1answer
92 views

TicTacToe in C++ (Gandalf vs Saruman)

I've written a TicTacToe game using classes, just for learning purposes... and I wonder If this code can be improved. main.cpp ...
3
votes
1answer
5k views

Minimax Tic-Tac-Toe implementation

Notes: I know \ are against PEP8; they are for readibility I created this working through a tutorial I forgot to add blank lines, so it may be a little squished ...
9
votes
2answers
894 views

JavaScript Tic-Tac-Toe web app

I am teaching myself JavaScript and made a little Tic-Tac-Toe web app. I'm not asking anyone to read through it all, but to just tell me what I need or should not do in the future. ...
2
votes
1answer
839 views

Tic Tac Toe in Ruby

I'm a novice programmer going through the Odin Project. I just finished up building a command line Tic Tac Toe game and I would appreciate some feedback on object-oriented design, methods, verbosity, ...
4
votes
1answer
262 views

C++ Tic Tac Toe Game

I have reached a mini-capstone where I am asked to create a tic tac toe program. I have successfully created the program. What I'd like feedback on is two things: 1. How do I number my columns like I ...
7
votes
1answer
461 views

JavaScript Tic Tac Toe game challenge

I just completed the Tic Tac Toe challenge at freecodecamp. I am looking for input on how I could shorten the code. For the click events such as s1.onclick, I feel ...
6
votes
3answers
181 views

Tant Fant Game in Python

Here is our code of Tant Fant Game. Does anyone have suggestions for how to improve our code? ...
1
vote
1answer
731 views

Tic Tac Toe in PyQt4

I'm working on learning Python, and this is my second GUI project using PyQt. I've played it a few times to test it and it seems to work. It isn't anything clever; the computer just picks randomly. ...
2
votes
2answers
609 views

Another TicTacToe Implementation

There are already many other TicTacToe implementations but most of them are missing some features like if duplicate input is entered exception and immediate termination of the program occurs board is ...
2
votes
1answer
84 views

TicTacToe between Gandalf and Saruman

What can be improved? ...
4
votes
2answers
553 views

Evaluate a game of tic-tac-toe to determine winner

So the program will take input of a series of 9 integers which indicate which square was played on each move. Player 1 is always X and player 2 is always ...