From 29202eb914269ac5826627c64ccb961799e981ea Mon Sep 17 00:00:00 2001 From: Kharec Date: Fri, 14 Nov 2025 22:32:43 +0100 Subject: [PATCH] docs: update readme --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87a9ff5..ee19f8a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,36 @@ -# drop4 +# Drop4 -Puissance 4 written in C \ No newline at end of file +A simple implementation of the game Puissance 4, written in C. + +Why ? Because I got bored on friday night. + +## Implementation details + +The board is represented as a 2D array of integers. + +The last played piece is stored in the `last_row` and `last_col` variables, allowing us to efficiently check for a win by examining lines extending from that position in 4 directions (horizontal, vertical, and both diagonals). + +Game is a struct with the board, the current player, and the last played piece. + +What else... I guess input handling is prettty robust, I check most of the possible edge cases. + +## Rules + +The game is played on a 6x7 grid. + +The players take turns dropping their pieces into the grid. + +The first player to get 4 pieces in a row (horizontally, vertically, or diagonally) wins. + +## How to play + +Just compile and run the program. + +```bash +make +./drop4 +``` + +## License + +BSD 3-Clause License \ No newline at end of file