ChessGame

javadoc

Mehtaatur's Chess Automated v2.0 [Game Play Demo]

Basic ChessGame Service

The ChessGame service is a chess engine which can recieve and send MyRobotLab messages to other services.  It was used in Patrick Mccabe chess robot, featured here on Hackaday.


#file : service/ChessGame.py edit raw
chessgame = Runtime.start("chessgame","ChessGame")
# wait 6 seconds for the game to start
sleep(6)

# subscribes to the game engines move method
python.subscribe(chessgame, "makeHMove")

print("game has started !")

# moves pawn from b2 to b3
chessgame.move("b2-b3")

# prints out all moves
def onMakeHMove(move):
  print('move is ', move)

References

Examples:


#file : service/ChessGame.py edit raw
chessgame = Runtime.start("chessgame","ChessGame")
# wait 6 seconds for the game to start
sleep(6)

# subscribes to the game engines move method
python.subscribe(chessgame, "makeHMove")

print("game has started !")

# moves pawn from b2 to b3
chessgame.move("b2-b3")

# prints out all moves
def onMakeHMove(move):
  print('move is ', move)