B PSU 155 Tetris.pdf
80’s puzzle game in terminal phase
via Makefile, including re, clean and fclean rules
• Your repository must contain the totality of your source files, but no useless files (binary, temp files,
• All the bonus files (including a potential specific Makefile) should be in a directory named bonus.
• Error messages have to be written on the error output, and the program should then exit with the
84 error code (0 if there is no error).
Authorized functions: rand, srand, getopt, and all functions used for PSU projects until this point
The goal of this project is to recreate the Tetris game in a UNIX terminal, with the Gameboy version rules. You have
to use ncurses.
In the folder of your binary, there must be a tetriminos directory, which contains files that describe the game pieces.
- + x
∼/B-PSU-155> ls ./tetriminos/
These files are composed in the following way:
1. on the first line, the size and color of the piece in this format: width height color_code\n (the number of
the color corresponds to the ncurses capacity’s color numbers),
2. on the h following lines (where h is the height of the tetrimino), the piece’s shape composed with asterisks (*)
and spaces (’ ’).
∼/B-PSU-155> cat -e bar.tetrimino
1 4 2$
For instance, these pieces correspond to the opposite
∼/B-PSU-155> cat -e 6.tetrimino
2 3 6$
- + x