- C 89.5%
- JavaScript 4.6%
- CMake 4.2%
- HTML 0.7%
- CSS 0.6%
- Other 0.4%
| ressources | ||
| web | ||
| .clang-format | ||
| .gitignore | ||
| CMakeLists.txt | ||
| game.c | ||
| game.h | ||
| game_aux.c | ||
| game_aux.h | ||
| game_ext.c | ||
| game_ext.h | ||
| game_random.c | ||
| game_sdl.c | ||
| game_sdl.h | ||
| game_solve.c | ||
| game_struct.h | ||
| game_test_archaminade.c | ||
| game_test_niclespinass.c | ||
| game_test_pricaud.c | ||
| game_text.c | ||
| game_tools.c | ||
| game_tools.h | ||
| README.md | ||
| sdl2.cmake | ||
Net
Rules
The game net is a single-player logic puzzle.
The game consists of a 5x5 grid with squares containing pieces, comparable to cables or pipes, which can be rotated by a quarter turn in the clockwise (or anti-clockwise) direction. These pieces have a certain shape (endpoint, segment, corner, or tee) and a certain orientation (N, E, S, W). Each shape consists of one or more arms, connected to the center of the square, called half-edges.
By convention, here is the representation of the pieces based on their shape and orientation that we will use.
Here is the text representation of the pieces, to allow for display in a Linux terminal.
| | N | E | S | W |
| -------- | --- | --- | --- | --- |
| endpoint | ^ | > | v | < |
| segment | | | - | | | - |
| corner | └ | ┌ | ┐ | ┘ |
| tee | ┴ | ├ | ┬ | ┤ |
Here is a representation of the pieces with textures, those will be displayed with an SDL renderer.
Original Rule: According to the Simon Tatham's Portable Puzzle Collection, the game rule is simply stated as follows: Rotate the pieces in the grid squares so that they come together in a single connected network, without loops.
You can try the original game here.
Indeed, by rotating the pieces, it is possible to correctly match the half-edges of two adjacent squares, so that they connect the centers of the squares (or vertices), forming an edge.
Project Architecture
Our project is based on a single library named game library (libgame.a),
whose interface is divided into several header files:
- Basic Game Functions: @ref game.h
- Auxiliary Game Functions: @ref game_aux.h
- Extended Game Functions: @ref game_ext.h
This interface manipulates an opaque data type, that is the structure @ref game, by means of pointers or const pointers (@ref cgame).
About Const Pointer:
- See also: http://www.geeksforgeeks.org/const-qualifier-in-c/
- See also this more technical discussion: http://stackoverflow.com/questions/8504411/typedef-pointer-const-weirdness
Based on this library, our project will provide several programs, including but not limited to the following:
game_text: a simple text-based program to play our game in a terminal ;game_test_XXX: 3 program with many tests to check the validity of the library functions ;game_sdl: a program made to play our game on a SDL renderer with textures
Authors
This project is made by 3 person
Nicolas Lespinasse
Pauline Ricaud
Arthur Chaminade


