Coder Social home page Coder Social logo

c-doku's Introduction

C-Doku

Project Description

C-Doku is a C implementation of Sudoku in your very own terminal! The game prints a minimalist visualization of an incomplete board for a player to solve based on the level they chose, and the user can specify a number to input into a specific row and column. The visualization will continue updating based on the user input. The player wins if they complete the board before getting 3 errors!

We used these board puzzles to create our game.

How to Play

The player starts with a partially filled 9x9 board of digit 1-9 to fill in. The player needs to fill each cell with a digit ranging from 1-9 with the following rules:

  1. Every row must have one of each digit (1-9).
  2. Every column must have one of each digit (1-9).
  3. Every 3x3 square within the 9x9 must have one of each digit (1-9).

How the Program Works

  1. Choose difficulty: Player chooses a level (easy, medium hard).
  2. Visualize board: Game displays an incomplete board for the player to complete.
  3. Input move: Player inputs a row, column, and number to add to the board.
    • Move correct -> board updates accordingly
    • Move incorrect -> board does not update & error counter increases by 1
    • Move not valid -> no changes made & player will be prompted to input their move correctly.
  4. Keep trying: The program prompts the player to keep filling the board until an end condition is met.
  5. Win or lose: The game ends when an end condition is met.
    • Win -> board is completely filled with less than 3 errors
    • Lose -> player makes 3 errors before board is completely filled

Dependencies

To play the game, download all the files from our C-Doku repository. You can also download it directly here. You should have the following files:

  • src
    • CMakeLists.txt
    • controller.c
    • controller.h
    • main.c
    • model.c
    • model.h
    • view.c
    • view.h
  • test
    • CMakeLists.txt
    • test_controller.c
    • test_model.c
    • test_view.c
  • .gitignore
  • CMakeLists.txt
  • README.md

This code only relies on C standard libraries, which means that you won't need to worry about importing any additional libraries.

Instructions

To get started, please ensure that you are using a Unix environment to follow the instructions below.

Once you have downloaded the files from the repository, navigate to the C-Doku directory. From there, you can create a build directory and compile the program by running the following commands in your terminal:

$ mkdir build
$ cd build
$ cmake ..
$ make clean
$ make

Then run the following command to start the game:

$ ./src/run_sudoku

Have fun playing the game!

c-doku's People

Contributors

olgapidruchna avatar mtong1 avatar allyson-hur avatar angrocki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.