University Team Project
Castle Wall
A Java console adaptation of a loop-drawing puzzle with rule validation and a PostgreSQL save system.
Individual contribution
I worked on the puzzle rules and flood-fill validation in Java, contributed to the PostgreSQL save-system proof of concept, and helped model the save and load requirements.
Main functionality
- Draw an orthogonal closed loop through available grid cells. Movement checks handle board bounds and intersections, and flood fill distinguishes the inside from the outside for the puzzle's color rules.
- Start or resume a puzzle through the console menu. The save path stores grid cells and updates the player coordinates. Reload reconstructs the board from stored cell types and colors.
- The prototype SQL defines player, game and board-cell tables and populates example data for persistence testing.
Objective
Adapt the Castle Wall logic puzzle into a Java console application and make its grid and player position recoverable through a relational database.
Architecture
The logical ER model separates game definitions, players, saved boards, cells and statistics, with one-to-many links from saves to cells. The PostgreSQL prototype uses three tables, with player position and statistics fields on the game record. Primary keys identify rows, foreign keys link players to games and games to cells, and CHECK constraints validate player attributes.
Engineering practices
The team mapped save requirements through a normalization workbook and ER diagrams before implementing the prototype schema. JDBC prepared statements retrieve cells and player coordinates. Inserts and upserts persist board cells, while an update records the player position.
Learning and outcomes
I developed core rule checks and the flood-fill algorithm, built database proofs of concept and contributed to the schema, ER modeling and save/load design. The project connected a grid-based game model to a persistent representation of its state.
