Skip to content

Vladyslaa/Fractals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fractals

Fractals is a console-based C++ program for generating various fractals:

  • Mandelbrot Set
  • Julia Set
  • Sierpinsky Carpet
  • Sierpinsky Triangle

The program is colorful, using ANSI escape codes to display the fractals and messages in the console.


Features

  • Interactive console interface with command support
  • Built-in help and error messages for invalid commands
  • Adjustable fractal parameters:
    • Scale
    • Iteration count
    • For Julia Set: real and imaginary parts of the complex parameter
  • No external libraries required (self-contained)
  • Cross-platform (requires a console with ANSI escape code support)

Installation and Build

  1. Clone the repository:
git clone https://github.com/Vladyslaa/Fractals.git
cd Fractals
  1. Compile with GCC (or any C++ compiler):
g++ -std=c++23 src/Fractals.cpp src/Core.cpp -O3 -o Fractals.exe

-O3 enables optimizations for faster execution. Remove for debugging. C++23 standart is required

  1. Run the program:
./Fractals.exe
  1. Inside the program, type commands to generate fractals. Use the commands command for a list of available commands.

Example Usage

Mandelbrot Set

> mandelbrot 1000 750

Output: Output

Julia Set

> maxiter 500
> julia 1000 500 -0.7 0.27

maxiter sets the maximum iteration depth -0.7 - real part 0.27 - imaginary part

Output: Output

Serpinsky Triangle

> serpinsky triangle 1000 1000

Output: Output

Releases

No releases published

Packages

No packages published

Languages