Genuary2023_KidCouldhave

Genuary2023_KidCouldhave

MicroExploration

The prompt for Genuary 2023 Day 26 is

"My Kid could have Made It"

For Today's prompt, I will be using a MicroBit and coding it in the block base environment (while also showing the Javascript component)

  • Audio is done within the MicroBit code

  • The green gloves seen in the video are representing the "Exploration theme"

  • reused Hydra code from "LifeofCircles"

  • Video edited to show the contrast between the original video and hydra modifications

MakeCode Blocks

Javascript Translation

input.onButtonPressed(Button.A, function () {
    for (let index = 0; index < 4; index++) {
        basic.showLeds(`
            # . . . .
            # . . . .
            # # # . .
            . . # . .
            . . # . .
            `)
        basic.showLeds(`
            . . . . #
            . . . # #
            . . # . .
            . . # . .
            . . # . .
            `)
        basic.showLeds(`
            # . . . .
            # . . . .
            # # # # #
            . . . . #
            . . . . #
            `)
        basic.showLeds(`
            . . . . #
            . . . . #
            # # # # #
            # . . . .
            # . . . .
            `)
    }
})
input.onGesture(Gesture.LogoUp, function () {
    basic.showLeds(`
        # # . . #
        . # # # #
        . . # # .
        . # . # .
        # . . . #
        `)
})
input.onButtonPressed(Button.B, function () {
    music.setBuiltInSpeakerEnabled(true)
    if (true) {
        music.playSoundEffect(music.builtinSoundEffect(soundExpression.slide), SoundExpressionPlayMode.UntilDone)
    }
})
input.onGesture(Gesture.Shake, function () {
    basic.showString("woow")
    for (let index = 0; index < 4; index++) {
        basic.showIcon(IconNames.SmallSquare)
        basic.showIcon(IconNames.Square)
        basic.showIcon(IconNames.SmallDiamond)
    }
})
input.onGesture(Gesture.LogoDown, function () {
    basic.showLeds(`
        . # . # .
        . . # . .
        . # # # .
        . . # . .
        . # . # .
        `)
    basic.showString("Loop")
    basic.showNumber(Scroll)
    Scroll += 1
    for (let index = 0; index < 4; index++) {
        basic.showLeds(`
            # . . . #
            # . . . #
            # # . # #
            . . # . .
            . . # . .
            `)
        basic.showLeds(`
            . . # . .
            . . # . .
            # # . # #
            # . . . #
            # . . . #
            `)
    }
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
    music.setBuiltInSpeakerEnabled(true)
    if (true) {
        music.playSoundEffect(music.builtinSoundEffect(soundExpression.giggle), SoundExpressionPlayMode.UntilDone)
        basic.pause(100)
        music.playMelody("C5 A F A C5 A D F ", 175)
        music.playSoundEffect(music.createSoundEffect(WaveShape.Noise, 5000, 0, 137, 0, 2000, SoundExpressionEffect.Vibrato, InterpolationCurve.Linear), SoundExpressionPlayMode.UntilDone)
        music.playTone(220, music.beat(BeatFraction.Double))
    }
    Scroll += 1
})
let Scroll = 0
basic.showLeds(`
    # . # . #
    . . # . .
    # # # # #
    . . # . .
    # . # . #
    `)
Scroll = 0
basic.showString("Hi")
basic.forever(function () {
    music.setBuiltInSpeakerEnabled(true)
    basic.pause(5000)
    music.setBuiltInSpeakerEnabled(true)
    music.setTempo(45)
    music.playSoundEffect(music.createSoundEffect(WaveShape.Noise, 5000, 0, 137, 0, 2000, SoundExpressionEffect.Vibrato, InterpolationCurve.Linear), SoundExpressionPlayMode.UntilDone)
    music.playMelody("C5 A G F B E G D ", 147)
})

Hydra Code

s0.initScreen()
src(s0).scale(()=> (time % 40+1)/4).modulateScale(shape(200,0,5),-0.6).out()