Skip to content

rishitnanda/twixt_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid Game

  • Name: Rishit Nanda
  • Roll No: 2025111008

Simple interactive terminal grid game in C. Players place colored dots on a 24×24 board.

  • RED: even turns (0, 2, 4, ...)
  • BLUE: odd turns (1, 3, 5, ...)

Board & Coordinates

  • Board size: 24 × 24
  • Rows and columns are numbered 1-24 (enter coordinates in that range)
  • Enter -1 -1 to quit

Movement restrictions

  • RED cannot place on columns 1 or 24.
  • BLUE cannot place on rows 1 or 24.
  • A move is invalid if:
    • It's outside 1-24
    • The cell is already occupied
    • It violates the color-specific restriction

Gameplay

  • Players alternate placing colored dots on the board
  • When a dot is placed, the game automatically creates edges (connections) to adjacent dots of the same color
  • Adjacent means knight's move distance (like in chess: 2 squares in one direction, 1 square perpendicular)
  • Edges cannot cross each other - if a potential edge would intersect an existing edge, it won't be created
  • RED wins by creating a connected path from row 1 to row 24 (1/2-23/24 also works as its trivial that blue's path is now blocked)
  • BLUE wins by creating a connected path from column 1 to column 24 (1/2-23/24 also works as its trivial that red's path is now blocked)
  • A connected path means dots linked by edges, allowing you to traverse from one winning zone to the other

Build & run

  • Build: make
  • Run: make run or ./game
  • Clean build artifacts: make clean

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published