I made this project during my first semester at my university - with very limited knowledge - in order to respond to an older student's challenge.
The project consists of a simple C program that uses the paint.h and gfx.h header files provided by my university and my personal implementation of linked lists. The program starts drawing the dragon fractal on the terminal. The number of iterations can be changed in the source code.
- C
- paint.h file
- paint.c file
- gfx.h file
- gfx.c file
- Debian 12 (Linux)
- Visual Studio Code
- Oracle VM Virtualbox
Open the folder in Visual Studio Code (make sure that all of the files are in the same folder), open a new terminal, and enter the following command to compile the code:
gcc fractal.c paint.c gfx.c -lX11 -lm -o program -WallNote: "program" is just an arbitrary name I chose for the compiled file, you can change it to whatever you want it to be. Just make sure that when you run the code using ./program, you run it with your own file name instead, like this: ./yourfilename
Final picture after 10 minutes of runtime with size = 4
I am rather disappointed by the fact that my code is so inefficient and unsafe. However, it is worth nothing that this project was more of a proof-of-concept, a challenge by an older student.
Possible issues / ideas for improvement: Perhaps I should change the function return types to 'void', and use a node_t** type as an argument, in order to avoid unneccessarily copying nodes in the memory. I also fail to free the allocated memory at a number of instances.


