# Has anyone had success creating a chess board?

**URL:** <https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140>\
**Category:** Questions about Thunkable X\
**Created:** [March 13, 2023, 5:25pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140 "2023-03-13T17:25:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [March 13, 2023, 5:25pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/1 "2023-03-13T17:25:27Z")

</div>

Hello, has anyone had any success creating a multiplayer chess board using thunkable? Or even simply a chess board? Are there any templates? Had a look and the latest topics I found say there weren’t any but wondering if this has changed since?

---

<div class="post-metadata">

**Author:** ![cbclubes](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@cbclubes](https://community.thunkable.com/u/cbclubes)\
**Post date:** [March 13, 2023, 7:26pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/2 "2023-03-13T19:26:25Z")

</div>

I think this is totatly possible, in my “mind project” i can able to do this with MySQL and an API for example:

A first screen where the players choose their colors (black and white, whatever), the choice is saved in a variable and in a database, when the player try to chose a color, send a GET to API to check if the color is able to be chosen, after this the last one chose his color, the app send to board screen, where a timer to prepare start for both. And all the “multiplayer actions” is  
are regulated by a synchronized timer that automatically passes the turn to the other player if the first one has made a move.

This is just a 10 minutes thiking idea, you can do better!

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [March 13, 2023, 9:05pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/3 "2023-03-13T21:05:02Z")

</div>

You’ll have to forgive me, I am a simple man just trying to create things to experiment and learn a new skill - what is an api please?

I understand it is something that allows 2 applications to talk to each other. A google search told me this. But how exactly does it work? How much control over this other application do I have?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 14, 2023, 1:45am UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/4 "2023-03-14T01:45:06Z")

</div>

you should start reading up on one of the best features in thunkable - any component block - or what i started calling as “indexable buttons” (or components).

please read this tutorial to give you an idea of this process. (i guarantee you that this can build a chessboard and you can address each cell programatically!)

> [@Create Smarter Designs with the "Any Component" blocks](https://community.thunkable.com/t/create-smarter-designs-with-the-any-component-blocks/297263):
>
> Here are three different layouts with lots of buttons: Conventional wisdom would have you believe that creating something like the designs below would be a time consuming and challenging process. If you wanted 9, 16 or 25 buttons then you’ll spend a lot of time messing around with rows and columns and sizes and paddings…right? Wrong! All 3 of the designs shown above are created from just 1 button, 1 row and 1 column. By using the [Any Component](https://docs.thunkable.com/any-component-blocks) blocks you can create a…

following the technique aboive, the steps to make a chessboard are the following;  
in the design phase, create a prototype row, inside it, create a protoype button (no rounded corners), with a width about 1/9 of the width of the screen)

in the blocks section do the following at start.

1. clone the prototype BUTTON 8 times , then delete the prototype button.  
2, then clone the prototype ROW 8 times , then delete the prototype row.
2. voila - 8x8 board! each button can be addressable by number from 1 to 64.
3. you can use a loop to alternately color each button (cell)

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [March 14, 2023, 9:24am UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/6 "2023-03-14T09:24:35Z")

</div>

I haven’t even tried it yet but will mark this reply as “Solution” for being such a thorough explanation. I’m confident I can have a go now thanks to that. Thankyou very much.

---

<div class="post-metadata">

**Author:** ![cbclubes](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@cbclubes](https://community.thunkable.com/u/cbclubes)\
**Post date:** [March 14, 2023, 12:50pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/7 "2023-03-14T12:50:39Z")

</div>

In this case, the API will work as a messenger for your application. You will make a request through your application, and the API will be responsible for checking the information in your database and returning to you what it found.

An API (Application Programming Interface) is a set of rules and protocols that enable different software applications to communicate with each other. APIs are used to access and exchange data between different applications, platforms, and devices. APIs make it easier for developers to integrate different functionalities and services into their applications without having to build them from scratch. APIs are commonly used for building web and mobile applications, integrating with social media platforms, and accessing data from third-party services.

---

<div class="post-metadata">

**Author:** ![sammy-wrightcuhb](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sammy-wrightcuhb](https://community.thunkable.com/u/sammy-wrightcuhb)\
**Post date:** [March 14, 2023, 10:15pm UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/8 "2023-03-14T22:15:04Z")

</div>

![chess board loop screenshot](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/1/41aee39bdc0aa5072edf12452a382ecb3724f634.jpeg)

These are my blocks so far for the chess board. I followed the example you showed regarding the any component blocks. It works and looks kind of successful. However, I am still hitting a few snags I can’t seem to resolve. First of all the red circle in the picture above. I have swapped the “random integer” to some kind of a counter, I want it to be from 1 to 64 but it appears I don’t know how to do it. The blocks I have put in are counting every block as number 1. I thought this code would cause it to add 1 consecutively to the number but apparently not. Is anyone able to shed light on this please?

Also, the blue circle. This has worked in that it alternates black and white from left to right. But as it is a chess board I also need this to alternate up and down. Do I need to clone different buttons for this to happen or can I still clone the one button?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 15, 2023, 1:18am UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/9 "2023-03-15T01:18:26Z")

</div>

you’ll need a nested loop : i from 1 to 8, j from 1 to 8 where i deteremines the initial color of the row - use remainder after dividing by 2, to determine what color to use - remainder 0, use white, remainder 1, use black - play with it.before you enter the nested loop set k to 1, this will be the index to all the buttons. simply increment k after every cell in the innermost loop. you could also compute k from i and j if you want.  
good luck

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [June 13, 2023, 1:19am UTC](https://community.thunkable.com/t/has-anyone-had-success-creating-a-chess-board/2322140/10 "2023-06-13T01:19:04Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
