Back to Lesson Plan

Sample ChatGPT Prompt:
Generate a p5.js sketch file that draws filled polygons on a 400x400 canvas.

Create one range control slider that allows the number of points on
the polygon to vary from 3 to 10 in steps of 1. Make the default be 10.

Create a second range control slider that allows the color inside the polygon
to be changed to any color. Make the default value be 170 (blue).

Make the sliders be the width of the canvas less the width of the
labels and values. Place the sliders at the bottom
of the canvas 100 points in from the left.

Use the text() function at the end of the draw() function to display the
name and current values of the sliders in the bottom left of the screen.