Skip to content

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

Repository files navigation

Fibonacci: The Grid Puzzle Game

Welcome to Fibonacci: The Grid Puzzle Game, a strategic and mathematical puzzle where you clear the grid by aligning Fibonacci numbers. This project was implemented as part of a programming assignment and serves as an engaging introduction to game development, strategic planning, and React. You can view and use the project live at https://fibonacci-game-two.vercel.app/

🧩 Game Instructions

Dive into the world of Fibonacci with this unique puzzle game! The rules are simple:

  1. Grid Setup: Start with a 50x50 grid.
  2. Incrementing Cells:
    • Click on a cell to increment its value by 1.
    • All other cells in the same row and column will also increment by 1.
    • If a cell is empty, it is set to 1.
  3. Clearing Fibonacci Numbers:
    • Align 5 consecutive Fibonacci numbers in a row or column to clear them from the grid.
    • Fibonacci numbers include: 1, 1, 2, 3, 5, 8, 13, ....
  4. Scoring:
    • Points are awarded based on the Fibonacci numbers you clear.
    • Plan wisely to set up chain reactions for higher scores.

Objective

Clear the grid, maximize your score, and test your strategic thinking. Good luck!


🚀 Features

  • Dynamic Gameplay: A 50x50 grid with responsive controls and real-time updates.
  • Strategic Mechanics: Increment cells, align Fibonacci numbers, and plan chain reactions.
  • Score Tracking: Earn points based on the cleared Fibonacci numbers.
  • Responsive UI: Built with React for a seamless and interactive experience.
  • Customizable: Easily scalable for different grid sizes or rules.

✨ Highlights of the Code

Key Functionalities

  • Dynamic Fibonacci Detection:

    • Automatically detects and clears 5 consecutive Fibonacci numbers in rows and columns.
    • Fibonacci detection is optimized for performance on a 50x50 grid.
  • Real-Time Score Updates:

    • Score updates dynamically based on the Fibonacci numbers cleared.
  • CSS Animations:

    • Cells animate when cleared, adding a visual flair to gameplay.

Core Components

  • Modal: A welcoming instruction modal to guide new players.
  • Game Logic: Efficient handling of grid updates, Fibonacci checks, and cell clearing.
  • Responsive Grid: A dynamically rendered 50x50 grid.

🧮 Fibonacci Logic Example

If the following row is present:

1 1 2 3 5

The game detects the Fibonacci sequence (1, 1, 2, 3, 5) and clears it.


🔗 Resources


About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages