Our computer science instructor frequently tests our knowledge of C++ syntax with paper quizzes, in which we are tasked with handwriting a simple C++ program from start to finish. To test whether our code compiles and runs properly, he manually types each and every student's handwritten quiz into Visual Studio. He often takes quite a while to grade all of ours, as with 20 students in the class, even a small 20-line program has him entering in 400 lines of code. To alleviate how much our CS instructor has to work to grade each quiz, we wanted to create a hack that automatically compiles and runs the handwritten programs without having to enter them into an IDE.

What it does

The user takes a picture of the code snippet he or she wants to run using the iOS app. This picture is converted in real time to a text file with the code snippet. The user can then send this text to the desktop companion application, which allows the user to edit and run the code.

How we built it

We used Swift and Electron to build the mobile and desktop apps, respectively. We also used the Google Cloud Vision handwriting detection API to read the code from the picture, and FireBase to send the transcribed code to the desktop application. In addition, we used hackerearth to run the code on our computers.

Challenges we ran into

We never created an iOS app before, so we had to learn Swift while attempting to make a pretty complex mobile application. In addition, with our complete lack of experience, we faced a very steep learning curve when it came to API integration and connecting to FireBase. We're also not the best with front-end, and had to work pretty hard to develop a half-decent GUI and user experience.

Accomplishments that we're proud of

  • Designing elegant, user-friendly GUIs on both the desktop and mobile sides
  • Successfully parsing the JSON file outputs of the Google Cloud API
  • Updating desktop application as soon as new picture of code snippet was taken on mobile app

What we learned

  • How to setup and use FireBase for future projects
  • Creating mobile applications for iOS devices using Swift
  • How long we can keep working on just two hours of sleep

What's next for Pictocode

Extending the number of languages supported by Pictocode. Also, allowing Pictocode to parse and run pseudo-code in whatever language the user decides.

Share this project: