Skip to content

Commit

Permalink
Update rectangle instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Jan 15, 2025
1 parent a79f150 commit 05a354b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"function": "main",
"checks": [
{
"name": "getRectangleAt(0, 0, undefined, 100)",
"name": "getRectangleAt(1, 0, undefined, 100)",
"matcher": "toExist",
"error_html": "The first rectangle is missing"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ The rainbow is made up of lots of bars.

- The rainbow is made up of `100` bars, each with a width of `1`, starting at the top and being `100` high.
- The first bar should have an `x` of 0, and the final bar should have an `x` of 99.
- You need to set variables for `x` and for the `hue` of the color (both starting at `0`)
- You will need a variable for `x`. When choosing its initial value, remember that it will be increased in the `repeat` block BEFORE drawing.
- You also need a variable for the `hue` of the color (set initially to `0`)
- You need to write a repeat loop that repeats 100 times.
- In each iteration of the repeat loop you need to increase `x` by 1 and increase the hue by `3`.
- You then need to use the `fill_color_hsl` (with saturation and luminance set around 50), and `rectangle` functions to draw.

Use the scrubber (the play bar at the bottom right) and the toggle switch next to it to check the inputs that are going into the functions.

The functions used in this exercise are:

- `rectangle(x, y, width, height)`
Expand Down
8 changes: 5 additions & 3 deletions bootcamp_content/projects/drawing/exercises/rainbow/stub.jiki
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// TODO: Set the variables
set x to 0
// TODO: Set the x variable to a good initial value
// Remember that will be updated BEFORE you draw.
set x to

set hue to 0

repeat 100 times do
// Change the variables
// TODO: Change the variables

// TODO: Update the color

Expand Down

0 comments on commit 05a354b

Please sign in to comment.