📅 Date: April 26, 2025

🎙️ Special Guest: Daniel Shiffman (NYU ITP, The Coding Train)

🧠 Theme: Exploring loops, arrays, and text generation in creative coding


https://youtu.be/YD5BZ3LgPf8

recording

🎯 Session Overview

In this session, we delved into the foundational concepts of arrays and loops in p5.js. Participants learned how to store and manipulate data using arrays, iterate through data with loops, and combine these techniques to generate dynamic text and visuals. The session was enriched by a surprise appearance from Daniel Shiffman, who shared his insights on teaching creative coding and integrating AI tools responsibly.


🧩 Key Concepts Explored

1. Arrays and Basic Loops

We began with an introduction to arrays as containers for multiple values, accessed using index numbers. Basic for loops were introduced, highlighting their structure: initialization, condition, and increment. Participants saw how loops can automate repetitive tasks, such as displaying text elements or creating patterns.

Example:

let nouns = ["cat", "dog", "robot"];
text(nouns[0], 50, 50);

2. Text Generation Project

Building on arrays and loops, we explored generating random sentences by selecting elements from arrays of nouns, verbs, and adverbs. This exercise demonstrated how combining arrays with randomization can produce creative and unexpected results.

Key Insight:

Sujay: "If I put this in draw(), the random will keep jumping?"

Saber: "Yes — mousePressed() is better for controlled interaction."

3. Grids and Nested Loops