-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce max board size to 128x128 for space savings
Max board size used to be 256x256, but since `tetris_location` has to be able to represent negative values for offset calculation, that meant it needed to use `int16_t`. Since the piece array uses 4*4*7 tetris_locations, this added up to a good amount of space. By reducing the max board size to 128x128 (still larger than should ever be needed), `tetris_location` can use a `int8_t`, which means a 50% reduction in needed space. Changes: * Readme reorganized, controls added, more detail * `Cmake options listed in README * Updated `tetris_location` size to uint8_t * Updated check_and_clear_rows() to use the uint8_t values, which meant I could eliminate my array conversion functions since they're no longer needed. Simplification is always good. * Tests updated to reflect the removal of array conversion and the modification of the smallest_in_arr() function signature to use uint8_t instead of int16
- Loading branch information
Showing
6 changed files
with
121 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.