Inspiration
I wanted to solve C.P. questions, but there was one struggling problem, although I can do that easily, but whenever I am stuck, I will be stuck for long, scratching my head into what went wrong! However, to my help, there were multiple peoples who used to post there solutions on the internet for a problem, but in most cases, I was still can't figure out what might be wrong with my approach. Also, in multiple instances, the provided solutions was in whole different language, making it a barrier for understanding for a beginner who couldn't comprehend those easily!
What it does
In solving that, a idea striked my mind, what if I could create a software that can compare I/O of correct and my code and pass judgement based on that, wouldn't it be cool and that's exactly what cpast does. Not only that, it should be able to compare I/O of completely different languages too. For example, if I have a solution from JAVA and I write in Rust, that too need to be detected by cpast, and that's what it does beautifully! Currently it supports a variety of programming languages, including Python, C++, C, Rust, Ruby, JavaScript, and Java.
How we built it
Starting the project, I wanted a language that is more friendly to me, so I started with Rust. Rust's compiler constantly told and helped me remove possible bugs and issues that might would have been existent, when writing in other programming languages. Choosing Rust also ensured that binaries are cross compatible, thanks to LLVM. When I started building the project, I decided to go with CLI like interface for the app, so that future integration of this with any Discord Bot or VSCode Extension will be easy! And those decisions helped me a lot in making this app ready to go in conservatively less time.
Challenges we ran into
Initially when I started developing the cpast, I ran into a serious problem i.e., the the testcase generation. Normally everywhere on google and GitHub, I found only the testcase generators use a custom predefined rules commonly found in general C.P. problems(eg this). However, going with that approach means, tying end users hand for freedom. So, I started developing my own custom testcase generator. It was the most difficult part, because it needed to just perfect and flexible enough to be used in multiple cases or so. For initial designs, I tried taking inspirations from regex, but that didn't help much because regex didn't supported backreferences in quantifiers. So, I started writing my own initial draft for the language, and then there was no looking back.
Accomplishments that we're proud of
Making this project, not only helped me solve my issue while trying C.P., but I believe other C.P. goers might find it helpful too. Building this at MLH, I learned how to design and develop a new toy language. The testcase generator that I wrote works on the same principle, although it's language looks a lot like regex, it is not. I name the generator language clex for some unknown reasons. :-)
What we learned
First and foremost, I learned a lot about designing and building my own toy language. Those things makes me proud. Making this, I also learned a lot about Rust, languages, CLI, git and Github too. Apart from that, I came to know about certain design principles when dealing with software, it helped me a lot optimize my workflow!
What's next for cpast
I am thinking for making a custom LLM model that can generate language for testcase automatically using Langchain in future. Apart from that, I have a VSCode extension and Discord bot in mind for future.

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