[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnubg] Python Support
From: |
amarganth |
Subject: |
[Bug-gnubg] Python Support |
Date: |
Thu, 5 Aug 2004 10:29:32 +0200 |
Hi all
I've installed the newest version of gnubg (i hope) on a windows xp.
After removing Python 2.3.x and installing 2.2.x all works well:
- python standalone
- gnubg_no_gui python support works fine
But I have still some problems, where I need some help.
First: I'm currently try to build a new FIBS bot, fully written in Python.
The problem is, that I can't get the output of the "hint" command from gnubg.
And I don't find another command unter python (dir(gnubg) to get this
information.
That's what I'm doing after starting gnubg-no-gui:
GNU Backgammon 0.14.2-devel Copyright 1999, 2000, 2001, 2002, 2003 Gary
Wong.
...
(No game) >
Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)]
>>> import gnubg
>>> gnubg.command("new match 7")
A new 7 point match has been started.
gnubg rolls 3, user rolls 4.
GNU Backgammon Position ID: 4HPwATDgc/ABMA
Match ID : cInxAAAAAAAA
+13-14-15-16-17-18------19-20-21-22-23-24-+ O: gnubg
| X O | | O X | 0 points
| X O | | O X |
| X O | | O |
| X | | O |
| X | | O |
v| |BAR| | 7 point match (Cube: 1)
| O | | X |
| O | | X |
| O X | | X |
| O X | | X O | Rolled 34
| O X | | X O | 0 points
+12-11-10--9--8--7-------6--5--4--3--2--1-+ X: user
GNU Backgammon Position ID: 4HPwATDgc/ABMA
Match ID : cInxAAAAAAAA
+13-14-15-16-17-18------19-20-21-22-23-24-+ O: gnubg
| X O | | O X | 0 points
| X O | | O X |
| X O | | O |
| X | | O |
| X | | O |
v| |BAR| | 7 point match (Cube: 1)
| O | | X |
| O | | X |
| O X | | X |
| O X | | X O | Rolled 34
| O X | | X O | 0 points
+12-11-10--9--8--7-------6--5--4--3--2--1-+ X: user
GNU Backgammon Position ID: 4HPwATDgc/ABMA
Match ID : cInxAAAAAAAA
+13-14-15-16-17-18------19-20-21-22-23-24-+ O: gnubg
| X O | | O X | 0 points
| X O | | O X |
| X O | | O |
| X | | O |
| X | | O |
v| |BAR| | 7 point match (Cube: 1)
| O | | X |
| O | | X |
| O X | | X |
| O X | | X O | Rolled 34
| O X | | X O | 0 points
+12-11-10--9--8--7-------6--5--4--3--2--1-+ X: user
>>> s = gnubg.command("hint")
1. Cubeless 0-ply 24/21 13/9 MWC: 50.25%
0.512 0.143 0.008 - 0.488 0.132 0.004
0-ply cubeless
2. Cubeless 0-ply 24/20 13/10 MWC: 50.25% ( -0.00%)
0.514 0.140 0.007 - 0.486 0.131 0.004
0-ply cubeless
3. Cubeless 0-ply 13/10 13/9 MWC: 50.23% ( -0.02%)
0.507 0.156 0.009 - 0.493 0.136 0.007
0-ply cubeless
4. Cubeless 0-ply 24/21 24/20 MWC: 49.96% ( -0.29%)
0.500 0.121 0.007 - 0.500 0.131 0.003
0-ply cubeless
5. Cubeless 0-ply 13/6 MWC: 49.87% ( -0.38%)
0.489 0.140 0.006 - 0.511 0.140 0.006
0-ply cubeless
6. Cubeless 0-ply 13/9 6/3 MWC: 49.84% ( -0.41%)
0.490 0.147 0.009 - 0.510 0.152 0.009
0-ply cubeless
7. Cubeless 0-ply 24/20 6/3 MWC: 49.78% ( -0.47%)
0.490 0.131 0.007 - 0.510 0.147 0.005
0-ply cubeless
8. Cubeless 0-ply 13/9 8/5 MWC: 49.76% ( -0.49%)
0.486 0.146 0.008 - 0.514 0.155 0.010
0-ply cubeless
9. Cubeless 0-ply 24/20 8/5 MWC: 49.69% ( -0.56%)
0.485 0.130 0.007 - 0.515 0.150 0.006
0-ply cubeless
10. Cubeless 0-ply 13/10 8/4 MWC: 49.68% ( -0.57%)
0.482 0.145 0.008 - 0.518 0.157 0.010
0-ply cubeless
GNU Backgammon Position ID: 4HPwATDgc/ABMA
Match ID : cInxAAAAAAAA
+13-14-15-16-17-18------19-20-21-22-23-24-+ O: gnubg
| X O | | O X | 0 points
| X O | | O X |
| X O | | O |
| X | | O |
| X | | O |
v| |BAR| | 7 point match (Cube: 1)
| O | | X |
| O | | X |
| O X | | X |
| O X | | X O | Rolled 34
| O X | | X O | 0 points
+12-11-10--9--8--7-------6--5--4--3--2--1-+ X: user
>>> print s
None
>>>
The output from "hint" is written to the standard output. But I can't get
it to work with it. How can I get the output of the hint command?
Thanks in advance. :-)
Rolf
- [Bug-gnubg] Python Support,
amarganth <=