Inspiration
My first programming experience came from Scratch and I learned a lot of Python by making Discord bots. block2discord allows others to learn programming principles while making something useful and tangible. Furthermore, since block2discord translates the block code to Python, it provides a gateway to learn Python.
What it does
block2discord creates an interface to drag and drop blocks to create a program. The code is then translated to Python which you can modify and run. The more commonly used function, method, and attribute blocks are available.
How we built it
The editor was built based on Microsoft MakeCode PXT architecture and augmented with Discord blocks. The translator was built in Python using regex, Python code formatters, and other string manipulation techniques.
Challenges we ran into
Usually when building a block-based language, you would build an API around the blocks. However, since block2discord translates to discord.py, and intermediate program is needed to bridge the gap between block-based-Python to discord.py.
Accomplishments that we're proud of
This is the first time I tried to solo a hackathon. I'm proud of the amount of progress and usable code I made.
What we learned
I've learned a lot about how block based languages are constructed and how they work. I also learned some TypeScript syntax needed to make the blocks. Working with friends in a team is better :D.
What's next for block2discord
More blocks! The discord.py library is massive and it would be impossible to convert the entire library in 36 hours. Furthermore, the translator engine should be modified to understand code syntax so it can translate more complicated code.
Built With
- discord
- pxt
- python
- typescript

Log in or sign up for Devpost to join the conversation.