Need Help Converting An Algorithm To GDScript Source Code - Algorithm And GDScript Source Code Provided On GitHub

Godot Version

v4.7.1.stable.official [a13da4feb] - CachyOS Linux x86_64

Question

Hi,

Can someone help us in converting an algorithm to GDScript source code?

The algorithm is on below web page:

Source code attempt is below on GitHub:

Thanks!

How come you need help now, after you’ve gotten so far already?

Seeing a great number of lines there, what made you stop halfway?

What type of help do you need exactly?

Hi,

Thank you for helping…
The code is written, but not working properly.
Any help would be appreciated to fix above code.

You can play the game on Itch below:

There are two AI’s - my own and the new one above.

Also if you enter Secret Code: “8889” in [Options], you can see all three players using AI.

Don’t pretend you don’t know the answer :wink:

You could start by documenting the bugs.

Code runs with no errors or warnings.
When testing all three A.I. players it does not seem to be “Near-Perfect”.
In fact my own algorithm seems to play the game better.

Where’s the problem then? Just stick to your own algorithm.

Yes, the online javascript demo does indeed look pretty good, doesn’t it. I’m not going to let it run for hours on end, but apparently your port fails earlier than that?

Impressive piece of js, by the way: only a couple of hundreds of lines of code, apparently.

I don’t think you need help from here, though. I doubt I could spot the difference quickly and the only way to understand what happens for me would be to write a port of the javascript from scratch myself.

Well, who knows, maybe you’ll find someone willing to do this for you. But personally I’d rather take a pass.

My own AI only averages 691,000 lines per game (2 week run),
Would be nice to have something that could easily go over 1 million lines per game.

Also, the game is not a competition , all three players work together.
A completed line must have 30 boxes (10 for each player) to clear.

I will see if I can hire someone on Fiverr, thanks!

You’re willing to pay someone for this?

I don’t see the point yet.. of Tetris solvers. I thought the point of games was fun. But what fun is it to have computers play Tetris?

What drives you to want this?