After almost a week of coding (well, half of it was spent fixing bugs in my code), I’ve finished the first project in the Computer Science course.
I’ve blogged about it over at Dev.to.
The repository is located at my GitHub repository.
The code is convoluted and too long. I’ve since realized I need to make my code more modular to make it more readable and to make it easier to test for bugfixing. I’ve been told that my code is comprised mostly of god functions, which is not ideal.
Other than that, I’m pretty proud of it, since it took me almost a week of working every day for a few hours. I’ve rewritten some functions several times.
The game features doubling down, surrendering, insuring and betting. Aces are correctly valued at 1 or 11 depending on your hand. The game will reward accordingly if you win normally or if you win with a blackjack. The dealer will decide when to stop drawing cards based on the value of the player’s hands. In other words, it’s practically a complete blackjack game.
The only thing I haven’t implemented is splitting. Maybe if I were to completely rewrite it with more classes and functions, implementing it would be easy. But as it is right now, it’d take me too much work to implement it in the code as it currently exists.
I would love to hear suggestions and tips, if anyone were to be so kind to grant me some!
With that said, and after this very rewarding experience, I’m off to continue the CS course.