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°rees=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°rees=0 Getting the picture?



Sample Clients

Very simple demo algorithm:

rotate the piece a random number of times calculate the width of the rotated piece calculate the height of each column on the board 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

Client needs to respond in within 5 seconds. Google app engine limitation of URLFetch (SDK 1.1.7 Released).

The game finishes after 200 moves. The server processes 10 moves at a time, and returns to the browser, which trips up to the server again. This is to have the requests complete within the request limit (see The Request Timer). It would be good if App Engine could do this asynchronously (Issue 6).

Client can only be hosted on ports 80 (http) and port 443 (https). URLFetch limitation (see Things To Know About urlfetch).

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>°rees=<degrees>