[FREE] TicTacToe Extension

Tic Tac Toe Extension

Hello everybody this is Horizon and today I am back with my new extension called TicTacToe. Using this extension you can make TicTacToe application

Blocks

v1.0

Designer Properties

mit designer

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


v1.2

image

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


AIA :-
TicTacToe.aia (23.4 KB)

DEMO

Credits
I am so much thankful to @PRATY_PROGRAMME_S_LA, @Aarush_Kumar and @Know_About_IT
And special thanks to @Shreyash for his great Rush

Open Source
This extension is now open source

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

Thank You

18 Likes

good extension :smiley:

1 Like

Thank you @AyProductions

2 Likes

you're welcome

Open Source
This extension is now open source

Thank you

4 Likes

Nice extension @Horizon

Thank you @PRATY_PROGRAMME_S_LA

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