[FREE] TicTacToe Extension

Tic Tac Toe Extension

Hello everybody, this is Horizon and today I am presenting my new extension called TicTacToe. You can use this extension to make a TicTacToe application.

Blocks


v1.0

Designer Properties

mit designer

AIX :- io.horizon.tictactoe.aix (20.7 KB)


This version was removed and is unsupported

AIX :- This version was removed


:sparkles: v2.0 Update :sparkles:

Hey everyone, the TicTacToe Extension is back with a new update! This update is quite important and better because yes, now you guys can make an online TicTacToe game with this easily using Firebase Realtime Database.


v2.0

So let's see the new blocks and the new AIX file

But first, let's see the index system of the extension:

image

In the indexes, the 1st number represents the row and the 2nd represents the column.

Now, here are the new blocks:

image

image
When the X is placed, its index will be returned.

image
When the O is placed, its index will be returned.

image
You can't place any character (X or O) at any index according to your preference. I made this system to prevent the whole Tic Tac Toe board from being filled up only by Xs and Os. To address this, I've implemented a system where, if someone places an X, it will automatically know that an O must be placed at a specific index determined by the row and column in the block (if you don't get it, message in the topic, and I'll try to explain it more clearly).

image
These two blocks can help you close and open the view. This is especially helpful in creating an online game. CloseView doesn't remove or hide the view. It just locks the view. Until the view is opened by the OpenView block, the Tic Tac Toe board won't function.


I'll share the APK of the online Tic Tac Toe game with you soon, so stay tuned! :wink:

Friends, if you would like to buy this extension, please pay me and DM me the screenshot. I'll share the file with you in the DM.

Price: 250 INR or $5 USD

PayPal

If you don't have a PayPal account, DM me, and I'll explain the procedure.


DEMO

DEMO

Credits
I am so much thankful to @Pradevel, @Aarush_Kumar, and @Know_About_IT. Special thanks to @shreyash for his great Rush.

Donate

If you liked the extension, please don't forget to give this topic a :heart:.

Thank You

AIA :- TicTacToe.aia (23.4 KB)


Open Source

Great news! The Tic Tac Toe extension is now open source! :tada:

You can find the complete source code on GitHub:

  • GitHub Repository:

Feel free to clone the repository, explore the code, and contribute. Whether it's fixing bugs, adding new features, or improving the documentation, your help is welcome. Open an issue or submit a pull request on GitHub.

Let's build and learn together! :rocket:

Best regards,
Horizon

19 Likes

good extension :smiley:

3 Likes

Thank you @AyProductions

3 Likes

you're welcome

Open Source
This extension is now open source

Thank you

4 Likes

Nice extension @Horizon

2 Likes

Thank you @Pradevel

Nice Work!!

1 Like

Coooooool👍

1 Like

Very good extension

1 Like

Great work !!! :exploding_head:

1 Like

Thank you @Aarush_Kumar, @Know_About_IT, @Faraz_Firoz, @Aquib_Khan

6 Likes

@Horizon It would better if you add these blocks
Set O on index=2
Set X on index=1

1 Like

I am sorry @Faraz_Firoz I didn't get you
Will you please elaborate

Add a block to set X or O with blocks

1 Like

@Horizon, @Faraz_Firoz means that add the ability to customize the TicTacToe board, X, O letters. Because always that style will not fit the app :wink:

Btw great extension :heart:

and happy saraswati puja!
2 Likes

Actually I have talked to Faraz and he said that he want a feature to return the index of the place where the x or o is placed so that it is possible to make online game

Yes you can change the color of all these things along with winning line but you cannot change the characters of X or O because i am not using "X" or "O" instead i am making it using programming
If you know java then go through the source code you'll get how exactly i am doing
And i have made it open source for this only so that new learners can understand it

Thank you

4 Likes

If I will make a little bit change in your code then we can use any letters

1 Like

Yes you can try and also I would recommend you to give pull request to the GitHub repo
But i guess it's not possible as you can draw that thing but you cannot change the text size and all

Just change this in TicTacToeBoard.java

private void drawX(Canvas canvas, int row, int col) {
        paint.setColor(XColor);

        canvas.drawLine((float) ((col + 1) * cellSize - cellSize * 0.2),
                (float) (row * cellSize + cellSize * 0.2),
                (float) (col * cellSize + cellSize * 0.2),
                (float) ((row + 1) * cellSize - cellSize * 0.2),
                paint);

        canvas.drawLine((float) (col * cellSize + cellSize * 0.2),
                (float) (row * cellSize + cellSize * 0.2),
                (float) ((col + 1) * cellSize - cellSize * 0.2),
                (float) ((row + 1) * cellSize - cellSize * 0.2),
                paint);

    }

    private void drawO(Canvas canvas, int row, int col) {
        paint.setColor(OColor);

        canvas.drawOval((float) (col * cellSize + cellSize * 0.2),
                (float) (row * cellSize + cellSize * 0.2),
                (float) ((col * cellSize + cellSize) - cellSize * 0.2),
                (float) ((row * cellSize + cellSize) - cellSize * 0.2),
                paint);

    }

You can create your own letter by changing these code. As you do in Canvas component.

1 Like