diff --git a/docs/calliope/arbeitsheft/42-2_orakel.md b/docs/calliope/arbeitsheft/42-2_orakel.md index 8e872de1a..75010ced7 100644 --- a/docs/calliope/arbeitsheft/42-2_orakel.md +++ b/docs/calliope/arbeitsheft/42-2_orakel.md @@ -1,17 +1,18 @@ # 42 2 Oracle ```ghost -let Zufall = 0 +let zufall = 0 input.onGesture(Gesture.Shake, function () { -Zufall = randint(0, 2) -if (Zufall == 1) { - basic.showString("Ja") -} -if (Zufall == 2) { - basic.showString("Nein") -} -if (Zufall == 3) { - basic.showString("Vielleicht") + zufall = randint(0, 2) + if (zufall == 1) { + basic.showString("Ja") + } + if (zufall == 2) { + basic.showString("Nein") + } + if (zufall == 3) { + basic.showString("Vielleicht") + } } ``` diff --git a/docs/calliope/arbeitsheft/49-1_schaetzspiel.md b/docs/calliope/arbeitsheft/49-1_schaetzspiel.md index 56cafb612..25b66139d 100644 --- a/docs/calliope/arbeitsheft/49-1_schaetzspiel.md +++ b/docs/calliope/arbeitsheft/49-1_schaetzspiel.md @@ -1,12 +1,12 @@ # 49 1 Estimation game ```ghost -let Entfernung = 0 +let distance = 0 input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), function () { - Entfernung = Math.round(grove.measureInCentimeters(DigitalPin.C16)) + distance = Math.round(grove.measureInCentimeters(DigitalPin.C16)) }) input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), function () { - basic.showNumber(Entfernung) + basic.showNumber(distance) }) basic.forever(function () { basic.showLeds(` @@ -32,7 +32,7 @@ Press button A to measure the distance and save it in a variable. Press button B Insert the block ``||input.on button A is clicked||`` twice and change the button to ``B`` for one block. Tip: You can duplicate the block by right-clicking. ## Define variable -To save the distance when the button is pressed and retrieve it later, create a ``||variable.variable||`` and name it *Distance*. +To save the distance when the button is pressed and retrieve it later, create a ``||variable.variable||`` and name it *distance*. ``` diff --git a/libs/core/blocks-test/control.blocks b/libs/core/blocks-test/control.blocks index 5f6f43631..584d47339 100644 --- a/libs/core/blocks-test/control.blocks +++ b/libs/core/blocks-test/control.blocks @@ -1,66 +1,67 @@ - - - item - - - - - - - - - 4 - - - - - - - - EventBusSource.MICROBIT_ID_BUTTON_A - - - - - - EventBusValue.MICROBIT_EVT_ANY - - - - - - - - - - - - - - EventBusSource.MICROBIT_ID_BUTTON_A - - - EventBusValue.MES_DPAD_BUTTON_C_UP - - - - - EventBusValue.MICROBIT_EVT_ANY - - - EventBusValue.MES_REMOTE_CONTROL_EVT_PLAY - - - - - item - - - 0 - - + + + + item + + + + + + + + + 4 + + + + + + + + EventBusSource.MICROBIT_ID_BUTTON_A + + + + + + EventBusValue.MICROBIT_EVT_ANY + + + + + + + + + + + + + + EventBusSource.MICROBIT_ID_BUTTON_A + + + EventBusValue.MES_DPAD_BUTTON_C_UP + - - - + + + EventBusValue.MICROBIT_EVT_ANY + + + EventBusValue.MES_REMOTE_CONTROL_EVT_PLAY + + + + + item + + + 0 + + + + + + \ No newline at end of file diff --git a/libs/core/blocks-test/game.blocks b/libs/core/blocks-test/game.blocks index 9b8ede847..d3726e0f7 100644 --- a/libs/core/blocks-test/game.blocks +++ b/libs/core/blocks-test/game.blocks @@ -1,183 +1,184 @@ - - - item - gdfgsdfg - - - - - - - - - 2 - - - - - 2 - - - - - - - - - item - - - - - 1 - - - - - Direction.Right - - - item - - - - - 45 - + + + + item + gdfgsdfg + + + + + + + + + 2 + + + + + 2 + + + - - LedSpriteProperty.X - - - item - - - - - 1 - - - - - LedSpriteProperty.X + - - item - + + item + - - - 0 - - - LedSpriteProperty.X - - - item - - - + + + 1 + - - gdfgsdfg - - - 0 - - + + Direction.Right - - item - + + item + - - - item - - - - - - - gdfgsdfg - - - 0 - - - - - item - - - + + + 45 + - - - - item - - - - - - - 1 - - + + LedSpriteProperty.X + + + item + + + + + 1 + - - - - 0 - - - - - - - 10000 - + + LedSpriteProperty.X + + + item + + + + + 0 + + + LedSpriteProperty.X + + + item + + + - + + gdfgsdfg + + + 0 + + + + + item + + + + + item + + + + + + + gdfgsdfg + + + 0 + + + + + item + + + + + + + + + item + + + + + + + 1 + + + + + + + + 0 + + + + + + + 10000 + + + + + + + + + + + + + + + + - - - + - - - + - - - + - - - + - - - - - - - - - item - - - 0 - - - - - item - + + + + + item + + + 0 + + + + + item + \ No newline at end of file diff --git a/libs/core/blocks-test/input.blocks b/libs/core/blocks-test/input.blocks index 50f59d1d2..27862f456 100644 --- a/libs/core/blocks-test/input.blocks +++ b/libs/core/blocks-test/input.blocks @@ -1,12 +1,13 @@ + item sdfsadf - + Button.AB - + @@ -48,7 +49,7 @@ 0 - + @@ -57,7 +58,7 @@ 0 - + @@ -66,7 +67,7 @@ 0 - + @@ -97,7 +98,7 @@ 0 - + @@ -126,16 +127,19 @@ Gesture.SixG - + TouchPin.P0 - + + + ButtonEvent.Click + - + TouchPin.P0 - + \ No newline at end of file diff --git a/libs/core/blocks-test/music.blocks b/libs/core/blocks-test/music.blocks index 78d455ad2..48c9ff55f 100644 --- a/libs/core/blocks-test/music.blocks +++ b/libs/core/blocks-test/music.blocks @@ -1,8 +1,9 @@ + item - + @@ -58,7 +59,7 @@ 0 - + diff --git a/libs/core/blocks-test/pins.blocks b/libs/core/blocks-test/pins.blocks index 294ec6edf..73477ff68 100755 --- a/libs/core/blocks-test/pins.blocks +++ b/libs/core/blocks-test/pins.blocks @@ -1,269 +1,271 @@ - - - - - DigitalPin.P5 - - - PulseValue.Low - - - - - AnalogPin.P9 - + + + + + PulseValue.Low + + + DigitalPin.P5 + - - - 5 - - - - - - - AnalogPin.P10 - - - - - 20000 - - - - + + - - DigitalPin.P6 - + + AnalogPin.P9 + - - 5 - + + 5 + - - - - AnalogPin.P13 - - - - - 5 - - - - - - - AnalogPin.P8 - + + + + AnalogPin.P10 + - - 1500 - - - - - 0 - - - NumberFormat.Int8BE - - - 0 - - - - - FALSE - - - - - - - 0 - - - - - DigitalPin.P9 - - - PulseValue.Low - - - - - 1023 - - - - - - 0 - - - - - 0 - - - - - - - 4 - - - + + 20000 + - - NumberFormat.Int16BE - - - 0 - - + - - DigitalPin.P9 - - - - - - - 0 - - - - - AnalogPin.P9 - - - - - - - FALSE - - - - - - - DigitalPin.P11 - + + DigitalPin.P6 + - - - DigitalPin.P9 - - - - - DigitalPin.P10 - + + + 5 + - - - - DigitalPin.P9 - - - PinPullMode.PullDown - - - - - 0 - + + + + AnalogPin.P13 + - - - 0 - + + + 5 + - - - - DigitalPin.P8 - - - PinEventType.Touch - - - - - AnalogPin.P9 - + + + + AnalogPin.P8 + + + + + 1500 + + + + + 0 + + + NumberFormat.Int8BE + + + 0 + + + + + FALSE + + + + + + + 0 + + + PulseValue.Low + + + DigitalPin.P9 + + + + + + + 1023 + + + + + + 0 + + + + + 0 + + + + + + + 4 + + + - - - - 8 - - - - - 3 - - - - - - - 8 - + + NumberFormat.Int16BE + + + 0 + + + + + DigitalPin.P9 + + + + + + + 0 + + + + + AnalogPin.P9 + + + - - - 3 - + + + FALSE + - - - - 1000000 - - - + + + + DigitalPin.P11 + + + + + DigitalPin.P9 + + + + + DigitalPin.P10 + + + + + PinPullMode.PullDown + + + DigitalPin.P9 + + + + + + + 0 + + + + + 0 + + + + + PinEventType.Touch + + + DigitalPin.P8 + + + + + + + AnalogPin.P9 + + + + + + + 8 + + + + + 3 + + + + + + + 8 + + + + + 3 + + + + + + + 1000000 + + + + + + + + + + + + + + + + + - - - + - - - + - - - + - - - + - - - + - - - - - - - + + + \ No newline at end of file diff --git a/libs/core/blocks-test/serial.blocks b/libs/core/blocks-test/serial.blocks index 827a64d2e..2ffb869cc 100644 --- a/libs/core/blocks-test/serial.blocks +++ b/libs/core/blocks-test/serial.blocks @@ -1,94 +1,112 @@ - - - item - - - - - Delimiters.Colon - - - - - - - - - - + + + + item + + + + + Delimiters.NewLine + + - - - - - 0 - - - - - - - x - - - - - Delimiters.Colon - - - - - - - 0 - + + + item + + + 0 + + + + + + 0 + + + + + 1 + + + - - - - - - - - - - - item - + + + - - SerialPin.C16 - SerialPin.C17 - BaudRate.BaudRate28800 - - - - - - - 64 - - - + + + + 0 + - + + + + + + Delimiters.Colon + + + + + + + 0 + + + + + + + + + + + + + + item + + + + + SerialPin.C16 + SerialPin.C17 + BaudRate.BaudRate28800 + + + + + + + 64 + + + + + + + + + + + + + + + + - - - + - - - + - - - - - - - + + + \ No newline at end of file diff --git a/libs/core/blocks-test/test.blocks b/libs/core/blocks-test/test.blocks deleted file mode 100644 index 2a619f873..000000000 --- a/libs/core/blocks-test/test.blocks +++ /dev/null @@ -1,620 +0,0 @@ - - - booltest - myImage - strtest - - - - - - - 123 - - - - - - ` - # . . # . - # . . # . - . # . . . - . # # . . - . . . . . - ` - - - IconNames.Heart - - - - - 500 - - - - - - - IconNames.Heart - - - myImage - - - 0 - - - ` - . . . . . - . . . . . - . . . . . - . . . . . - . . . . . - ` - - - - - - - myImage - - - - - 0 - - - - - - - myImage - - - - - 1 - - - - - - 3 - - - - - strtest - - - 0 - - - - - Delimiters.Hash - - - - - - - strtest - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - 2 - - - - - - - 5 - - - - - 45 - - - - - DisplayMode.Greyscale - - - AnalogPin.P2 - - - - 1023 - - - AnalogPin.P2 - - - - - DigitalPin.P1 - - - - 0 - - - DigitalPin.P1 - - - - - AnalogPin.P2 - - - 1234 - - - - - 0 - - - - - - 0 - - - - - - 1023 - - - Rotation.Roll - - - - - 0 - - - Dimension.Y - - - - - 4 - - - - - - - - AnalogPin.P2 - - - - 180 - - - Dimension.Z - - - - - AnalogPin.P2 - - - 1500 - - - - - - - - 220 - - - - - BeatFraction.Sixteenth - - - - - - - 659 - - - - - - - BeatFraction.Double - - - - - - - - - - - - - - - - - - - - - - - - - - - Gesture.TiltLeft - - - - - - 1 - - - EventBusValue.MICROBIT_PIN_EVT_PULSE_HI - - - - - - 2 - - - - - - - - - 64 - - - - - - - - - - - - - - - 4 - - - - - - - - EventBusSource.MICROBIT_ID_IO_P0 - - - - - EventBusValue.MES_ALERT_EVT_ALARM1 - - - - - - - - - - - booltest - - - 0 - - - Button.B - - - - - booltest - - - 0 - - - TouchPin.P2 - - - - - booltest - - - 0 - - - - - - 3 - - - - - - 4 - - - - - - - - - - - - - - - Delimiters.Colon - - - - - SerialPin.P0 - SerialPin.P1 - BaudRate.BaudRate19200 - - - - - - - - Button.AB - - - - - - - - - 1 - - - BeatFraction.Sixteenth - - - - - - 2 - - - - - - - - 3 - - - - - - - 5 - - - - - - 255 - - - - - - - - - 255 - - - 440 - - - - - - - - - TRUE - - - - - - - - - - - - - - - - - - - - - - - - DigitalPin.P1 - PulseValue.Low - - - NumberFormat.UInt8BE - - - 0 - - - - - 0 - - - - - FALSE - - - - - - - 0 - - - - - 0 - - - - - DigitalPin.P0 - PinEventType.Touch - - - - - 1000000 - - - - - AnalogPin.P2 - - - DigitalPin.P2 - PinPullMode.PullDown - - - - - 8 - - - - - 3 - - - - - DigitalPin.P1 - DigitalPin.P1 - DigitalPin.P1 - - - - - - - - - - - - - - - - - - - - - - - - - EventBusSource.MICROBIT_ID_IO_P1 - - - - - EventBusValue.MES_ALERT_EVT_ALARM2 - - - - \ No newline at end of file