comparison README.md @ 32:b1a605eb721a

accept user inputs
author Dennis C. M. <dennis@denniscm.com>
date Thu, 29 Jun 2023 19:45:49 +0100
parents 61104b22a25d
children 576431310c8a
comparison
equal deleted inserted replaced
31:61104b22a25d 32:b1a605eb721a
14 ```bash 14 ```bash
15 mkdir build 15 mkdir build
16 cd build 16 cd build
17 cmake .. 17 cmake ..
18 make 18 make
19 ./algo_animator
20 ``` 19 ```
20
21 **Currently I've only tested this project on Linux. However, I would like to prepare it so
22 that it can be used on Mac and Windows. However, my cross-platform experience is almost
23 non-existent. Maybe in the future I'll check how to do it**
24
25 # Run
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
40 ```
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 ![Image 3](repo/3.png)
51
52
53 # Examples
54
55 ## Normal mode
56
57 Just run the program and press `ENTER`
58
59 ## Slow motion
60
61 Use `u` to increase the delay, then `ENTER` to run the algorithm
62 **The delay is applied after each iteration**
63
64 ## Pause mode
65
66 Press `ENTER` then `p`
67
68 ## Sequential mode
69
70 Press `q` then press `ENTER` to visualize the algorithm step by step.