This is the homepage of the project. The repository contains two distinct Python Projects, Combining Cellular Automata with Game Development. The projects are as follows:
Matplotlib
and NumPy
. This
project
includes additional features like reset, hint, next, and undo buttons.Both projects utilize basic Python libraries such as NumPy and Matplotlib, and were originally designed to run in a local environment.
Note: The projects can now be run via the browser. For more information, please visit the GitHup repo for this repository.
A Python implementation of the classic Minesweeper game with a graphical user interface (GUI) using Matplotlib and NumPy. This project includes additional features like reset, hint, next, and undo buttons.
git clone https://github.com/Dor-sketch/CrossFinder
cd CrossFinder
pip install -r requirements.txt
python3 mines.py
Objective: Reveal all non-mine cells without hitting a mine.
Cells:
Buttons:
The states of each cell are reduced to three categories: hidden, flagged, or revealed. The solver iterates over the visible grid, applies game rules, and reveals cells based on the rules. The solver uses a custom rule set inspired by Conway's Game of Life to reveal hidden cells.
Note: The solver might not proceed without revealing more cells that might be mines.
CrossFinder is an innovative variant of Conway's Game of Life, meticulously engineered to detect and manipulate cross shapes within a grid environment. Diverging from the conventional Game of Life, CrossFinder integrates additional states and tailor-made rules aimed at pinpointing and transforming cross-shaped patterns.
This ingenious program was conceived as a response to problem 28 in the seminal book Biological Computation by Ehud Lamm and Ron Unger. It was developed as a key component of the "Biological Computation" course at the Open University of Israel. The solution, amalgamated with another program (simulationEarth), was submitted and acclaimed with a perfect score of 100.
0
: Dead1
: Alive2
: Red, marking cells that are part of a cross or interact with cross
shapes
3
: Blue, indicating the propagation of a wave from the edges of a cross
towards
its centerThe CrossFinder program operates on a grid where cells can transition between states based on
their
neighbors. The primary focus is on identifying and marking cross shapes. A cross is defined as a
vertical and horizontal line intersecting at a central cell, all of which are alive
(1
).
When a cross is detected, the cells constituting the cross transition to the state
2
(red),
signifying the first wave of detection.
Visualization of the CrossFinder simulation waves: Algorithm identify target '+' shape
2
state) targets cells that form the cross structure. When a
pattern
matching a part of the cross is found, those cells transition to the red state.3
state) begins at the edges of the cross and moves towards
the
center, marking the progression of the detection process.The CrossFinder program operates on a grid where cells can transition between states based on
their
neighbors. The primary focus is on identifying and marking cross shapes. A cross is defined as a
vertical and horizontal line intersecting at a central cell, all of which are alive
(1
).
When a cross is detected, the cells constituting the cross transition to the state
2
(red),
signifying the first wave of detection.
Visualization of the CrossFinder simulation waves: Algorithm identify target '+' shape
2
state) targets cells that form the cross structure. When a
pattern
matching a part of the cross is found, those cells transition to the red state.3
state) begins at the edges of the cross and moves towards
the
center, marking the progression of the detection process.The program was tested on python 3.11
and requires the following packages:
numpy
: For grid manipulation and operationsmatplotlib
: For visualizationUse the following command to run the program:
python3 cross_game.py
If more than one python version is installed, try using the following command:
python3.11 cross_game.py
The program supports both randomized initial states (press reset
button) and user
interactive controls (press the matrix cells to change their state).
For the next generation, press next Day
button.
Switch to Conway's Game of Life from the CrossFinder and vice versa by simply clicking the
mode
button.
Initial state | 2 | 3 | 4 | Finale state |
---|---|---|---|---|
Initial state - 2nd example: 2 valid crosses in different sizes
Initial state | 2 | 3 | Finale state |
---|---|---|---|
Complex destruction example - no valid crosses
1 | 2 | 3 | 4 |
---|---|---|---|
5 | 6 | 7 | 8 |
10 | 11 | 12 | Finale state |
Contributions are welcome! Please open an issue or submit a pull request with any improvements or bug fixes.
Here are some ways you can contribute to the Minesweeper:
Enhancement Category | Description | Status |
---|---|---|
Add new features to the game | e.g., timer, high scores, custom grid sizes. Create a new game mode or difficulty level. | Not Started |
GUI enhancements | Implement additional buttons or functionalities to enhance the gameplay experience.
Modified
matplotlib default toolbar to include additional buttons for game controls.
|
Not Started |
Algorithm improvements | Optimize the game logic or implement new rules for revealing cells. | Not Started |
Probabilistic solver | Develop a solver that uses probability to determine the best move. This is particularly useful in cases where no safe moves are available. This can be implemented using a Monte Carlo simulation or other probabilistic methods, such as Bayesian inference or Markov chains. | Not Started |
Image recognition solver | Create a solver that uses image recognition techniques to analyze game boards as an
input image
and determine the best move. This can be implemented using computer vision libraries
such as
OpenCV or TensorFlow .
|
Not Started |
This project is licensed under the MIT License - see the LICENSE file for details.