Skip to content

COMP603 Software Product - Sudoku Game 1/2 (CUI). Grade: A+

Notifications You must be signed in to change notification settings

olafwrieden/sudoku-cui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku CUI Java Game

As part of my Computer Science Degree, one of my assignments was to design and build a software product - a game.

The Design Brief

This project contains two stages:

  1. In Stage 1 (this repo), you will need to develop a Command-line User Interface (CUI) version of the product. You will need to use text files to store input and output data from the program.
  2. In Stage 2, you will upgrade the product to a Graphical User Interface (GUI) version. Meanwhile, you will include a Database component to the product, implement design patterns and include necessary unit tests.
  • Must be developed using Java in the NetBeans IDE.
  • Be bug-free and feature robust error handling.
  • Should be easy to build (no complex build configurations).
Expand Criteria & Requirements

Completed Requirement
✔️ User Interface (CUI)
  • Clear and well-designed interface
  • The program can handle users’ inputs from the CUI properly
  • The interface is easy for users to interact with
✔️ File IO
  • The program input and output data from/to text files successfully
✔️ Software functionality and usability
  • The program is easy to compile and run without any manual configurations (e.g. set up input/output files, import .jar files, etc.)
  • The program can be easily interacted with without any errors
  • The complexity of the functionality
✔️ Software design & implementation
  • The program can be compiled successfully
  • Highly readable code
  • Meaningful and appropriate comments
  • Executes without runtime errors
  • Robust error handling
  • Clear class structure
  • Complexity and robustness of the functionality

Not using NetBeans IDE?

If you are not using the NetBeans IDE, you may find that the Sudoku grid does not render the red (locked cells) color correctly. I have included a fix in the Cell.java class.

Show Fix for Other IDEs

@Override
public String toString() {
  if (this.isLocked()) {
    // Uncomment the following line if you don't use NetBeans:
    //return "[" + getUserValue() + "]";

    // NetBeans only! Print locked/generated cells in red:
    return "[" + COLOUR_RED + getUserValue() + COLOUR_RESET + "]";
  }
  return ("[" + (isEmpty() ? "_" : getUserValue()) + "]");
}

Game Overview

Main Menu

The Main Menu is the very first step view presented to the player. It allows 4 possible options, to start or continue a game, to show the sudoku rules or to exit the game completely.

Main Menu

Game Menu

Inside the Game Menu, the user is presented with game-related options. To either place or remove a digit, exit the current game with or without saving it's state, or whether the player requires a hint (easy here, they're finite!)

Game Menu

Cell Interaction

To edit a cell, it must be specified by the user. This Cell Interaction restricts the user to only valid options (aligned with the traditional Sudoku rules).

Cell Interaction

Saving a Game

Sudoku grids may take a while to complete depending on the player's chosen difficulty level, therefore the current game can be saved, and imported next time. Careful though, only one game can be saved at a time!

Exporting Sudoku

Completed a Challenge?

After the player fills out the Sudoku grid, the challenge is over and a fun-fact is displayed.

Sudoku Complete

See something that can be improved?

While this is not an active project of mine, I would love to hear from you. Feel free to submit a Pull Request if you can improve this repository, or open an issue should you encounter a bug. 🐞

Releases

No releases published

Packages

No packages published

Languages