
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?![]() |
Very simple demo algorithm:
App Engine Python client: PyClient.zip
C# ASP.NET client: CsClient.zip
| Rows | Score |
|---|---|
| 1 | 10 |
| 2 | 25 |
| 3 | 40 |
| 4 | 55 |
| i | ![]() |
j | ![]() |
l | ![]() |
o | ![]() |
s | ![]() |
t | ![]() |
z | ![]() |
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.
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>