Learning from last time
Having made my first pull request, it was obvious that I would have to take what I learned from my last experience and use that to make this one a bit more streamlined. So, I began be searching Github for open issues with the Hacktoberfest tag and sorted them by newest. This was mainly to make sure the maintainer of whatever repo I was contributing to actively wanted help and was watching for activity in the project. This seemed to work pretty well for me because I was greeted with a healthy list of bugs, feature requests and issues that had all been posted fairly recently. This was much better.
After wadding through the junk like Hacktoberfest specific repos just asking you to add your name to a list, I came across a project called Pig-Game which looked fun and interesting as the developer was looking to add a feature to the game. It also met my criteria for being an international project, as the developer was based out of Kolkata, India. Perfect.
Games, but for school
After forking and cloning the project I looked through the very simple file structure and determined there wasn’t any sort of framework being used here so I just fired it up from the index.html file. Having never heard of or played a game of “Pig” I had to do some Googling for the rules and concepts of the game but after a few test runs and bets with my friend it was safe to say I was comfortable with how to play the game and lose money too.
If you haven’t played Pig, the idea is somewhat similar to Blackjack where you roll a die and then have the option to keep rolling to add to your current turn’s total, or play it safe and add whatever your current turn’s score is to your total score for the game. You take turns doing this with another player until one of you reach a predetermined total score. The risk of rolling again come from the fact that rolling a 1 will erase your current round score and forfeit your turn.
What the developer was looking to do was add a feature where the player can enter the predetermined total score mentioned above at the beginning of the game as opposed to using the default 100. The feature seemed simple enough but it was a bit more complicated than my first impression.
Doing things “wrong” is right
One thing that bugged me a bit while working through the issue was getting used to the fact that you sometimes have to force yourself to do things differently than you usually would. This could be anything from small variable naming schemes to something like shifting your whole coding thought process from object-oriented to functional programming and back again when working on different projects. This can be taxing and tedious at times, but I have to admit I did like the challenge of having no choice but doing things differently because it forced me to learn and leave my comfort zone just a little.
Now, obviously this project was pretty small so it didn’t really push me to my limits or anything when it came to this. It was, however, still kind of refreshing to try something different even if it was just forcing myself to ditch camelCase variable names or using document.queryselector() instead of running for the jQuery CDN tag.