Exercises
The repository contains example solutions for the Exercises presented in Code as Creative Medium, pp.150-183, by Golan Levin and Tega Brain, MIT Press, 2021.
These solutions were developed and/or ported by Golan Levin and Tega Brain with the assistance of Lingdong Huang, Tatyana Mustakos, Cassie Scheirer, and Xinyi (Joyce) Wang. In some cases and where indicated, solutions have been adapted from code by Dan Shiffman and others.
Wherever possible, we have attempted to provide solutions in all of the following computer programming languages and toolkits. We welcome contributions, additional implementations, and ports to other languages and toolkits.
- Java (Processing)
- Python (Processing.py)
- JavaScript (p5.js)
Acknowledgments
This work was supported by grant #1855045-4-19 from the Media Arts Program of the National Endowment for the Arts; by a grant from the Frank-Ratchye Fund for Art at the Frontier, administered by the Frank-Ratchye STUDIO for Creative Inquiry at Carnegie Mellon University; by support from the Integrative Design, Arts, and Technology (IDeATe) program at CMU; and through graduate assistantships from the Integrated Digital Media program at the Tandon School of Engineering, New York University.
Example Solutions
- Graphic Elements
- Iteration
- 01_simple_iteration_seven_circles
- 02_transitioning_rectangles
- 03_string_art_challenge
- 04_mini_calendar
- 05_receding_landscape
- 06_lines_to_the_cursor
- 07_color_bar_gradient
- 08_dashed_line
- 09_nested_iteration_checkers
- 10_iteration_with_functions
- 11_stochastic_elements
- 12_interrupted_grid
- 13_geometric_progression
- 14_moire_patterns
- 15_recoding_schotter
- 16_hexagonal_grid
- Color
- Conditional Testing
- Unpredictability
- 01_coin_toss
- 02_roll_the_dice
- 03_exquisite_corpse_machine
- 04_intermittent_events
- 05_order_to_chaos
- 06_drunk_walk_1_brownian_motion
- 07_drunk_walk_2_random_lattice_walk
- 08_drunk_walk_3_smoothed_noise
- 09_ten_print
- 10_duotone_truchet_tile_java
- 11_hitomezashi_sashiko_stitching
- 12_noise_mountains
- 13_imaginary_islands
- Arrays
- Time and Interactivity
- Typography
- Curves
- Shapes
- Geometry
- 01_midpoint_of_a_line_segment
- 02_intersection_of_two_rectangles
- 03_construction_of_a_perpendicular
- 04_parallel_polyline
- 05_compass_orientation
- 06_angle_between_three_points
- 07_distance_from_a_point_to_a_line
- 08_intersection_of_two_line_segments
- 09_centroid_of_a_triangle
- 10_triangle_circumcenter
- 11_triangle_orthocenter
- 12_triangle_incenter
- Image
- Visualization
- Text and Language
- 01_string_search
- 02_nonsense_words
- 03_letter_frequency
- 04_letter_pair_frequency
- 05_average_word_length
- 06_sorting_words
- 07_cut-up_machine
- 08_bigram_calculator
- 09_dammit_jim
- 10_knock_knock_joke_generator
- 11_translator_pig_latin
- 12_argots_and_language_games
- 14_rhyming_couplets
- 15_haiku_finder
- 16_markov_text_generator
- 17_limerick
- Simulation
- Machine Learning
- Sound
- Games