---
title: "Discussion on \"How I Made a TicTacToe Game That You Cannot Beat 🙅‍♂️\" | Hashnode"
description: "Discussion on \"How I Made a TicTacToe Game That You Cannot Beat 🙅‍♂️\". A cross-platform app development framework + a 30 lines algorithm = Impossible Ai 😎"
url: "https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How I Made a TicTacToe Game That You Cannot Beat 🙅‍♂️](https://blog.ikramhasan.com/how-i-made-a-tictactoe-game-that-you-cannot-beat?utm_source=hashnode&utm_medium=feed)

A cross-platform app development framework + a 30 lines algorithm = Impossible Ai 😎

Apr 26, 2022 · 6 min read · blog.ikramhasan.com  
Read the article

-   [#game-development](https://hashnode.com/tag/game-development)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#artificial-intelligence](https://hashnode.com/tag/artificial-intelligence)
-   [#flutter](https://hashnode.com/tag/flutter)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Ikram Hasan](https://hashnode.com/@ikramhasan)

@ikramhasan

  
[View profile](https://hashnode.com/@ikramhasan)

An aspiring engineer 🚀 with an immense thirst for learning new technologies 👌

## Responses 12

Markdown supported · ⌘↵ to post

[Mbanugo Franklyn](https://hashnode.com/@Franklyn-dotcom)

[May 2, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626f2fadd02237eb3fc7d42f)

Awesome!!!. I love it bro!!. I love the UI. Keep it up!!.

[Eleftheria Batsou](https://hashnode.com/@eleftheriabatsou)

[Apr 28, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626a48627d5d27b992e4b3e3)

You did an excellent job! It doesn't matter how many lines of code you'll write, what matters is finding a solution, and you did exactly that.

Great writing [Ikram Hasan](https://hashnode.com/@ikramhasan)!

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 28, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626a48627d5d27b992e4b3e3#reply-626ad0017d5d27b992e4c73f)

Thank you for the kind words. I'm very new at writing about my journey and it means a lot.

[Hartaj Singh](https://hashnode.com/@thehartajsingh)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626970b6bbabafb0a9707ebf)

How about this ? ,

[tictactoe-hartaj.vercel.app](https://tictactoe-hartaj.vercel.app/)

[AlixaProDev](https://hashnode.com/@alixaprodev)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626958bfbbabafb0a9707c1a)

Love your approach. Thanks for the share.

[Paweł Tarsała](https://hashnode.com/@BRUT4LxD)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62691b0d7b6a339ac2d037e9)

Simple algorithm. It needs to go through all combinations though. If it takes the first move it might be laggy. Actually, this algorithm was used to beat Garry Kasparov in chess (DeepBlue). You can use alpha-beta pruning to speed up this algo if you care about optimization here :)

[Yasir Arafat Ifte](https://hashnode.com/@YasirArafat)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626914e77b6a339ac2d03729)

Even though the technical aspect of programming is not my cup of tea, I have enjoyed the whole writing process of the author's journey of overcoming his fear of algorithms. Kudos to the writer.

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626914e77b6a339ac2d03729#reply-62691e783033e09ae73edd32)

Thank you <3

[Ifeanyi Nneji](https://hashnode.com/@Nneji123)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626910a53033e09ae73edb3b)

It's actually unbeatable 😂

[Krzysztof Kałamarski](https://hashnode.com/@kkalamarski)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62690fba3033e09ae73edb16)

Very nice read :) Every game I played ended in a draw 🤷

I was building a chess game using the same methods, it really tastes like a success when you make it to finally work :D

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62690fba3033e09ae73edb16#reply-62691e5a3033e09ae73edd27)

A tie is actually the best case scenario. Let me know if you manage to finish your project. I'd love to take a look. Thanks for checking it out.

[Krzysztof Kałamarski](https://hashnode.com/@kkalamarski)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62690fba3033e09ae73edb16#reply-626920c33033e09ae73edd54)

Yeah, I know... Wasn't hoping for more 😂

I wrote a post about it too - you can check it out here: [kkalamarski.me/how-i-built-my-own-chess-ai](https://kkalamarski.me/how-i-built-my-own-chess-ai)

I'm still planning to work on performance improvements and evaluate the position better...

[Swati Sarangi](https://hashnode.com/@starCodes)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62690c293033e09ae73edad9)

Awesome and simple design!! I enjoyed playing, tried for some 15-20 times,it's either a **tie** or **loss** for me.

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62690c293033e09ae73edad9#reply-62691e1c3033e09ae73edd23)

A tie is the best case scenario. At this point, I'm thinking of offering a prize bond to whoever can win against it 😅

[Matthew Fowler](https://hashnode.com/@FisheyMug)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/6268a6277b6a339ac2d029e6)

Very enjoyable and inspirational read. I will also make sure to check out the channels you mentioned too! The game looks and plays great, I wont spend too long checking if it is really unbeatable!

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/6268a6277b6a339ac2d029e6#reply-6268d1417b6a339ac2d02d9a)

Kind words like these are why I keep doing what I do. Thank you, sir.

[Mohammed Taha](https://hashnode.com/@6km)

[Apr 26, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626872107b6a339ac2d026cf)

Great!! I couldn't beat this game.

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/626872107b6a339ac2d026cf#reply-6268d0d87b6a339ac2d02d80)

Thank you for trying it out!

[Md. Sharif Hossain](https://hashnode.com/@SharifMezba)

[Apr 26, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62684eee3033e09ae73ecb3d)

Cool Bro !!! Inspired !!!

[Ikram Hasan](https://hashnode.com/@ikramhasan)

[Apr 27, 2022](https://hashnode.com/posts/how-i-made-a-tictactoe-game-that-you-cannot-beat/626819587b6a339ac2d01f31/comment/62684eee3033e09ae73ecb3d#reply-6268d0f27b6a339ac2d02d88)

Thank you <3
