Giter Club home page Giter Club logo

pbrain-pyrandom's Introduction

pbrain-pyrandom

A Python Piskvork template

pbrain-pyrandom is the technical core of a "brain" (AI) for Piskvork gomoku manager used in Gomocup AI tournament, written in Python.

The code is basically the "Python copy" of C++ template written by Petr Lastovicka. This README is also partially copy of the C++ template's README.

Prerequisites and compilation

The Piskvork manager is a Win32 application and currently supports only Win32 compatible .exe files (furthermore whose name starts with pbrain- prefix). There are several ways how to create .exe from Python files.

Here I present the approach using PyInstaller and Windows command line:

  1. Install Windows (or Wine for Linux, originally the project was created and tested on Ubuntu 16.04 using Wine)
  2. Install Python (the code and also following instructions were tested with versions 2.7 and 3.6).
  3. Install pywin32 Python package: pip.exe install pypiwin32 (if not present "by default")
  4. Install PyInstaller: pip.exe install pyinstaller

To compile the example, use the following command line command:

cd C:\path\where\the\files\were\saved
pyinstaller.exe example.py pisqpipe.py --name pbrain-pyrandom.exe --onefile

Note: the executables pip.exe and pyinstaller.exe might need full path, in my case I used C:\Python27\Scripts\pip.exe and C:\Python27\Scripts\pyinstaller.exe.

How to create your own AI

Replace file example.py with your own algorithm. Please don't change file pisqpipe.py, because it contains communication between your AI and the game manager and it might be changed in future protocol versions. More information about the protocol and tournament rules can be found at Gomocup websites

pbrain-pyrandom's People

Contributors

stranskyjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pbrain-pyrandom's Issues

is there a python3?

I write my AI with tensorflow and python3, is there a .py for python3?thank u

Pbrain stdin read problem

Hello,

I found your neat code on github and I'm currently trying to create a pbrain for Pyskvorky as well, but I have a strange problem would you mind helping me a bit?

I'm using win10 and python 3.7.0 with pyinstaller 3.4
Sending commands to Pyskvorky works, but I'm struggling reading from stdin.
I'm using sys.stdin.readline().strip() as you do.
However the call of readline is blocked until Pyskvorky declares a timeout on my executable and close it, and only at this moment I receive the "START 20" initially sent by Pyskvorky

I know you're using win32process but the documentation is nearly non-existing so i'm sticking to python threading.Thread objects and Queues for interThread communication.
It's working fine: readline works and fill the Queue with the command, which is read successfully by the other thread (you can see this using the Pyskvorky logs with DEBUG enabled after the timeout)

I don't get how the thread object would prevent python from reading stdin, I've tried read(), input() etc instead of readline and it's not working either so if you have any ideas I'll take it!
I've joined the script and build files if you want to take a deeper look:
http://fromsmash.com/652da808-d2ca-11e8-95d3-06812412be8a

Thanks for your time and have a nice day

are there some good ways to debug?

hi,
I pyinstall my model to exe,but there are some bugs.
And it's not easy to debug,because the exe can only run in piskvork.exe, the bug information is always the same.like
1524637749 1
is there a way that i can print concrete error info like in python console?

can't get the example template to work

Hello,
I compiled the example.py you provided with pyinstaller without any modifications. When i try to use it in Piskvork manager i get the error "can't create process (error 216)". Any idea what I am doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.