Inspiration
Hydrocarbons form the basic structure of all life forms and that’s why it is the basic building block for all the fields related to organic chemistry. In order to study the various reactions involved with hydrocarbons, one should be clear with their structures. Now, it is not possible for anyone to memorize the structure of all the possible hydrocarbons. Therefore, we have come up with an efficient program that can develop a real graphic-based structure of a hydrocarbon-based on its IUPAC name.
What it does
First, all the relevant data such as prefix name, suffix name, functional groups will be stored in the form of structures and arrays. Then, as we get an input in the form of a string, the position and the names will be compared with the stored data to get information such as number of carbons, functional groups, number of bonds to form the complete structure.
The module starts with detecting characters before halogen groups in the IUPAC name (variable name – IUPAC). It compares the characters with all elements stored in an array named “prefix”(containing all the possible prefixes) one by one. Consequently it stores all the characters before halogens in pretemp array and marks the address of the end of the prefixes group in cbhalo variable.
File Handling - Files are used to store data in a storage device permanently. File handling provides a mechanism to store that output of a program in a file and to perform various operations on it. Files are mainly dealt by using three classes fstream(Stream classes to write on files), ifstream(Stream classes to read from files), ofstream (Stream class to both read and write from/to files ) available in fstream. In this program, file handling is mainly used, along with compression techniques, to store all the input data in an efficient manner so that we should be able to show the input history to the user whenever prompted. This way, even when the program is restarted, the previous input histories will be preserved and can be accessed by the user.
Graphics - In this program, graphics plays a very important role. It will be used in the loading screen and to switch from one window to another. Graphic modules will be utilized to make the program look a bit attractive and make the program understandable everyone. Also, for the design and structure of the hydrocarbon’s graphics will be introduced to enhance the readability of the structure of the compound. The help screen and the menu pages will also be instilled with graphics like background colour, font and animations to make our program a vibrant one. (Ken Hartness; Journal of Computing Sciences in College, 2005) (Smart variable expressive text or graphics for electronic communications; US Patent 10,289,654, 2019) (Michael Betancourt; Experimental Animation: From Analogue to Digital, 2019)
How we built it
--> To store the history of user inputs in a file so that the user, at any point, can see what IUPAC names were entered before to take a reference before entering long IUPAC names again and again. -->To gain maximum knowledge about data structures used in the project and their implementation. -->To provide accurate structure in the least time possible. -->To make the project user friendly through compression graphics.
Challenges we ran into
- Graphics.h library doesn't work in any IDE except for Turbo C++
- Displaying and specifying locations of bonds was a tedious process
- Displaying texts in a specific order in the graphics window was hard as we had to find out coordinates by trial and error.
Accomplishments that we're proud of
Completing such a massive project that displays the structure of any hydrocarbon in 24 hours 19 mins is our biggest accomplishment yet.
What we learned
- We learned how to name the hydrocarbons by following IUPAC rules.
- We also learned how to identify hydrocarbon structures and also draw them manually!
What's next for Educhemical
- Expanding the algorithm to compute for higher-order organic compounds like aromatic hydrocarbons. 2. Improvising and integrating the code with the FIGMA prototype of UI/UX. 3. Providing an educational service to enjoy the process of understanding organic chemistry in depth.
Log in or sign up for Devpost to join the conversation.