Skip to content

Commit

Permalink
first batch of reformat space and parens
Browse files Browse the repository at this point in the history
  • Loading branch information
ganicke committed Aug 15, 2024
1 parent f419496 commit cfa5547
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 94 deletions.
12 changes: 6 additions & 6 deletions docs/projects/stopwatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project turns the @boardname@ into a simple stopwatch. Pressing **A** start
Use an event to run code when ``||input:button A is pressed||``.

```blocks
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
})
```

Expand All @@ -22,7 +22,7 @@ in a variable ``||variables:start||``. This is the start time.

```blocks
let start = 0
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
start = input.runningTime()
})
```
Expand All @@ -32,7 +32,7 @@ input.onButtonPressed(Button.A, function () {
Add an event to run code when ``||input:button B is pressed||``.

```blocks
input.onButtonPressed(Button.B, function () {
input.onButtonPressed(Button.B, function() {
})
```

Expand All @@ -43,7 +43,7 @@ and ``||variables:value||`` time. This is the elapsed millisecond since pressing

```blocks
let start = 0;
input.onButtonPressed(Button.B, function () {
input.onButtonPressed(Button.B, function() {
let elapsed = input.runningTime() - start;
})
```
Expand All @@ -55,7 +55,7 @@ Use ``||Math:integer division||`` to divide ``||variables:elapsed||`` by ``1000`

```blocks
let start = 0;
input.onButtonPressed(Button.B, function () {
input.onButtonPressed(Button.B, function() {
let elapsed = input.runningTime() - start;
basic.showNumber(Math.idiv(elapsed, 1000))
})
Expand All @@ -70,5 +70,5 @@ Try your program in the simulator. Press **A** to start the stopwatch and press
If you have a @boardname@ connected, click ``|Download|`` to transfer your code!

```template
input.onButtonPressed(Button.A, function () {})
input.onButtonPressed(Button.A, function() {})
```
12 changes: 6 additions & 6 deletions docs/projects/tele-potato.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ To make the game less predictable, we use the ``||math:pick random||`` block to

```blocks
let potato = 0
input.onButtonPressed(Button.AB, function () {
input.onButtonPressed(Button.AB, function() {
potato = randint(10, 20)
})
```
Expand All @@ -67,7 +67,7 @@ we have the potato and we can send it. After sending it, we set the **potato** v

```blocks
let potato = 0
input.onGesture(Gesture.Shake, function () {
input.onGesture(Gesture.Shake, function() {
if (potato > 0) {
radio.sendNumber(potato)
potato = -1
Expand Down Expand Up @@ -97,7 +97,7 @@ Making the clock tick down is done with a ``||loops:forever||`` loop.

```blocks
let potato = 0
basic.forever(function () {
basic.forever(function() {
if (potato == 0) {
basic.showIcon(IconNames.Skull)
}
Expand All @@ -122,18 +122,18 @@ let potato = 0
radio.onReceivedNumber(function (receivedNumber) {
potato = receivedNumber
})
input.onGesture(Gesture.Shake, function () {
input.onGesture(Gesture.Shake, function() {
if (potato > 0) {
radio.sendNumber(potato)
potato = -1
}
})
input.onButtonPressed(Button.AB, function () {
input.onButtonPressed(Button.AB, function() {
potato = randint(10, 20)
})
radio.setGroup(1)
potato = -1
basic.forever(function () {
basic.forever(function() {
if (potato == 0) {
basic.showIcon(IconNames.Skull)
}
Expand Down
12 changes: 6 additions & 6 deletions docs/projects/timing-gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ basic.showLeds(`
. . . . .
. . . . .
`)
input.onPinPressed(TouchPin.P0, function () {})
input.onPinPressed(TouchPin.P0, function() {})
let t = 0
input.runningTime()
t - 1
Expand Down Expand Up @@ -101,7 +101,7 @@ basic.showLeds(`
. . . . .
. . . . .
`)
input.onPinPressed(TouchPin.P0, function () {
input.onPinPressed(TouchPin.P0, function() {
basic.showLeds(`
# . . . .
# . . . .
Expand Down Expand Up @@ -156,7 +156,7 @@ basic.showLeds(`
. . . . .
. . . . .
`)
input.onPinPressed(TouchPin.P0, function () {
input.onPinPressed(TouchPin.P0, function() {
basic.showLeds(`
# . . . .
# . . . .
Expand All @@ -165,7 +165,7 @@ input.onPinPressed(TouchPin.P0, function () {
# . . . .
`)
})
input.onPinPressed(TouchPin.P1, function () {
input.onPinPressed(TouchPin.P1, function() {
basic.showLeds(`
# . . . #
# . . . #
Expand Down Expand Up @@ -195,7 +195,7 @@ basic.showLeds(`
. . . . .
. . . . .
`)
input.onPinPressed(TouchPin.P0, function () {
input.onPinPressed(TouchPin.P0, function() {
t0 = control.eventTimestamp()
basic.showLeds(`
# . . . .
Expand All @@ -205,7 +205,7 @@ input.onPinPressed(TouchPin.P0, function () {
# . . . .
`)
})
input.onPinPressed(TouchPin.P1, function () {
input.onPinPressed(TouchPin.P1, function() {
t1 = control.eventTimestamp()
basic.showLeds(`
# . . . #
Expand Down
4 changes: 2 additions & 2 deletions docs/projects/tug-of-led.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add an event on ``||input:button A pressed||`` to change the ``||variables:rope|

```blocks
let rope = 2
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
rope += -0.1
})
```
Expand All @@ -46,7 +46,7 @@ Add an event on ``||input:button B pressed||`` to change the ``||variables:rope|

```blocks
let rope = 2
input.onButtonPressed(Button.B, function () {
input.onButtonPressed(Button.B, function() {
rope += 0.1
})
```
Expand Down
2 changes: 1 addition & 1 deletion docs/projects/turtle-scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The turtle scans the display over and over again.
turtle.setPosition(0, 0)
turtle.turnRight()
turtle.setSpeed(20)
basic.forever(function () {
basic.forever(function() {
turtle.forward(4)
turtle.turnRight()
turtle.forward(1)
Expand Down
2 changes: 1 addition & 1 deletion docs/projects/turtle-spiral.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A turtle that spirals into the center of the display and back out again.
```blocks
turtle.setPosition(0, 0)
turtle.turnRight()
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index <= 4; index++) {
turtle.forward(4 - index)
turtle.turnRight()
Expand Down
20 changes: 10 additions & 10 deletions docs/projects/v2-blow-away.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ basic.showIcon(IconNames.Ghost)
💡 Why do we need a [__*repeat loop*__](#repeatLoop "repeat code for a given number of times") when we already have a ``forever`` container? Because ``forever`` has an embedded delay that we want to avoid!

```blocks
basic.forever(function () {
basic.forever(function() {
// @highlight
for (let index = 0; index < 4; index++) {
Expand All @@ -46,7 +46,7 @@ Haven hates noise and will blow away if things get too loud. Let's use an [__*if
► Snap ``||logic:<[0] [=] [0]>||`` in to **replace** the ``||logic:<true>||`` condition for your ``||logic:if then||`` statement.

```blocks
basic.forever(function () {
basic.forever(function() {
// @highlight
for (let index = 0; index < 4; index++) {
// @highlight
Expand All @@ -67,7 +67,7 @@ We'll be using a [__*sound threshold*__](#soundThreshold "a number for how loud
💡 This means Haven will hear any sound above ``128``.

```blocks
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
// @highlight
if (input.soundLevel() > 128) {
Expand Down Expand Up @@ -96,7 +96,7 @@ To show Haven is blowing away, we want to move a random set of lights sideways.

```blocks
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
// @highlight
Expand All @@ -116,7 +116,7 @@ basic.forever(function () {
```blocks
let col = 0
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand All @@ -138,7 +138,7 @@ Time to move some lights around!
```blocks
let col = 0
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand All @@ -160,7 +160,7 @@ To create the animation effect of Haven blowing away, we will turn off (or ``unp
```blocks
let col = 0
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand All @@ -187,7 +187,7 @@ Notice how you have **three** blocks from the ``||led:Led||`` category. All thre
```blocks
let col = 0
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand All @@ -214,7 +214,7 @@ Right now, we are unplotting and replotting in the same spot. What we want to do
```blocks
let col = 0
let row = 0
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand Down Expand Up @@ -242,7 +242,7 @@ Check out the simulator!
let col = 0
let row = 0
basic.showIcon(IconNames.Ghost)
basic.forever(function () {
basic.forever(function() {
for (let index = 0; index < 4; index++) {
if (input.soundLevel() > 128) {
row = randint(0, 4)
Expand Down
18 changes: 9 additions & 9 deletions docs/projects/v2-cat-napping.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Let's give Lychee some control over when she wants to start and stop logging dat

```blocks
let logging = false
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
logging = !(logging)
})
```
Expand All @@ -44,7 +44,7 @@ It would help to know when the @boardname@ is logging data and when it isn't. Fo

```blocks
let logging = false
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
logging = !(logging)
if (logging) {
} else {
Expand All @@ -60,7 +60,7 @@ input.onButtonPressed(Button.A, function () {

```blocks
let logging = false
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
logging = !(logging)
if (logging) {
basic.showIcon(IconNames.Target)
Expand All @@ -78,7 +78,7 @@ Let's now add an auditory indicator that your @boardname@ is logging data!

```blocks
let logging = false
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
logging = !(logging)
if (logging) {
basic.showIcon(IconNames.Target)
Expand All @@ -94,7 +94,7 @@ input.onButtonPressed(Button.A, function () {

```blocks
let logging = false
input.onButtonPressed(Button.A, function () {
input.onButtonPressed(Button.A, function() {
logging = !(logging)
if (logging) {
basic.showIcon(IconNames.Target)
Expand All @@ -114,7 +114,7 @@ Let's set up the data logging for Lychee! In order to get Lychee a good amount o
💡 1 minute is equivalent to 60000ms, which is what the number will automatically change to.

```blocks
loops.everyInterval(60000, function () {
loops.everyInterval(60000, function() {
})
```

Expand All @@ -127,7 +127,7 @@ Now, let's use an [__*if then*__](#ifthen "runs some code if a boolean condition

```blocks
let logging = false
loops.everyInterval(60000, function () {
loops.everyInterval(60000, function() {
if (logging) {
}
})
Expand All @@ -143,7 +143,7 @@ Lychee loves her sun spots because they provide a nice, sunny and warm place to

```blocks
let logging = false
loops.everyInterval(60000, function () {
loops.everyInterval(60000, function() {
if (logging) {
//@highlight
datalogger.log(
Expand All @@ -161,7 +161,7 @@ loops.everyInterval(60000, function () {

```blocks
let logging = false
loops.everyInterval(60000, function () {
loops.everyInterval(60000, function() {
if (logging) {
//@highlight
datalogger.log(
Expand Down
Loading

0 comments on commit cfa5547

Please sign in to comment.