Java Script Type Conversion

Today, I worked on type conversion with Java Script. Here is some of the code used for type conversion.

This code converts a data type from one to another. ‘0’ as a string turns into 0 as an int.

Later on, this code will determine which, and which is not a number. Overall, JavaScript has a lot of complexities, which is why it’s used for big websites for big companies.

Tkinter Game

Today, I’m working on a python RPG-like game that runs on tkinter. Usually, to make a python game, you would have to use pygame. However, I plan on not using that, but instead, tkinter. Tkinter is used for making python guis(graphical user interface). And today, I’m making a game with it.

What I have for now is the buttons, and a picture of the opponent that I’ll face in the game once I finish the whole code. For now, what I did is create the basic attack move, allowing our character to attack the opponent. If there is anything else for me to say, then what I’ve learned is that dictionaries help a lot with coding.

Circuit Python project

Today, I’ve been working on creating a piano with circuit python. I have most of my C scale programmed on the board, and I’m planning to add more scales to it.

How does it work? If you touch a certain part of the board, it produces a pitched sound. One part of the board produces a different pitch than the other. How it does it is the frequency number. For example, a C note is 261.63 Hz.

from adafruit_circuitplayground import cp


while True:
    while cp.touch_A1 or cp.touch_A2 or cp.touch_A3 or cp.touch_A4 or cp.touch_A5 or cp.touch_A6 or cp.touch_A7:
        if cp.touch_A1:
            cp.start_tone(262)

        if cp.touch_A2:
            cp.start_tone(293)
        
        if cp.touch_A3:
            cp.start_tone(329)
    
        if cp.touch_A4:
            cp.start_tone(349)
            
        if cp.touch_A5:
            cp.start_tone(391)
            
        if cp.touch_A6:
            cp.start_tone(440)
            
        if cp.touch_A7:
            cp.start_tone(493)
    
    cp.stop_tone()

https://learn.adafruit.com/sensor-plotting-with-mu-and-circuitpython/capacitive-touch

https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/play-tone