Skip to content

This is a fun little side-project i have been working on for some time. Its a puzzle game. Where numbers will be arranged randomly and you have to move each numbers within limited set of moves and time to get a desired sequence. This game is written completely in C. Was inspired to create this game after i played a similar game in play store.

License

Notifications You must be signed in to change notification settings

user23052036/Puzzle-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Matrix Game

Welcome to the Matrix Game!

This puzzle game challenges players to slide tiles on a grid to arrange them in the correct order. With various levels of difficulty and sub-levels, it offers a stimulating experience suitable for players of all skill levels.

puzzle-game

puzzle-game-play

Instructions

To control the game, use the following keys:

  • Move Right: Press D
  • Move Left: Press A
  • Move Up: Press W
  • Move Down: Press S

Game Levels and Sub-Levels

Levels

  1. Level 1: 60 moves
  2. Level 2: 55 moves
  3. Level 3: 50 moves

Sub-Levels

  • Easy: 3x3 grid
  • Medium: 4x4 grid
  • Hard: 5x5 grid

Functions Overview

Here's an overview of the main functions used in the game:

  • random_assign(int** array, int min, int max, int length): Assigns random numbers to the grid while ensuring no duplicates.

  • match(int** array, int length): Checks if the current arrangement of tiles matches the winning position.

  • display(int** array, int length): Displays the grid in a readable format.

  • algorithm(int** array, char direction, int length): Moves the blank space in the specified direction and updates the grid.

  • assign_num(int** array, int length): Assigns the winning numbers to the grid in ascending order.

  • check_boundary(int** array, int length): Checks if the blank space is within the grid boundaries after a move.

  • free_memory(int** array, int length): Frees the dynamically allocated memory used for the grid.

  • is_unique(int** array, int length, int i, int j, int rand_num): Checks if a number is unique within the grid.

How to Play

  1. Choose a Level: Select your preferred level (1 to 3) with different move limits.
  2. Select a Sub-Level: Choose the grid size (Easy, Medium, Hard).
  3. Start the Game: Press enter to begin and make moves using W, A, S, D.
  4. Win Condition: Arrange the tiles in ascending order to win.
  5. Next Level: If you win, you can proceed to the next level or sub-level.

Contribution

We welcome contributions to improve Matrix Game! If you have any ideas for improvements, new features, or bug fixes, feel free to contribute. Here's how:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature)
  3. Make your changes and commit them (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature)
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is a fun little side-project i have been working on for some time. Its a puzzle game. Where numbers will be arranged randomly and you have to move each numbers within limited set of moves and time to get a desired sequence. This game is written completely in C. Was inspired to create this game after i played a similar game in play store.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published