Prolog: An AI program that plays Eternagame

Time for some help.
I originally stated that I hope to harvest the emergent wisdom of the gamer community. I’m finally ready to start that. So far, the AI has been more artificial than intelligent.

Can anyone tell me under what conditions c-g bonds are required to close loops? I would like to come up with a general rule that can be applied to many different puzzles.

A Little Fuzzy Non-logic (apologies to Mozart).
I’m still milking puzzle 11 for all I can get out of it. I has some interesting properties and it only takes 11 minutes to run my program on it (the next puzzle takes a full half hour). I know that c-g bonds are useful in closing loops. P11 has five loop closures that could use c-g bonds. However, a condition of the puzzle is that there are no more than 2 c-g pairs.

If I specify that all loops are closed by c-g bonds and there are a maximum of 2 in the puzzle, that produces a contradiction and exactly zero solutions are found. If I remove the conditions that c-g closures are used, then I get 186,624 results, very few of which are actually solutions. If I specify a 30% probability that a c-g bond is required, about 40 solutions are produced (the results are not constant, now that probability is involved), and some of those are correct. I call this non-logic because it is a scatter gun approach. Even if totally deterministic logic is not practical, some ideas like “c-g bonds are more likely to be needed in this situation than that one”, would be very helpful.

So, who has some ideas?

maybe specify first that yes all loop closures need a gc bond but then specify that this script should then be run on the stable solutions that the bot comes up with
or to make it even simpler make it run this and then run this script
as i use both these scripts and usually this solves a puzzle
the first script (second link) named tsumego usually stabilizes shape and then ifthere are no constraints then it solves and the second script(first and third link minimizes gc and maximizes gu which ius helpful in all au gu gc constraint puzzles ans the gu importance is more than au constraint importance so it kinda bugs and solves the puzzle) but if you want individual scripts for this then here they are
gc>au
au>gu
theres also this if you want to look into it
replace pairs
cheat codes(also replaces pairs but with a different probability of replacing and it checks for flip pairs too)

this has helped me solve many puzzles but just to make sure sometimes the tsumego script doesn’t solve so maybe add something that will check to see if shape is stable or not if not then it will flip pairs or add gc to see if shape will get stable and delta will go down if gc doesnt make delta go down then dont keep the gc and try gc somewhere else in the parts that dont form

Thank you for the reply. When I click on the links in it, I get what appears to be a blank script writing screen. I have copied and pasted what I can of it at the end of this message. I should say that I know nothing about these scripts, so maybe I just need to click somewhere and it will all come to life. The program I am writing does not work like a bot (I presume a bot mimics mouse clicks and keystrokes as if a person were playing). This is a rule driven expert system which starts with an abstract statement of the puzzle and writes its output to a text file. Here is the end of such a file, which produced 16,384 results.

BEGIN FILE SEGMENT
[c,c,c,g,c,c,g,c,g,a,a,a,e,c,g,g,g,g,g,g,g,e] 16383
[e,g,g,g,g,g,g,g,c,e,a,a,a,g,c,g,c,c,g,c,c,c]
[f,b,b,f,b,b,f,b,b,f,f,f,f,b,b,f,b,b,f,b,b,f]

[c,c,c,g,c,c,g,c,c,a,a,a,e,g,g,g,g,g,g,g,g,e] 16384
[e,g,g,g,g,g,g,g,g,e,a,a,a,c,c,g,c,c,g,c,c,c]
[f,b,b,f,b,b,f,b,b,f,f,f,f,b,b,f,b,b,f,b,b,f]

elapsed time: 644.1276431083679 seconds

END FILE SEGMENT

I don’t think I have time to enter all those results into eternagame, either to test them or to run a script on them. I would really like to see the code in your script as that might give me an idea of one or more rules to add to the expert system.

Again, thank you for your interest.

HERE IS THE COPY OF THE WINDOW I GOT TO FROM YOUR FIRST LINK.

Code Info

Title : Start from Copy

Author :

Description :

Type :

Page view :

Tested :

Code

Timeout : Evaluate

Result Console

Clear output

Clear input

Result

maybe youre not looged into eterna?

it should come as this https://eternagame.org/web/script/10436081/

this script might interest you for getting the raw data for a puzzle https://eternagame.org/web/script/2501829/

My apologies for this long delay. I am planning to restart my work. I have added a new strategy for development to the google disc at the top.
I should probably not have said that my program “plays” eternagame. It does not work via sequential moves like the game. The output is a list of completed RNA sequences which it believes (if an expert system believes anything) will be likely to produce the desired structure.

Maybe you can even use wasm swi-prolog implementation and inject prolog code dorectly into web page?
https://www.swi-prolog.org/pldoc/man?section=wasm

1 Like

That’s a good suggestion. Thank you so much. It’s been a few years since I worked on this. Maybe you will jog me into starting again. I’ve been: Writing essays and poetry; Singing the Brahms Requiem; Teaching “Acoustical Foundations of Music” & preparing my photographs for art shows. I never thought retirement would be this busy.