DEV Community

abnercabrera28
abnercabrera28

Posted on

CLI Project

This past week I've had to dedicate all my energy and brain power to creating a CLI application. The requirements were for it to go at least "one level deep," which means the user can make a choice and they'll get more information from it. My cohort advised us to use an API instead of scraping to get that information. First I had to think of the theme of my project. Do I look up an API that dealt with sports? Or maybe something music related? Perhaps something about video games? Because I am one of the most indecisive people on the planet, the thinking process of choosing an API took over 24 hours. Eventually, I ended choosing to make a trivia application using an API that generated random true or false questions.

The idea was there. I wanted the user of the application to get prompted a question for them to decide whether it was true or false. Once they answer, they are told if they are right, and then asked if they would like to continue playing. It was a solid plan, so I began coding it all out. This process was in no way fluid. I came to many bumps in the road, getting stuck several times, mainly when it came to iteration. But I did manage to complete it late in the week. The application was functional and it met the "one level deep" requirement. Unfortunately, when I went to go submit it online, there was another requirement that I had not applied to my project. There needed to be a list of choices for the user to pick from.

At that point I was ready to give up because I didn't believe I had the capability to code in a list. I mean, technically I had a list...of two choices (true or false!). I realized they probably wanted a lengthier one and that just seemed like the most difficult thing to do at the time. After freaking out for a while, I began altering my code to try to include a list of categories for the user to choose from. I tinkered with it for a couple of hours until I hit yet another wall. Then I did what I never do: asked for help. I asked one of my classmates online for some help and within 20 minutes, a list was produced. My application was essentially done. I'm learning the hard way that it's not always the best idea to work on things on your own.

In the end my trivia program met all its requirements. It greets the user and prompts them with a list of categories to choose from. Then from the category that they choose, a random question is generated and they must decide whether it is true or false. Looking back on this week, some of the things that I was stuck on seem so simple now. Maybe in my next project I won't be to proud to ask for help.

Top comments (0)