Skip to content

Developed a robust C implementation of a Scrabble-inspired word game. The project features a dynamically resizable board, comprehensive word validation using a large dictionary, and an undo system for moves 😊

Notifications You must be signed in to change notification settings

hasanpeal/Upowords-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Upowords-Game

Description

Upowords-Game is a C implementation of a word-based board game, similar to Scrabble, with advanced features such as dynamic board resizing, undo functionality, and robust word validation. The project is structured for both educational and testing purposes, with a strong focus on modularity and testability.

Features

  • Dynamic 2D board with support for horizontal and vertical word placement
  • Word validation using a large dictionary
  • Undo functionality for moves
  • Extensive automated test suite using GoogleTest
  • Modular codebase with clear separation between game logic and testing

Directory Structure

.
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ include/
β”‚   └── hw3.h                # Main game logic header
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ hw3.c                # Core game logic implementation
β”‚   └── hw3_main.c           # Main entry point for the game
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ boards/              # Sample board input files
β”‚   β”œβ”€β”€ expected_outputs/    # Expected outputs for test cases
β”‚   β”œβ”€β”€ include/
β”‚   β”‚   └── tests_aux.h      # Test helper header
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ tests_*.cpp      # GoogleTest test suites
β”‚   β”‚   β”œβ”€β”€ tests_aux.cpp    # Test helper implementations
β”‚   β”‚   └── standalone_scripts/
β”‚   β”‚       └── *.c          # Standalone test scripts for edge cases
β”‚   └── words.txt            # Dictionary of valid words
└── CSE 220 Homework Assignment #3.pdf # Assignment specification

Build Instructions

  1. Requirements:

    • CMake >= 3.10
    • GCC or Clang (C11/C++14 support)
    • GoogleTest
  2. Build the main game:

    cmake -S . -B build
    cmake --build build
  3. Run the game:

    ./build/hw3_main
  4. Run all tests:

    ./build/run_all_tests
  5. Build and run individual test suites (for CodeGrade):

    cmake -DBUILD_CODEGRADE_TESTS=ON -S . -B build
    cmake --build build
    ./build/tests_multiple_turns

File Descriptions

  • CMakeLists.txt: Build configuration for the project and tests.
  • include/hw3.h: Declares the GameState struct and all core game functions.
  • src/hw3.c: Implements the game logic, including board management, word validation, and undo.
  • src/hw3_main.c: Main program for running the game interactively or via test harness.
  • tests/boards/: Input files representing initial board states for tests.
  • tests/expected_outputs/: Output files with expected board states after moves.
  • tests/include/tests_aux.h: Helper functions for test code.
  • tests/src/tests_*.cpp: GoogleTest-based test suites for various scenarios (valid/invalid moves, undo, etc.).
  • tests/src/standalone_scripts/: Standalone C scripts for edge-case or memory-check testing.
  • tests/words.txt: Dictionary of valid words (2.4MB).

Testing

  • Automated tests are written using GoogleTest and cover a wide range of scenarios, including valid/invalid moves, board resizing, and undo operations.
  • Test outputs are compared against expected outputs for correctness.

License

This project is for educational purposes as part of CSE 220.

About

Developed a robust C implementation of a Scrabble-inspired word game. The project features a dynamically resizable board, comprehensive word validation using a large dictionary, and an undo system for moves 😊

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors