This is the archived CodeCup 2021 website.
Click here to go to the new CodeCup website.
CodeCup 2021 - An online programming competition  

CodeCup 2021 - An online programming competition

Introduction

Zuniq is an abstract game for two players created by Marcos Donnantuoni. It has very few elements and yet an unexpected complexity.

Board

The board is a grid of evenly spaced dots. The version played on the CodeCup is the version of 6 dots per side. The dots are on the lines indicated with A to F and the numbers 1 to 6.

Initial board of Zuniq

Moves

Players take turns joining two horizontally or vertically adjacent dots by a segment, the White player starts and the Black player alternates, and so on. In the example below the first three moves A2h, B3h and E5v are played.

Board after a couple moves

Eventually, closed zones will form. The examples shows a situation that is almost close to a win. By playing A1v the last player will close the left upper zone and wins.

Final move in a game

It's irrelevant which player closes which zone; zones do not belong to any player.

There are only two restrictions:

  • Once closed, zones are out of bounds for the players. They cannot move in its interior anymore.
  • There can never be zones of the same size.

Goal

Zuniq’s goal is simple: to be the last player able to move. The player who cannot make a move (either because there are none possible or because it would make a zone with repeated size) is the loser. Draws are impossible.

Score

The player that wins gets a score of 100 points, the losing player will receive 50 points. It is possible for the winner, though, to receive extra points with a maximum up to 10 points. At any moment a player thinks he will win the game, he may add '!' to his move. Suppose the White player does this in turn x, then he gets an extra score of (39 – x) / 2 points on top of the 100 points. The calculation for the Black player is (40 – x) / 2 points. But, if the claiming player loses the game, he will get no points at all!

Input/output

A communication protocol has been designed for your program to communicate with the judging software. You will read the moves of the other players from stdin (standard in). You must print your own moves to stdout (standard out).

You are free to write to standard error (stderr), which you can read after the game has been played and you have been logged in on the website, with a maximum of 10000 characters per game.

If your player is White, the first line you will read is “Start”, your program must then output the first move. After this your program must read the move of the other player and must continue responding with his own move until it receives “Quit” as input. If your program in the first line reads a board position, then this is the first move of your opponent. Now you know that you are playing as Black. When there are no moves left to play, you will receive one final “Quit” instruction.

If your program makes an illegal move you will be sent a “Quit” instruction as well. This should allow you to send debugging information to standard error. Each move will indicate exactly one position on board.

Example communication of a normal game

Input White player Output White player Input Black player Output Black player
StartE5v
E5vA2h
A2hB3h
B3h
etcetera
etceteraB4v
B4vD6v!
D6vE4h
E4hE1v
E1vC3h
C3hB1v
B1vF1h
F1hF2h
F2hA1h
A1hA1v
Quit
Quit

Competition

For the competition each player plays each other player exactly twice, once as the black player, once as the white player. The overall winner of the competition is the player with the highest number of points overall.

If your program exceeds the time limit, crashes or makes an illegal move, your program will receive 0 points. The play is resumed using a player, controlled by the jury, that randomly plays moves so that your opponent can still score points. See the technical rules for more information about this.

License

Zuniq by Marcos Donnantuoni (marcosd(at)gmail.com) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.