-
Notifications
You must be signed in to change notification settings - Fork 8
classic style adds
xale edited this page Sep 13, 2010
·
4 revisions
If the server has enabled “classic mode”, (one of the arguments to the new game rules string) then whenever a player clears multiple lines simultaneously, he or she triggers a “classic-style add.” Classic-style adds, like the addline special block, adds lines to the bottom of players’ fields, pushing the rest of the field contents up. Unlike addlines, classic-style adds target all other players, rather than just one, can add more than one line at a time, and use a different algorithm for generating the contents of the lines.
number of lines cleared | lines added to other players |
---|---|
2 | 1 |
3 | 2 |
4 | 4 |
Garbage-line generation algorithm:
- fill the line with random, non-empty, non-special cells
- choose a single column at random, and clear it
Example implementation, in C, using BSD’s random()
:
for (int column = 0; column < NUM_COLUMNS; column++)
{
field_contents[garbage_row][column] = (random() % NUM_CELL_COLORS) + 1;
}
field_contents[garbage_row][random() % NUM_COLUMNS] = 0;