# Genuary2023_KidCouldhave

### **The prompt for Genuary 2023 Day 26 is**

## "My Kid could have Made It"

For Today's prompt, I will be using a [**MicroBit**](https://makecode.microbit.org/) 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](https://blog.illestpreacha.com/genuary2023yayoikusama)"
    
* Video edited to show the contrast between the original video and hydra modifications
    

<iframe width="560" height="315" src="https://www.youtube.com/embed/Htctu-paSW4"></iframe>

### **MakeCode Blocks**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1674743227962/9a3cd37d-f5ee-43a2-9588-ad2e9f8bb34b.png align="center")

### Javascript Translation

```javascript
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

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