Skip to content

Commit

Permalink
README updates and enabled CI build flag in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjmux committed Mar 20, 2024
1 parent 34efdc6 commit 7e75c85
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
#run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTARGET_GROUP=test
run: cmake -B ${{github.workspace}}/build -DTARGET_GROUP=test
run: cmake -B ${{github.workspace}}/build -DTARGET_GROUP=test -DTETRIS_UNIT_TEST_MACRO=ON
# build cmake in build dir with CI unit test flag turned on

- name: Build
# Build your program with the given configuration
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ The game was branched off to it's own repository because the embedded project so
* [ ] fix full lines not being removed
* [ ] fix duplicate colors
* [ ] fix crash on trying to clear line
* figure out what's causing a bunch of out-of-bounds numbers to show up in row 1 of board
* [ ] figure out what's causing a bunch of out-of-bounds numbers to show up in row 1 of board - i think this is a type issue with uint & int types!


> [!WARNING]
> This project is still in active development, bugs are still being found. When this is no longer the case, this notice will be removed.

### Project Goals
This project has several goals.
Expand Down
3 changes: 2 additions & 1 deletion src/driver_tetris.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ int main(void) {
// load game from disk
case 'l':
move = T_NONE;
// IMPLEMENT
break;
default:
move = T_NONE;
Expand Down Expand Up @@ -227,8 +228,8 @@ void print_keypress(enum player_move move) {

/**
* POSIX sleep for `millis` milliseconds
* `man 2 nanosleep`
*/
// `man 2 nanosleep`
void sleep_millis(uint16_t millis) {
struct timespec ts;
ts.tv_sec = 0;
Expand Down
2 changes: 0 additions & 2 deletions test/suite_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ void test_checkSpawnNewPiece(void) {
tg->last_gravity_tick_usec.tv_sec -= 1;
tg->last_gravity_tick_usec.tv_usec -= 100;

// printf("last_grav_tick: %d:%d, tick_rate: %d\n", tg->last_gravity_tick_usec.tv_sec, \
// tg->last_gravity_tick_usec.tv_usec, tg->gravity_tick_rate_usec);

// do gravity should fail since we're at bottom, and
// should change active_piece.falling to false
Expand Down
4 changes: 1 addition & 3 deletions tetris/tetris.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,7 @@ bool check_do_piece_gravity(TetrisGame *tg) {
void clear_rows(TetrisGame *tg, uint8_t top_row, uint8_t num_rows) {
// starting at `row`, go up until you reach cell with value -1
// or the top of the board
//assert(num_rows <= 4 && top_row < TETRIS_ROWS);
assert(num_rows <= 4);
assert(top_row < TETRIS_ROWS);
assert(num_rows <= 4 && top_row < TETRIS_ROWS);

// for each col on the board
for (int col = 0; col < TETRIS_COLS; col++) {
Expand Down

0 comments on commit 7e75c85

Please sign in to comment.