Share your repls and programming experiences

← Back to all posts
Blackjack/21 - Card Game with Bot
Arbiter1227 (4)

An addictive blackjack sim.

Greetings, 4 people who sort by new.
It's 1:30am here and I'm tired so here's my first real game, Blackjack.

Please credit me if you use any of the code in here (as if).

Guide

If you've never played Blackjack (or "21", as it's occasionally called), this is a brief guide explaining the basics.

Winning

The idea of the game is to draw random cards (which represent points) from a deck and whoever's score is closest to 21 (without going over) wins.

Terms

  • Hit
    To "hit" means to ask for a new card. Aces are worth 1 point, a 2 is worth 2 points, and so on. Cards that have faces (i.e. kings, jacks, queens) are all worth 10 points.
  • Stand
    To "stand" means to end your turn...permanently. Once you think that your score is close enough to 21, you should "stand" and skip your turns. However, you cannot un-stand, so make sure that you're very close before standing (around 16-21 points is a good range to stand).

About

Now that you understand the game, here's some info about the code.

Bugs

So far, I've only found one.
If you stand on your first turn (which you should never, BTW), it does some wacky things.

AI

The Enemy AI will automatically stand if it's score is higher than 15.
Use this info to your advantage.

Forks

Not much to add here, so IDK.

Comments
hotnewtop
randomguy222 (285)

Great idea! Congrats!

Arbiter1227 (4)

@randomguy222 Thanks! But...congrats for what?

Edit: ohhh you mean congrats on my first game. I'm dumb.