Inspiration
Browsing Reddit today, we saw a meme that used this type of formatting. We decided that there should be a program that does the translation for the user. From there, we made a program that does exactly that.
What it does
After the Run button is pressed, the user should click on the interface that pops up to give input to that instead of the code. Then, when any letter (or space and backspace keys) is pressed, the algorithm searches for the best way to combine those letters in order to form the same string, but as elements.
How we built it
We built this on the p5.js web editor, a web-based javascript editor. The algorithm starts at the beginning of the input string and works its way to the end. In short, it looks for single letters that are elements, then pairs and adjusts the output string accordingly.
Challenges we ran into
A lot of the challenges I, Orik, ran into involved not understanding the code I was writing. Although tiredness and exhaustion played roles in this, I believe it was mainly due to my lack of commenting skills.
Accomplishments that we're proud of
Having time to fine-tune some of the details, such as the atomic numbers, font sizes and resizing, was one of our major accomplishments. Although it doesn't look beautiful, it gets the job done.
What we learned
We learned a little bit more about the intricacies of coding algorithms, such as the order of steps and nesting of said steps. If we messed up even one part, the rest came falling down.
What's next for Text to chemical formula program
Several ways to translate text inputs to original and creative outputs for advertisers seems like a logical next step. Also, there are a lot of places that all-important computation time could be cut. Because we could do the chemical formula translation, why stop there?
Built With
- chrome
- javascript
- p5.js
Log in or sign up for Devpost to join the conversation.