-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecursionVisualizer.html
More file actions
310 lines (303 loc) · 12.6 KB
/
recursionVisualizer.html
File metadata and controls
310 lines (303 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="icon" href="img/favicon.png" type="image/png" />
<title>Daniel Knopf-Recursion Visualizer</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="vendors/linericon/style.css" />
<link rel="stylesheet" href="css/font-awesome.min.css" />
<link rel="stylesheet" href="vendors/owl-carousel/owl.carousel.min.css" />
<link rel="stylesheet" href="vendors/lightbox/simpleLightbox.css" />
<link rel="stylesheet" href="vendors/nice-select/css/nice-select.css" />
<link rel="stylesheet" href="vendors/animate-css/animate.css" />
<link rel="stylesheet" href="vendors/popup/magnific-popup.css" />
<!-- main css -->
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/responsive.css" />
</head>
<body>
<!--================Header Menu Area =================-->
<header class="header_area">
<div class="main_menu">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container box_1620">
<!-- Brand and toggle get grouped for better mobile display -->
<a class="navbar-brand logo_h" href="index.html"
><img class="navbar-logo" src="img/daniel.png" alt=""
/></a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Collect the nav links, forms, and other content for toggling -->
<div
class="collapse navbar-collapse offset"
id="navbarSupportedContent"
>
<ul class="nav navbar-nav menu_nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#experience"
>Experience</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#projects">Projects</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</header>
<!--================Header Menu Area =================-->
<!--================Home Banner Area =================-->
<section class="project_banner_area">
<!-- <div class="box_1620">
<div class="banner_inner d-flex align-items-center">
<div class="container">
<div class="banner_content text-center"></div>
</div>
</div>
</div> -->
</section>
<!--================End Home Banner Area =================-->
<!-- Start Sample Area -->
<section class="main-content">
<div class="container">
<div class="row justify-content-content">
<div class="col-12 text-center">
<h1 class="title-color">Recursion Visualizer</h1>
</div>
</div>
<div class="row justify-content-center pt-5">
<div class="col-10">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/recursionVisualizerIcon.png"
/>
</div>
</div>
</div>
</section>
<section class="sample-text-area">
<div class="container">
<div class="text-left pt-5">
<h3 class="text-heading title_color">Description</h3>
<p class="sample-text">
This project, called Recursion Visualizer, is my final project for a
Creative Coding class I took Fall 2021. It is a program written in
<a href="https://processing.org/">Processing</a> that represents the
way that I think about recursion, illustrated via coloring squares
in a grid. This was my first time doing any sort of art with code,
so it was a blast to create some fun visuals!
</p>
</div>
<div class="text-left pt-5">
<h3 class="text-heading title_color">A Visual Learner</h3>
<p class="sample-text">
I am someone who really needs to visualize things in order to
understand them well. Whenever I try to solve algorithms or plan out
a new project I try to write everything down and draw out pictures
or graphs. When we were assigned to create some sort of "drawing
tool" for this Creative Coding class I tried to think of what was
most meaningful to me and what I found most important. I decided
that for me, the perfect intersection of code and visualization was
recursion.
</p>
</div>
<div class="text-left pt-5">
<h3 class="text-heading title_color">Recursion</h3>
<p class="sample-text">
The way that I tend to think of recursion is that you start with
some big set, and then go down and down the stack until you reach
the base case, at which point you go back up the stack with each
level receiving information from the one before it. The first
reucrsive bit is the overall grid, which is created by recursively
calling a function that draws squares on smaller and smaller
widths/heights, with different origin points. You can click the plus
or minus buttons, or press "p" or "m" to increase or decrease the
recursion level and make the grid bigger or smaller.
<!-- Then, the way
that the actual visualizer works is that when you hold down your
mouse on a square it "grows" a square outward, ring by ring. The
final grown square you get when you release your mouse represents
the set that you start out with in a recursive function. -->
</p>
</div>
<div class="row justify-content-center pt-5">
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/lessRecursion.png"
/>
</div>
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/moreRecursion.png"
/>
</div>
</div>
<div class="text-left pt-5">
<p class="sample-text">
Then, the way that the actual visualizer works is that when you hold
down your mouse on a square it "grows" a square outward, ring by
ring. The final grown square you get when you release your mouse
represents the set that you start out with in a recursive function.
</p>
</div>
<div class="row justify-content-center pt-5">
<div class="col-10">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/grownSquare.png"
/>
</div>
</div>
<div class="text-left pt-5">
<p class="sample-text">
Once the grown square has been created and the mouse is released,
the "recursion" starts. Beginning with the outermost ring,
representing the full version of the set, each ring is colored in,
one at a time, to show the recursive calls getting smaller and
smaller. Once the colored ring hits the center, representing the
base case, a color is chosen and the recursive call stack begins to
be resolved. Each ring is colored in based on the ring before it,
resolving the recursive call stack where each call is based on the
call before it.
</p>
</div>
<div class="row justify-content-center pt-5">
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/recursionDown.png"
/>
</div>
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/recursionUp.png"
/>
</div>
</div>
<div class="text-left pt-5">
<h3 class="text-heading title_color">Rainbow Mode</h3>
<p class="sample-text">
In addition to the pure visualiztion mode, there is also a fun
rainbow mode that allows a bit more flexibility and freedom. In this
mode, the rings are created based on where the mouse is and are
colored randomly, so it isn't a great representation of recursion
but its fun to play with and to create art with!
</p>
</div>
<div class="row justify-content-center pt-5">
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/rainbowMode1.png"
/>
</div>
<div class="col-5 p-5 dual-image">
<img
class="img-fluid"
src="img/project_pages/recursion_visualizer/rainbowMode2.png"
/>
</div>
</div>
<div class="row py-5 justify-content-center">
<div class="col-md-6 col-12 pb-3">
<a
href="https://github.com/dknopf/recursionVisualizer"
class="genric-btn e-large info circle"
>Github</a
>
</div>
</div>
</div>
</section>
<!--================Footer Area =================-->
<footer class="footer_area p_120" id="contact">
<div class="container">
<div class="row footer_inner">
<div class="col-12">
<div class="row">
<div class="col-lg-12 text-center">
<aside class="f_widget social_widget">
<div class="f_title">
<h2>Contact Me!</h2>
</div>
<ul class="list">
<li>
<a href="mailto:danielkn609@gmail.com"
><i class="fa fa-envelope"></i
></a>
</li>
<li>
<a href="https://twitter.com/knopython"
><i class="fa fa-twitter"></i
></a>
</li>
<li>
<a href="https://www.instagram.com/danielkn609/"
><i class="fa fa-instagram"></i
></a>
</li>
<li>
<a href="https://www.linkedin.com/in/daniel-knopf-609/"
><i class="fa fa-linkedin"></i
></a>
</li>
</ul>
</aside>
</div>
</div>
</div>
</div>
</div>
</footer>
<!--================End Footer Area =================-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/popper.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/stellar.js"></script>
<script src="vendors/lightbox/simpleLightbox.min.js"></script>
<script src="vendors/nice-select/js/jquery.nice-select.min.js"></script>
<script src="vendors/isotope/imagesloaded.pkgd.min.js"></script>
<script src="vendors/isotope/isotope.pkgd.min.js"></script>
<script src="vendors/owl-carousel/owl.carousel.min.js"></script>
<script src="vendors/popup/jquery.magnific-popup.min.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="vendors/counter-up/jquery.waypoints.min.js"></script>
<script src="vendors/counter-up/jquery.counterup.min.js"></script>
<script src="js/mail-script.js"></script>
<script src="js/theme.js"></script>
</body>
</html>