The Garden Gate
Python AI Agents - Printable Version

+- The Garden Gate (
+-- Forum: General Discussions (
+--- Forum: General Talk (
+--- Thread: Python AI Agents (/showthread.php?tid=133)

Python AI Agents - BAZAntonio - 05-03-2021

Hi everyone.

I have recently started to play Pai Sho with a friend and got the idea of developing some AI agents to play the game.
I was thinking on building on the source code from the website which is available on github.

My first issue is that it is basically only JavaScript code which I don't know. I can read it and understand it to a certain extend. I work mainly with Python. I would like to ask, specially to @Skud, what you would suggest to integrate the JavaScript code with Python such that I can interact with the game using Python code and objects?

I was thinking of some approaches:
- Somehow start a Pai Sho local server and interact with it with Python
- Convert the JavaScript code to python with something like Js2Py (
- Recreate the Pai Sho game in Python and then build an AI over it.

My idea is to create several agents, make them play with each others and publish the results (best moves, piece importance, greedy vs long-term strategies, usage of harmony bonus, inverse reinforcement learning, etc). There aren't many articles on Pai Sho strategy and AI.

Any help is welcome. Smile