https://github.com/davphla/wolfram
EPITECH - Implementation of Wolfram’s elementary cellular automaton (made in 2022)
https://github.com/davphla/wolfram
haskell wolfram
Last synced: 8 months ago
JSON representation
EPITECH - Implementation of Wolfram’s elementary cellular automaton (made in 2022)
- Host: GitHub
- URL: https://github.com/davphla/wolfram
- Owner: Davphla
- License: other
- Created: 2025-02-21T22:17:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T16:22:47.000Z (over 1 year ago)
- Last Synced: 2025-10-06T14:48:46.839Z (8 months ago)
- Topics: haskell, wolfram
- Language: Haskell
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# Elementary Cellular Automaton

This project implements Wolfram's Elementary Cellular Automaton in Haskell. The goal is to simulate and display specific cellular automata rules (specifically rule 30, rule 90, and rule 110) in the terminal, based on user-defined parameters such as rule selection, generation number, window size, and translation.
Wolfram's Elementary Cellular Automaton is a class of simple, one-dimensional cellular automata defined by Stephen Wolfram in the 1980s. These automata are designed to explore how complex patterns and behaviors can emerge from simple rules applied to a grid of cells over time.
# Installation
## Prerequisites
Haskell (Stack version 2.1.3 or greater).
Ensure you are using the lts-23.3 resolver for Haskell's Stack.
## Steps to Install:
Clone the repository to your local machine:
```
git clone https://github.com/yourusername/elementary-cellular-automaton.git
cd elementary-cellular-automaton
```
Install the dependencies and build the project using Stack:
stack build
# Usage
To run the program, you will invoke the compiled executable with the desired arguments.
## Syntax:
```
./wolfram --rule --start --lines --window --move
```
## Options:
--rule : The rule number to use for the cellular automaton (mandatory). Options are 30, 90, 110, or any rule between 0 and 255 for bonus functionality.
--start : The generation number at which to start displaying the automaton. Default is 0.
--lines : The number of generations (lines) to display. If not provided, the program will run indefinitely.
--window : The number of cells to display on each line. If even, the central cell will be displayed in the next cell on the right. Default is 80.
--move : A translation applied to the window. If negative, the window moves to the left; if positive, it moves to the right. If not specified or invalid, the program will return an error.
## Example:
To start rule 30 with a window size of 80 and 10 generations:
```
./wolfram --rule 30 --lines 10 --window 80
```
To display 20 generations, starting at generation 5, with a translation to the left:
```
./wolfram --rule 110 --start 5 --lines 20 --window 80 --move -5
```