Langton’s ant recreation

(This solution might be really complex but idk)
Would it be possible to recreate langton’s ant in gimkit? :ant:

If you don’t know what langton’s ant is, here:

Basically, the ant is on a completely white 1x1 grid (grid repeats forever) world and follows these rules:

  • At a white square, turn 90° clockwise, flip the color of the square, move forward one unit
  • At a black square, turn 90° counter-clockwise, flip the color of the square, move forward one unit

It will eventually get to a repeating pattern forever.

So my question, Is it possible?
(You can ask more questions if you want)
My first guess is no, as it seems it would need colour detection to work but I’m not the best block coder, so maybe someone else knows.

Does this go in devices or help? I’m not sure.

Edit: I’m not looking for a code that is really long that just does it (just going: image of ant forward one, turning the colour and turning 90* clockwise (not this order) and so on. I’m looking for one that can do it automatically. (If you were thinking of this)

4 Likes

Hm, this is interesting, I will try to see if this is possible and write what I tried to do below:

Im not too sure if this would work so tell me if this is wrong but,

Get text and put a white square emoji in it, copy it so you have a 20x20 square of white squares, then do another 20x20 black squares on top of the white ones, make all the black squares invisible at game start. Then, put a smaller orange square everywhere over the other white and black ones, but leave on orange square visible in the middle. After, make the ant move 90 degrees clockwise if white square visible by making it invisible and making the one 90 degrees to it visible, make white square that it was on invisible, and make black square visible. now repeat this process for the black one so it goes 90 degree counter-clockwise.

I already see many issues with this solution. :sob:

4 Likes

Yes, yes, Hmmm..

I’m thinking yes for the guess but I have to experiment

3 Likes

Most probably. You would have to code in cardinal directions so the AI is aware in which direction it’s pointing. But other than that, the system should be easy, like giving each square an on off state (on might be white and off would be black) and running a check in which state the ant is on and run the required code.

3 Likes

Can you make block code for that? (Just asking generally)

1 Like

Does that mean me making an example or you asking if using block code is possible?

2 Likes

Just asking if it’s possible. Anyone can make it if they want.
(It’s what I meant by ‘just asking generally’)

1 Like

In short, yes it should be.

1 Like

If you tweak my randomly generating maze a little, you could totally do this!

Here’s what my maze does:

  • It has a starting square
  • It picks a random direction to go
  • the direction it picks , the barrier gers de-activated (for context, all squares and walls are activated at the start)

I honestly think that this would take less memory than my maze for two reasons:

  • There is no randomizer, saving a lot of block space
  • you don’t have to build walls for each square because its not a maze, and it doesn’t have to backtrack
5 Likes

Best way you can try to achieve this is by using a property string like this:
00000,00000,00000,00000,00000
Which it represents a square and 0 is black and 1 is white. Then, you make a pseudo x y tracker for each square.

1 Like

I’ve got ideas now but I would need help with the block code. Anyone?

Edit: @AstralLuke , how would I implement the movement with this idea?

1 Like

Err maybe we can use 3 to show the ant, such as
00000,00000,00000,0-31-000,00000
This is a concept that should be possible but I don’t have time for testing so someone else might want to try.

1 Like

I could see how it would travel “up and down”. And as long as we just set a position in a property like North South East or West, we could get the ant to go in different directions.

2 Likes

I think @Aubec7’s idea is great but I’d like to build off of it a bit. Using text boxes with colored emoji as a display is a good idea but @Aubec7’s idea ends up using 1200 text boxes. A simple solution is to use one text box for each row and use block code to set each text box to a string of white or black emoji based on a property (like @AstralLuke suggested). Then you create properties for X, Y, and direction and create a trigger with block code so that each second it changes direction based on the color of the current tile, flips the current tile, then moves forward one space depending on direction.

Please let me know if you find any flaws in my proposed solution or want me to explain something in more detail.

1 Like

This actually sorta fascinates me, I feel if we looked hard enough we can figure out smth
I feel we could somehow accomplish this I just have this wierd feeling
for so

I think we should keep going on this. I want to see how this ends up

Gimkit is turing-complete, so I’m pretty sure this might be possible.

So yeh why not keep studying this til we get the product? since we know its turing complete

This is not Off topic :sob:
The Staff already once restored a post cuz y’all kept saying its off topic
I am simply adding to THIS TOPIC Stop flagging it

Instead of daydreaming, you could help.

I’ve already said that randomly generating mazes are almost there to this. Just replace the randomizer with an if statement to do the functions, and you should be all set for the most part

The only issue is the lag from a lot of barriers/props for the different colored squares.

3 Likes

So yeh lemme think a little on this
I have changed a decent-ish amount of making theories and not even helping
I think I am slightly more prone nowadays to help since I have been focusing my professions on code

Update: I do not know what to say… We pretty much have it figured out but we just need to incorporate what @Jon said into real time

What if we were to set our own rules for this ant so We can set it to still follow its whole rule system but we give it new rules that therefore would make these things


From my knowledge of staring at this ant for at least 10 minutes it simply just changes its direction from like clockwise to counter-clockwise based on tile color?
We could make a theoretical artist Ant here

we could really go far and wide with the color assortments and the combinations we could make

Know what Lemme mess around in Gimkit and see if I can concoct some sort of small system that makes a basic Langston ant

I am gonna need to hyperfocus on this I believe I can do this

3 Likes