Inspiration
So far, the most coding I have been exposed to has been in high school taking AP Computer Science Principles. This course so far has only been teaching me through code.org rather than java or python, thus I had no prior experience working on replit.com. Although I am a beginner and applying for the beginner track, I wanted to teach something through my code. Recently, I have seen an uptick in gambling on social media and even in my community. I wanted to teach people how to gamble responsibly by teaching them one of the most common games, Black Jack.
What it does
It has the instructions on the code. You receive two cards at the beginning along with the dealer. You must try and get to 21 or closer to 21 than the dealer without going over. If you go over it will say you lose. If you are under 21, you can hit 3 times to try and get as close as you can to 21 before you go over.
How I built it
It starts out with 3 lists. A 2-10,jack,queen,king,ace list and a list that has the values of those card (usually just the card number). I also made a list for the suits. From their, I was able to add them together to create something like, "4 of diamonds". I was also able to add up the score you had and the score the dealer had.
Challenges I ran into
I had first ran into the str() issue, still have a little trouble with it. I had to learn python off of my limited code.org knowledge. I had to create many different values both to create a card, and to count the value of those cards. Having to "import random" into my code to get random numbers. After getting the users cards and values, I had to create the dealers cards and values as well.
Accomplishments that I'm proud of
I was able to express most of what I had wanted on to the console. I learned a brand new language. I had lost of fun problem solving through this project and trying to find the best way to code.
What I learned
All the writing I have done in this program is everything I have ever done in python. I learned how computers interact with inputs and how to organize my if statements better. The difference between int() and str(), and when to use them. Declaring "import random" before getting random numbers.
What's next for Black Jack Simulator
I still have lots of work. I need to make so the dealer is able to draw cards. I have the new random cards in my code, but cannot figure a way to import it into the console. I also need to make it say you win, once the dealer busts, or a tie if both get 21. I would love to put it into a pictured game, however I am very far away from any graphic phase.
Built With
- phython
- replit.com


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