Skip to content

ArtADnsh/BFS-on-GameOfLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

BFS-on-GameOfLife

A simple C++ console-based implementation of Conway's Game of Life combined with Breadth-First Search (BFS) pathfinding. πŸ“Œ Overview

This project simulates Conway's Game of Life for three iterations, starting from either:

A random initial seed, or

A custom number of alive cells specified by the user.

After the simulation, the program asks for two coordinates representing the start and destination cells. It then uses the BFS algorithm to find the shortest path only through dead cells (#).

🎯 Features

Game of Life Simulation

    Runs for 3 frames.

    Supports random generation or user-defined alive cell count.

Shortest Path Finder

    BFS algorithm implementation.

    Works only on dead cells.

Input Validation

    Prevents invalid coordinates or impossible alive cell counts.

Clean CLI Display

    Board refresh between frames for a smooth view.

πŸ–₯ Example Output Captures - File Explorer 11-Aug-25 7_52_34 PM

πŸ”§ How to Run

1.Compile the program:

g++ GameOfLifeProject.cpp -o game

2.Run:

./game

πŸ“š Algorithms Used

Conway's Game of Life rules:

    A cell with exactly 2 or 3 alive neighbors stays alive.

    Otherwise, it becomes or remains dead.

Breadth-First Search (BFS):

    Finds the shortest path between two points in a grid.

πŸš€ Future Improvements

Add support for wrap-around grid (toroidal map).

Show step-by-step path visualization.

Adjustable simulation speed.

πŸ“ License

This project is open-source and available under the MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages