How victoro94/minesweeper works
Minesweeper is a terminal game implemented with ncurses. The player supplies optional grid, mine, seed, and safe-first-click settings, then moves through the grid, reveals cells, or flags them; the game reports a win or loss and displays the final board. The graph separates the terminal loop, game rules, and board storage/rendering. Source excerpts show the main calls and game logic; relationships beyond those excerpts are omitted.
Main entry points: main.c Game Loop · board.h Cell State · game.c Input Handling · board.c Board Allocation
Components 10
Game Rules
- Option Parsing
src/game.c - Input Handling
src/game.c - Mine Generation
src/game.c - Cell Reveal
src/game.c
Board
- Cell State
src/board.h - Board Allocation
src/board.c - Board Rendering
src/board.c
Other components
- Player
Connections 16
- Player → Game Loop: starts game
README.md - Game Loop → Option Parsing: parses arguments
src/main.c - Game Loop → Board Allocation: creates board
src/main.c - Game Loop → Input Handling: processes keys
src/main.c - Input Handling → Mine Generation: places mines
src/game.c - Input Handling → Cell Reveal: reveals cell
src/game.c - Input Handling → Cell State: updates state
src/game.c - Mine Generation → Cell State: sets mine data
src/game.c - Cell Reveal → Cell State: reads and updates
src/game.c - Game Loop → Win Check: checks outcome
src/main.c - Win Check → Cell State: reveals mines
src/main.c - Game Loop → Board Rendering: prints board
src/main.c - Win Check → Board Rendering: prints result
src/main.c - Board Allocation → Cell State: allocates cells
src/board.c - Board Rendering → Cell State: reads cells
src/board.c - Game Loop → Board Allocation: frees board
src/main.c