Mercurial > public > algo-animator
annotate README.md @ 36:8425cf9337aa
add videos
committer: GitHub <noreply@github.com>
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 29 Jun 2023 20:08:07 +0100 |
parents | 05cb3d7b607c |
children | 0e2121235413 |
rev | line source |
---|---|
4
035d3880da04
render text with number of elements on screen
Dennis C. M. <dennis@denniscm.com>
parents:
diff
changeset
|
1 # algo-animator |
035d3880da04
render text with number of elements on screen
Dennis C. M. <dennis@denniscm.com>
parents:
diff
changeset
|
2 |
31
61104b22a25d
I think it is working now...
Dennis C. M. <dennis@denniscm.com>
parents:
28
diff
changeset
|
3 An interactive program to visualize sorting algorithms. |
61104b22a25d
I think it is working now...
Dennis C. M. <dennis@denniscm.com>
parents:
28
diff
changeset
|
4 |
61104b22a25d
I think it is working now...
Dennis C. M. <dennis@denniscm.com>
parents:
28
diff
changeset
|
5 This project is inspired by - off course - the video by Timo Bingmann called |
61104b22a25d
I think it is working now...
Dennis C. M. <dennis@denniscm.com>
parents:
28
diff
changeset
|
6 [15 sorting algorithms in 6 minutes](https://www.youtube.com/watch?v=kPRA0W1kECg). |
21 | 7 |
24 | 8  |
26 | 9  |
24 | 10 |
31
61104b22a25d
I think it is working now...
Dennis C. M. <dennis@denniscm.com>
parents:
28
diff
changeset
|
11 |
21 | 12 ## Compile |
13 | |
4
035d3880da04
render text with number of elements on screen
Dennis C. M. <dennis@denniscm.com>
parents:
diff
changeset
|
14 ```bash |
28 | 15 mkdir build |
16 cd build | |
17 cmake .. | |
18 make | |
32 | 19 ``` |
20 | |
33 | 21 *Currently I've only tested this project on Linux. However, I would like to prepare it so |
32 | 22 that it can be used on Mac and Windows. However, my cross-platform experience is almost |
33 | 23 non-existent. Maybe in the future I'll check how to do it* |
32 | 24 |
33 | 25 ## Run |
32 | 26 |
27 To customize the program you can pass the following arguments. | |
28 | |
29 ```bash | |
30 ./algo_animator WINDOW_WIDTH WINDOW_HEIGHT RECTANGLE_WIDTH SPACE_BETWEEN_RECTANGLES | |
31 ``` | |
32 | |
33 The default values are: | |
34 | |
35 ```bash | |
36 WINDOW_WIDTH = 1920 | |
37 WINDOW_HEIGHT = 1080 | |
38 RECTANGLE_WIDTH = 5 | |
39 SPACE_BETWEEN_RECTANGLES = 1 | |
4
035d3880da04
render text with number of elements on screen
Dennis C. M. <dennis@denniscm.com>
parents:
diff
changeset
|
40 ``` |
32 | 41 |
42 Run the program in a window with width of 1920 pixels and height of 1080 pixels, | |
43 fit the screen with rectangles with width of 50 pixels, and add a space between | |
44 rectangles of 3 pixels. | |
45 | |
46 ```bash | |
47 ./algo_animator 1920 1080 50 3 | |
48 ``` | |
49 | |
50  | |
51 | |
52 | |
33 | 53 ## Examples |
32 | 54 |
33 | 55 ### Normal mode |
32 | 56 |
36 | 57 Just run the program and press `ENTER` |
58 [Video.webm](https://github.com/denniscmartin/algo-animator/assets/66180929/f75366b4-b8ba-421e-8c1e-f43727a67b4f) | |
32 | 59 |
33 | 60 ### Slow motion |
32 | 61 |
62 Use `u` to increase the delay, then `ENTER` to run the algorithm | |
36 | 63 *The delay is applied after each iteration* |
64 [slow_motion.webm](https://github.com/denniscmartin/algo-animator/assets/66180929/b3bcde87-2680-4667-98be-3b3946712254) | |
32 | 65 |
33 | 66 ### Pause mode |
32 | 67 |
36 | 68 Press `ENTER` then `p` |
69 [pause_mode.webm](https://github.com/denniscmartin/algo-animator/assets/66180929/6a3ff80c-56dc-4b1a-a811-e3649fe2edde) | |
32 | 70 |
33 | 71 ### Sequential mode |
32 | 72 |
36 | 73 Press `q` then press `ENTER` to visualize the algorithm step by step. |
74 [sequential_mode.webm](https://github.com/denniscmartin/algo-animator/assets/66180929/743c00d8-5236-437d-85ad-b139611175ef) | |
75 |