Home

Write your auto player algorithm as a CGI. Give me the URL, and I'll challenge your player.

An example interaction:

I send your CGI the next piece, plus the current board.
POST /random_client HTTP/1.1
Content-Type: application/x-www-form-urlencoded

piece=j&board=.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
Your CGI responds with the position and rotation degrees to drop the piece
position=8&degrees=180
The board now looks like this:
Next piece..
POST /random_client HTTP/1.1
Content-Type: application/x-www-form-urlencoded

piece=l&board=.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ........jj ........j. ........j.
..the response.
position=2&degrees=0
Getting the picture?

Sample Clients

Very simple demo algorithm:

  1. rotate the piece a random number of times
  2. calculate the width of the rotated piece
  3. calculate the height of each column on the board
  4. find the group of n contiguous columns with the lowest max height, where n in the width of the rotated piece

App Engine Python client: PyClient.zip

C# ASP.NET client: CsClient.zip

Reference

Limitations

Scoring

Rows Score
1 10
2 25
3 40
4 55

Request POST "piece"

i j l o s t z

Request POST "board"

Current board state. Delimited string starting at the top of the screen, rows space separated. A dot represent an empty cell, a letter represents a block in the cell.

Player Response

Position of the column starting at 0, and rotation to drop the block. Your CGI response give the position and degrees in a quersystring type format: position=<position>&degrees=<degrees>