A letter manipulation game

Hi everyone !

I am currently developing a little game to learn more about the Gdevelop 5 (I’m a new).
I am working on an idea that is quite simple at first but a little complex to set up and I need your advice.

Here is the subject:

There are 3 blocks, each block (object) has an image of a letter (A, B or C). I added 6 more blocks to make 9 block (3x3 blocks).
By a substitution method, on all the blocks I managed to randomly make the 3 letters appear on each launch or this game.

Here’s a random example below, when the game starts:

ABA
CAB
CCA

My problem and my goal:

Consider the first letter A at the top left corner. I’m trying to create a function, which, when there are letters located close to the first selected letter (only horizontally and vertically) and which forms the following diagram ABC, BCA, BAC etc … then It turns into the letter X, letters close to the one chosen “merges” with it. And a new blocks will be created at the ends of the columns after the blocks are shifted.

Same example at the top:
ABA
CAB
CCA

Becomes:

XAC
CAB
BCA

Do you know how i can solve this problem?

Thank you in advance.

Hi,
I’m afraid I didn’t understand the function you’re trying to make.
Once you manage to define clearly what should happen and when, you should be able to turn your logic into conditions and actions for GDevelop.