Quantcast
Channel: An algorithm for grouping by trying without feedback - Stack Overflow
Viewing all articles
Browse latest Browse all 2

An algorithm for grouping by trying without feedback

0
0

Tagged this as Python because is the most pseudo-y-code language in my opinion

I'll explain graphically and the answer can be graphical/theorical too (maybe its the wrong site to post this?)

Let's say I want to make an algorithm that solves a simple digital game for infants (this is not the actual context, its much more complex)

These are the rules :

  • There is a square grid seen from above, with a colored lego piece in each spot

  • You can drag pieces to try and stack on top of each other.

  • If their color match, they will stack, leaving the spot of the first piece you dragged empty.

  • If you move a piece to an empty spot, it will move to that spot

  • If their color don't match and you drag one of top of the other, they will switch spots.

  • The amount of pieces of a same color is randomly generated when a new grid is started.

The goal of the game is to obviously drag pieces of the same color until you only have one stack of each color.

Now here comes question, I want to make a script that solves the game, but it will be "blind", meaning it won't be able to see colors, or track when a match occurs. It will have to traverse in a way that it will ensure it tried all possible "drags"

The main problem for me to even start thinking about this comes from the fact that they swap positions if the script fails to guess the color, and there's no feedback to know that you failed.

Also is the complexity of this calculable? Is it too insane?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images