Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update KCL docs #300

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions content/pages/docs/kcl/reduce.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn sum(arr) {

/* The above is basically like this pseudo-code:
fn sum(arr):
let sumSoFar = 0
sumSoFar = 0
for i in arr:
sumSoFar = add(sumSoFar, i)
return sumSoFar */
Expand Down Expand Up @@ -96,14 +96,14 @@ fn decagon(radius) {

/* The `decagon` above is basically like this pseudo-code:
fn decagon(radius):
let stepAngle = (1/10) * tau()
let startOfDecagonSketch = startSketchAt([(cos(0)*radius), (sin(0) * radius)])
stepAngle = (1/10) * tau()
startOfDecagonSketch = startSketchAt([(cos(0)*radius), (sin(0) * radius)])

// Here's the reduce part.
let partialDecagon = startOfDecagonSketch
partialDecagon = startOfDecagonSketch
for i in [1..10]:
let x = cos(stepAngle * i) * radius
let y = sin(stepAngle * i) * radius
x = cos(stepAngle * i) * radius
y = sin(stepAngle * i) * radius
partialDecagon = lineTo([x, y], partialDecagon)
fullDecagon = partialDecagon // it's now full
return fullDecagon */
Expand Down
Loading