Skip to content
← All work

09 · C, first semester

Classic Console Games

Connect Four, Mancala and two puzzles, in plain C.

Four games written in the first semester of university to learn loops, arrays and functions by making something that could actually be played. Kept in the portfolio on purpose: it is where the rest started.

Year
2022
Role
Everything
Stack
C
Languages
  • C100.0%

From the repository

Games
4
Lines of C
~670
Standard headers, nothing else
4
File per game
1

Technical architecture

Four self-contained programs, one .c file each. No shared code on purpose: every game had to be readable on its own.

  1. L1

    Board games

    • connectfour.c
    • mancala.c

    Two-player turn loops over arrays, with move validation and win detection after every turn.

  2. L2

    Puzzles

    • sliding_puzzle.c
    • memory_puzzle.c

    Shuffled boards, move validation and a solved-state check.

Engineering decisions

  • Arrays are the whole engine

    Every board is a plain array and every rule is a loop over it — the point was to feel what indexing and bounds actually cost.

Engineering checklist

The questions a reviewer asks, answered from the code — including the ones where the honest answer is no.

Errors & loggingPartly
Every move is validated before it touches the board; invalid input asks again.
TestsNot yet
Tested by playing them.

What I would change now

  • Mancala came back later in C#, in the practice repository — the same rules, a very different language.

Next project

csharp-practice

Hands-on C# exercises, kept public on purpose.