Contents
Due Dec 2, 11:55pm.
Submit via eClass submission link on the main eClass course page.
Late submission (with 20% deduction) Dec 4, 11:55pm.
Submit via separate eClass link for late submissions.
In this assignment, you develop your own player
for Binary Game. You can implement any player you want using
any techniques, as long as it's in Python 3 and follows the rules and constraints below.
We will test the performance of your player in two tournaments.
-
In the marking tournament, for regular assignment marks,
we will match your player against a fixed set of our Binary Game players.
-
The championship tournament, for bonus points and glory,
will be
a tournament among student programs. The winning team
will be crowned the Fall 2024 Cmput 455 Binary Game champions.
- First, as in previous assignments, make sure you have your
Python 3 and NumPy set up.
You can review the procedures under
Lecture 3 activities.
- Download
assignment4.tgz
and expand it.
The directory
assignment4
contains:
-
Starter code
a4.py
for your player, similar to previous starter codes.
-
A script
a4test.py
for testing
your code on the public tests.
- Code for two of the four opponents for the marking tournament:
random_player.py
, and a simple boolean minimax-based player minimax_player.py
.
-
We will not publish the other two opponents before the tournament, but here is a little bit of information about them. One will be MCTS-based, and the other will be a stronger minimax-based player.
We will tune the strength of these two players such that they will be a little bit stronger than the public players, but perfectly possible to defeat within the scope of an assignment.
-
Add the code to implement your solution in
assignment4
.
Your main program must remain in a4.py
.
Rules
- Games will be played on a rectangular board of size 5x5 or more.
We may setup a board position using
play
commands before we ask the players to generate their moves.
-
The time limit will be 30 seconds per move.
If a program does not play within the time limit, it will be killed
by the script and instantly loses the game. Leave a margin of safety and use a bit less than 30 seconds.
-
The memory limit will be 1 Gigabyte per program.
-
If a program generates an illegal move, it instantly loses the game.
-
If a program crashes or exceeds the memory limit, it instantly loses the game.
-
If a game is interrupted for other reasons, it may be replayed at the decision of the instructor.
- Your player is allowed but not required to resign.
- Your player will not be called to generate a move
after the game is over.
Constraints
- You can use any code provided by us, or created by you as part of this course,
but no other outside sources of code. Using standard python libraries is OK, before using other more exotic libraries ask on the eClass forum.
- Your program is not allowed to use more than one thread for computation/search.
- Your program is not allowed to use programming languages other than Python 3.
- Your program is allowed to read/write files within your
assignment4 directory only.
- The total file size of the assignment submission, including all files,
is limited to 1 Megabyte uncompressed. It must remain under that limit while your program is running, i.e. your program cannot generate files of larger total size.
- Further reasonable constraints to prevent abuse may be imposed as we become aware of them.
Text Commands
-
genmove
x y num
= 1
Your genmove
command should generate a move
using your player, and comply with the rules and constraints above.
- The functionality of all other existing text commands such as
play
should be left as-is. If you do change the implementation,
make sure that they still work as expected.
-
Please make sure that these details are correct
in your assignment 4 submission.
- Your file must be a valid tgz file named
assignment4.tgz
which can be uncompressed
with
tar xvfz assignment4.tgz
- Name your main file
a4.py
.
- You may add extra python files within the same directory.
- Do not introduce extra levels of directories.
- By default, we assume that teams will stay the same as in assignment 3.
If you change your team, submit the new information using the web form
by Nov 25. (If your team changes later, use the web form anyway.)
Run the public tests as follows:
python3 a4test.py a4.py assignment4-public-tests.txt
Follow the same general steps as in assignment 1 to
create your
presubmission.log
file and your
submission,
but (of course) using your assignment4
directory and
assignment4.tgz
as file name.
Add both your
presubmission.log
and readme.txt
to
your assignment4
directory.
There will be 5+2 marks for this assignment.
- 1 mark for your file
presubmission.log
which shows
the log of your correct test execution and your readme.txt
file.
- 4x1 mark for your wins against our 4 test opponents.
We will play at least two games against each opponent,
one with each player going first.
We might play more games depending on available machines and time.
- Up to 2 bonus marks for doing well in the championship tournament. Typically, the top 8 teams receive some bonus marks, and the two finalists receive two marks.
Last modified: Nov 2, 2024 by Martin Müller