Commit ef3a2d18 authored by judge's avatar judge

Tried to fix borked permissions

parent 52068b63
File mode changed from 100755 to 100644
../../qchess/data/
\ No newline at end of file
NAME
qchess.py - Play quantum chess
SYNOPSIS
qchess.py [OPTIONS] [white] [black]
DESCRIPTION
An implementation of Quantum Chess as originally described and implemented here:
http://research.cs.queensu.ca/Parallel/QuantumChess/QuantumChess.html
Reimplemented for UCC::Progcomp 2013
http://progcomp.ucc.asn.au
IMPORTANT:
- This version does not implement castling or en passen rules.
- If a piece currently in a pawn state moves into the opposing back row, that state always becomes a queen.
- (The other state of the piece is unaffected).
ARGUMENTS
If no arguments are given, a window should appear asking you to pick each player.
Then the game will commence using default values.
white, black
Each of the two players in order. They need not be provided if graphics is enabled (default).
Any arguments that do not begin with a hyphen (-) are treated as the player arguments in the order they appear.
Player arguments that begin with '@' are treated as special players:
@human
A human player; if graphics are enabled, this players turns are made through the GUI
@network[:address]
A player over a network connection.
For example, if [email protected] wants to play [email protected]:
[email protected]:~$ ./qchess.py @network @human
[email protected]:~$ ./qchess.py @human @network:host1
IMPORTANT: Only ONE of the games should give the other's address.
@internal:name
An internal agent player
These agents run within the qchess program (unless there is a timeout setting... never mind).
Choices are:
AgentRandom - Makes random moves only
AgentBishop - Uses probability estimates and a min/max recursive (depth is only one) algorithm
- Will usually take a long time to run
OPTIONS
--help
Print this page
--graphics
Enable the GUI
If graphics are enabled (default), then the user will be prompted to choose any of the two players not supplied as arguments.
--no-graphics
Disable the GUI
--reveal
If graphics are enabled, the two states for pieces will always be shown, regardless of whether both states have been revealed.
Note that this switch only affects the GUI and does not provide any information to agent players.
If graphics are disabled, has no effect.
--file[=filename][:events]
Replay a game saved in file, or read from stdin if no filename given
If a number of events is supplied, the game will advance that many events before stopping.
If no players are given, the GUI will NOT ask for player selections.
The game will exit after the replay finishes. Events in the replay will be subject to the normal delay (see --delay).
If black and white players are supplied, the game will continue using those players.
In this case, there will be no delays between events in the replay (the game starts at the end of the replay)
(We hope that) this feature will be useful for comparing how different versions of an agent respond to the same situation.
--log[=filename]
Log moves to a file or stdout if no filename given
--delay[=time]
The game pauses between moves so that it can be followed by a human observer.
This option can be used to change the delay. If no time is given, the delay is disabled.
If graphics are enabled (default), the delay is 0.5s by default.
If graphics are disabled, there is no delay unless this option is used.
--timeout[=time]
Set the maximum time in seconds to wait before declaring an AI program unresponsive.
If no time is given, the timeout is disabled.
By default the timeout is disabled.
--blackout[=time]
Setting a blackout time will cause the display to become black if the mouse is not moved and no keys or buttons are pressed.
If no time is given, the blackout time is disabled.
By default the blackout is disabled.
This switch was introduced for entirely obscure purposes.
--classical
If this option is used, the game will treat pieces "classically", ie: as in standard chess.
Note that the game does not enforce rules related to check and checkmate.
--quantum
The game uses the quantum chess representation of pieces (default).
AUTHOR
Written for the UCC Programming Competition 2013 by Sam Moore.
UCC::Progcomp home page: http://progcomp.ucc.asn.au
REPORTING BUGS
Report bugs to [email protected]
Join IRC channel #progcomp on irc://irc.ucc.asn.au
COPYRIGHT
Copyright 2013 The University Computer Club, Inc.
Contact [email protected]
../../qchess/qchess.py
\ No newline at end of file
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
../../qchess/data/
\ No newline at end of file
NAME
qchess.py - Play quantum chess
SYNOPSIS
qchess.py [OPTIONS] [white] [black]
DESCRIPTION
An implementation of Quantum Chess as originally described and implemented here:
http://research.cs.queensu.ca/Parallel/QuantumChess/QuantumChess.html
Reimplemented for UCC::Progcomp 2013
http://progcomp.ucc.asn.au
IMPORTANT:
- This version does not implement castling or en passen rules.
- If a piece currently in a pawn state moves into the opposing back row, that state always becomes a queen.
- (The other state of the piece is unaffected).
ARGUMENTS
If no arguments are given, a window should appear asking you to pick each player.
Then the game will commence using default values.
white, black
Each of the two players in order. They need not be provided if graphics is enabled (default).
Any arguments that do not begin with a hyphen (-) are treated as the player arguments in the order they appear.
Player arguments that begin with '@' are treated as special players:
@human
A human player; if graphics are enabled, this players turns are made through the GUI
@network[:address]
A player over a network connection.
For example, if [email protected] wants to play [email protected]:
[email protected]:~$ ./qchess.py @network @human
[email protected]:~$ ./qchess.py @human @network:host1
IMPORTANT: Only ONE of the games should give the other's address.
@internal:name
An internal agent player
These agents run within the qchess program (unless there is a timeout setting... never mind).
Choices are:
AgentRandom - Makes random moves only
AgentBishop - Uses probability estimates and a min/max recursive (depth is only one) algorithm
- Will usually take a long time to run
OPTIONS
--help
Print this page
--graphics
Enable the GUI
If graphics are enabled (default), then the user will be prompted to choose any of the two players not supplied as arguments.
--no-graphics
Disable the GUI
--reveal
If graphics are enabled, the two states for pieces will always be shown, regardless of whether both states have been revealed.
Note that this switch only affects the GUI and does not provide any information to agent players.
If graphics are disabled, has no effect.
--file[=filename][:events]
Replay a game saved in file, or read from stdin if no filename given
If a number of events is supplied, the game will advance that many events before stopping.
If no players are given, the GUI will NOT ask for player selections.
The game will exit after the replay finishes. Events in the replay will be subject to the normal delay (see --delay).
If black and white players are supplied, the game will continue using those players.
In this case, there will be no delays between events in the replay (the game starts at the end of the replay)
(We hope that) this feature will be useful for comparing how different versions of an agent respond to the same situation.
--log[=filename]
Log moves to a file or stdout if no filename given
--delay[=time]
The game pauses between moves so that it can be followed by a human observer.
This option can be used to change the delay. If no time is given, the delay is disabled.
If graphics are enabled (default), the delay is 0.5s by default.
If graphics are disabled, there is no delay unless this option is used.
--timeout[=time]
Set the maximum time in seconds to wait before declaring an AI program unresponsive.
If no time is given, the timeout is disabled.
By default the timeout is disabled.
--blackout[=time]
Setting a blackout time will cause the display to become black if the mouse is not moved and no keys or buttons are pressed.
If no time is given, the blackout time is disabled.
By default the blackout is disabled.
This switch was introduced for entirely obscure purposes.
--classical
If this option is used, the game will treat pieces "classically", ie: as in standard chess.
Note that the game does not enforce rules related to check and checkmate.
--quantum
The game uses the quantum chess representation of pieces (default).
AUTHOR
Written for the UCC Programming Competition 2013 by Sam Moore.
UCC::Progcomp home page: http://progcomp.ucc.asn.au
REPORTING BUGS
Report bugs to [email protected]
Join IRC channel #progcomp on irc://irc.ucc.asn.au
COPYRIGHT
Copyright 2013 The University Computer Club, Inc.
Contact [email protected]
../../qchess/qchess.py
\ No newline at end of file
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
../src/images.py
\ No newline at end of file
try:
import pygame
except:
pass
import os
# Dictionary that stores the unicode character representations of the different pieces
# Chess was clearly the reason why unicode was invented
# For some reason none of the pygame chess implementations I found used them!
piece_char = {"white" : {"king" : u'\u2654',
"queen" : u'\u2655',
"rook" : u'\u2656',
"bishop" : u'\u2657',
"knight" : u'\u2658',
"pawn" : u'\u2659',
"unknown" : '?'},
"black" : {"king" : u'\u265A',
"queen" : u'\u265B',
"rook" : u'\u265C',
"bishop" : u'\u265D',
"knight" : u'\u265E',
"pawn" : u'\u265F',
"unknown" : '?'}}
images = {"white" : {}, "black" : {}}
small_images = {"white" : {}, "black" : {}}
def create_images(grid_sz, font_name=os.path.join(os.path.curdir, "data", "DejaVuSans.ttf")):
# Get the font sizes
l_size = 5*(grid_sz[0] / 8)
s_size = 3*(grid_sz[0] / 8)
for c in piece_char.keys():
if c == "black":
for p in piece_char[c].keys():
images[c].update({p : pygame.font.Font(font_name, l_size).render(piece_char[c][p], True,(0,0,0))})
small_images[c].update({p : pygame.font.Font(font_name, s_size).render(piece_char[c][p],True,(0,0,0))})
elif c == "white":
for p in piece_char[c].keys():
images[c].update({p : pygame.font.Font(font_name, l_size+1).render(piece_char["black"][p], True,(255,255,255))})
images[c][p].blit(pygame.font.Font(font_name, l_size).render(piece_char[c][p], True,(0,0,0)),(0,0))
small_images[c].update({p : pygame.font.Font(font_name, s_size+1).render(piece_char["black"][p],True,(255,255,255))})
small_images[c][p].blit(pygame.font.Font(font_name, s_size).render(piece_char[c][p],True,(0,0,0)),(0,0))
def load_images(image_dir=os.path.join(os.path.curdir, "data", "images")):
if not os.path.exists(image_dir):
raise Exception("Couldn't load images from " + image_dir + " (path doesn't exist)")
for c in piece_char.keys():
for p in piece_char[c].keys():
images[c].update({p : pygame.image.load(os.path.join(image_dir, c + "_" + p + ".png"))})
small_images[c].update({p : pygame.image.load(os.path.join(image_dir, c + "_" + p + "_small.png"))})
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
../qchess/data/images/
\ No newline at end of file
# Log starts 2013-05-02 12:40:48.956309
2013-05-02 12:40:48.956389 : Getting clients...
2013-05-10 09:50:45.266308 : Got white player
2013-05-10 09:50:51.328055 : Got black player
2013-05-10 09:50:51.828767 : Getting clients...
2013-05-18 17:50:16.077574 : Got white player
2013-05-18 17:50:41.904604 : Got black player
2013-05-18 17:50:42.405349 : Getting clients...
2013-05-18 18:25:12.576240 : Got white player
2013-05-18 18:25:21.680798 : Got black player
2013-05-18 18:25:22.181525 : Getting clients...
2013-05-18 18:28:48.112894 : Got white player
2013-05-18 18:28:49.116687 : Got black player
2013-05-18 18:28:49.617370 : Getting clients...
# Log starts 2013-05-10 09:50:45.382246
# white : @network:(None, 4600)
# black : @network:(None, 4601)
# Initial board
black unknown ['rook', '?queen'] at 0,0
black unknown ['pawn', '?pawn'] at 0,1
white unknown ['pawn', '?knight'] at 0,6
white unknown ['rook', '?pawn'] at 0,7
black unknown ['knight', '?bishop'] at 1,0
black unknown ['pawn', '?pawn'] at 1,1
white unknown ['pawn', '?knight'] at 1,6
white unknown ['knight', '?rook'] at 1,7
black unknown ['bishop', '?bishop'] at 2,0
black unknown ['pawn', '?pawn'] at 2,1
white unknown ['pawn', '?pawn'] at 2,6
white unknown ['bishop', '?pawn'] at 2,7
black king ['king', 'king'] at 3,0
black unknown ['pawn', '?pawn'] at 3,1
white unknown ['pawn', '?pawn'] at 3,6
white king ['king', 'king'] at 3,7
black unknown ['queen', '?rook'] at 4,0
black unknown ['pawn', '?knight'] at 4,1
white unknown ['pawn', '?pawn'] at 4,6
white unknown ['queen', '?queen'] at 4,7
black unknown ['bishop', '?rook'] at 5,0
black unknown ['pawn', '?pawn'] at 5,1
white unknown ['pawn', '?pawn'] at 5,6
white unknown ['bishop', '?rook'] at 5,7
black unknown ['knight', '?knight'] at 6,0
black unknown ['pawn', '?pawn'] at 6,1
white unknown ['pawn', '?pawn'] at 6,6
white unknown ['knight', '?bishop'] at 6,7
black unknown ['rook', '?pawn'] at 7,0
black unknown ['pawn', '?pawn'] at 7,1
white unknown ['pawn', '?pawn'] at 7,6
white unknown ['rook', '?bishop'] at 7,7
# Start game
2013-05-10 09:50:54.310819 : 4 6 1 pawn
2013-05-10 09:50:55.481921 : 4 6 -> 4 4
2013-05-10 09:50:57.309623 : 3 1 1 pawn
2013-05-10 09:50:58.103761 : 3 1 -> 3 3
2013-05-10 09:51:33.678172 : 5 6 0 pawn
2013-05-10 09:51:34.228357 : 5 6 -> 5 5
2013-05-10 09:51:37.401411 : 4 1 1 knight
2013-05-10 09:51:38.490964 : 4 1 -> 5 3
2013-05-10 09:51:40.679271 : 4 7 0 queen
2013-05-10 09:51:41.963620 : 4 7 -> 7 4
2013-05-10 09:51:44.292005 : 3 0 0 king
2013-05-10 09:51:44.975591 : 3 0 -> 4 1
2013-05-10 09:51:47.471950 : 7 4 0 queen
2013-05-10 09:51:51.777611 : 7 4 -> 4 1
2013-05-10 09:51:52.278222 : white
# EOF
# Log starts 2013-05-18 17:50:16.195914
# white : @network:(None, 4602)
# black : @network:(None, 4603)
# Initial board
black unknown ['rook', '?queen'] at 0,0
black unknown ['pawn', '?pawn'] at 0,1
white unknown ['pawn', '?pawn'] at 0,6
white unknown ['rook', '?rook'] at 0,7
black unknown ['knight', '?pawn'] at 1,0
black unknown ['pawn', '?knight'] at 1,1
white unknown ['pawn', '?knight'] at 1,6
white unknown ['knight', '?knight'] at 1,7
black unknown ['bishop', '?rook'] at 2,0
black unknown ['pawn', '?bishop'] at 2,1
white unknown ['pawn', '?pawn'] at 2,6
white unknown ['bishop', '?pawn'] at 2,7
black king ['king', 'king'] at 3,0
black unknown ['pawn', '?bishop'] at 3,1
white unknown ['pawn', '?pawn'] at 3,6
white king ['king', 'king'] at 3,7
black unknown ['queen', '?pawn'] at 4,0
black unknown ['pawn', '?pawn'] at 4,1
white unknown ['pawn', '?pawn'] at 4,6
white unknown ['queen', '?bishop'] at 4,7
black unknown ['bishop', '?rook'] at 5,0
black unknown ['pawn', '?pawn'] at 5,1
white unknown ['pawn', '?pawn'] at 5,6
white unknown ['bishop', '?queen'] at 5,7
black unknown ['knight', '?pawn'] at 6,0
black unknown ['pawn', '?pawn'] at 6,1
white unknown ['pawn', '?bishop'] at 6,6
white unknown ['knight', '?rook'] at 6,7
black unknown ['rook', '?knight'] at 7,0
black unknown ['pawn', '?pawn'] at 7,1
white unknown ['pawn', '?pawn'] at 7,6
white unknown ['rook', '?pawn'] at 7,7
# Start game
2013-05-18 17:50:43.367638 : 3 6 1 pawn
2013-05-18 17:50:50.415485 : 3 6 -> 3 4
2013-05-18 17:50:51.816167 : 3 1 0 pawn
2013-05-18 17:50:52.371079 : 3 1 -> 3 3
2013-05-18 17:50:55.174875 : 4 7 0 queen
2013-05-18 17:50:57.503496 : 4 7 -> 0 3
2013-05-18 17:50:58.565433 : 2 1 0 pawn
2013-05-18 17:50:59.316660 : 2 1 -> 2 3
2013-05-18 17:51:00.398013 : 0 3 0 queen
2013-05-18 17:51:01.230841 : 0 3 -> 3 0
2013-05-18 17:51:01.731467 : white
# EOF
# Log starts 2013-05-18 18:25:12.694368
# Log starts 2013-05-18 18:28:48.231038
# white : @network:(None, 4606)
# black : @network:(None, 4607)
# Initial board
black unknown ['rook', '?bishop'] at 0,0
black unknown ['pawn', '?pawn'] at 0,1
white unknown ['pawn', '?bishop'] at 0,6
white unknown ['rook', '?rook'] at 0,7
black unknown ['knight', '?knight'] at 1,0
black unknown ['pawn', '?knight'] at 1,1
white unknown ['pawn', '?pawn'] at 1,6
white unknown ['knight', '?rook'] at 1,7
black unknown ['bishop', '?queen'] at 2,0
black unknown ['pawn', '?pawn'] at 2,1
white unknown ['pawn', '?pawn'] at 2,6
white unknown ['bishop', '?knight'] at 2,7
black king ['king', 'king'] at 3,0
black unknown ['pawn', '?pawn'] at 3,1
white unknown ['pawn', '?pawn'] at 3,6
white king ['king', 'king'] at 3,7
black unknown ['queen', '?rook'] at 4,0
black unknown ['pawn', '?pawn'] at 4,1
white unknown ['pawn', '?pawn'] at 4,6
white unknown ['queen', '?knight'] at 4,7
black unknown ['bishop', '?rook'] at 5,0
black unknown ['pawn', '?pawn'] at 5,1
white unknown ['pawn', '?pawn'] at 5,6
white unknown ['bishop', '?pawn'] at 5,7
black unknown ['knight', '?pawn'] at 6,0
black unknown ['pawn', '?pawn'] at 6,1
white unknown ['pawn', '?pawn'] at 6,6
white unknown ['knight', '?bishop'] at 6,7
black unknown ['rook', '?bishop'] at 7,0
black unknown ['pawn', '?pawn'] at 7,1
white unknown ['pawn', '?pawn'] at 7,6
white unknown ['rook', '?queen'] at 7,7
# Start game
2013-05-18 18:28:51.646758 : 5 6 1 pawn
2013-05-18 18:28:52.548055 : 5 6 -> 5 4
2013-05-18 18:28:56.728446 : 0 1 1 pawn
2013-05-18 18:28:57.297094 : 0 1 -> 0 2
2013-05-18 18:28:58.898872 : 5 4 0 pawn
2013-05-18 18:28:59.420966 : 5 4 -> 5 3
2013-05-18 18:29:03.940562 : 7 1 0 pawn
2013-05-18 18:29:04.499325 : 7 1 -> 7 2
2013-05-18 18:29:10.454964 : network terminate
# EOF
../poster
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment