Friday, September 27, 2019

Hacktoberfest 2019

Introduction


     For Hacktoberfest 2019 I have decided to work on googles open source issues. The projects that caught my eye to them are blockly-gamebullet-physic SDK and the quickdraw dataset. Blockly-game is a series of educational games that teach programming. It is based on the Blockly library. Bullet-physic SDK is real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning, etc. The Quick Draw Dataset is a collection of 50 million drawings across 345 categories, contributed by players of the game Quick, Draw. All of these projects are handled by Google and run on c++, a language I like to work with.

     My original goal for Hacktoberfest was to learn Python or Dart. Instead, I switched my goals to google because these projects caught my attention. Plus as a beginner, some of the issues these projects have to offer are stuff I can handle but also challenge my self later on. In quickdraw, I saw an issue about adding a heart to the database because it is easy to draw and recognized by everybody, which is something I can handle. On the other hand, we have collision issues with light objects in bullet physic SDK, something a bit out of my comfort zone but I would like to solve.

     Not gonna lie, I am super excited about Hacktoberfest, I cant wait to get started!


Pull Request 1 -TicTacToe


     For my first hacktoberfest entry I decided to work on something I was familiar with and help me settle in with this challenge, a tic-tac-toe game developed in java. The author of this repository was having some problems with win conditions for a vertical line. He created an issue for it and I helped him out and sent in a pull request. I have made tic-tac-toe when I was first learning to program from scratch, which is a block-based visual programming language. I thought I made it before this issue should be easy to solve and the fact that I am pretty knowledgeable working in java environment I was super sure ill have this issue don’t in 5 min. But I thought wrong. Finding the bug took some time to find but since all the files and variable names made sense it didn’t take too long like some projects I saw on GitHub where their file names and variable name were like “a, b, culm, z, zz”.  Also, the part of understanding the logic of the code and how everything works together and writing code that fits the author's coding style took some time to. The issue was fairly simple to fix because there was a fatal flaw in his check conditions, so once I fixed that the game ran smoothly. Another thing that caught me off guard was instead of using a window and using some graphics to display the game in java, the author decided to show all that in the terminal with was a pain to work with. This is because every time you chose to put a markdown you have to enter in the column and row number then it creates a new grid with the mark on it, This I found very irritating. Other than that I was very happy with this project is the first project I decided to work on as hacktoberfest entry.


Pull Request 2 – Quiz-Game


     For the second entry in hacktoberfest I decided to work on a quiz game built in java. I know I decided to switch my original goal and work on google based projects but in the end my drive to learn a new language took over and I started learning python. This quiz game was a great step towards my learning process. This game is simple enough that once I learned a bit of python I was able to follow what was going on in the code. At first, it was hard to understand of course, just like any new thing you attempt is hard, so I decided to sit down and learn python3 for 2 weeks. I used codecademy and stackoverflow to learn python3. Then I went back and the quiz code was easier to understand and understood that the author kept the coding were simple because they could have used more advanced techniques to do half their coding. The issue I solved in this game was a documentation and consistency issue in the game. The phrases that repeated in the game like “Enter your Choice”, “Enter Choice” or “Enter answer”, I decided to change all that and make it all the same as ““Enter your Choice” followed by the valid inputs so it looks like this in the end “Enter your Choice [a, b, c, d, e]: ”. I had to add in the valid answers because the game did not handle the wrong input very well all the time. Once I went and fixed all the documentation errors in the program I sent in a pull request. This issue helped me understand python better because if you can read and edit code in a certain language it will help you write code in that language as well.


Pull Request 3 – Algorithms


     For the third entry in hacktoberfest I decided to work on writing programs in python even if they are small ones. So, I came across this repository that has algorithms in c++ and python. The author had an issue open for mathematical algorithms in python so I took a crack at it. The author had a lot of the c++ algorithms done but the python ones very few and even those were done by other contributors so I decided to work on the factorial one. The program I wrote takes two inputs from the user than calculates the factorial in a while loop in a try and catch block to handle invalid input and prints the output of the calculations. After I wrote the code I sent in a pull request to merge it with their repositor. The thing I had a lot of problems with when I was writing was with the spacing and blocking everything. Since there are no brackets I got lost a lot when I was tiring to read my code since I couldn’t tell if it was the end of the if statement or loop. Other than that I had fun writing the program and it was so easy to write and run compared to doing it in c++ in visual studios.


Pull Request 4 - Algorithms


     For the fourth entry in hacktoberfest I decided to continue working on the same repository as pull request 3, Algorithms. This time around I sent in an issue to work on another one of the mathematical algorithms, highest common factor, and lowest common multiple. Same thing as PR3 it took two inputs and printed the output. What is different in this one is that I create two functions that I call upon and print what they return instead of just doing the calculation and printing out the variable value. After I wrote the code I sent in a pull request to merge it with their repositor. The thing that I had difficulties with this code was the actual logic for calculating the HCF&LCM. This is middle school math and I forgot about it totally so to remind me of how they work was the hardest. Other than that I enjoy working with python because it is so convenient and easy to use. It’s almost like coding by speaking.


Conclusion


     In the end, this was very fun and a great experience for me. I loved learning and working with python and I will continue to learn more about it in the near future. I know I didn't stick to the original projects that I planned on working on but I do not regret one bit of that. I will attempt solving some issues in those repositories in the near future as well. Also, I will attempt hacktoberfest next year as well since I enjoyed learning new things very much.

No comments:

Post a Comment