Blackjack

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Blackjack

Post by christosangelopoulos »

https://gitlab.com/christosangel/blackjack
This is a version of the classic game Blackjack, something I wrote in javascript.
The user is the player, the computer is the dealer.
To install and play the game , just follow the (simple I hope) instructions.
Additionally, for an even better experience I would suggest playing this game using Web app.
Any feedback is most welcome!Image
Last edited by LockBot on Tue Apr 25, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Blackjack

Post by trytip »

christosangelopoulos wrote: Tue Oct 25, 2022 12:15 pm
not bad, works
Image
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

trytip wrote: Tue Oct 25, 2022 12:50 pm not bad, works
Thanks.
SteveR
Level 3
Level 3
Posts: 167
Joined: Fri May 24, 2019 12:02 pm
Location: Morehead City, NC
Contact:

Re: Blackjack

Post by SteveR »

Thanks for doing this. As a side-note, I ran across a blackjack game on SourceForge. Published in 2014. Unfortunately it did not work under Mint 20.1 (I tested the Blackjack game in early 2021.) Maybe there is some useful information for you in that program.
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

SteveR wrote: Tue Oct 25, 2022 1:20 pm Thanks for doing this....Maybe there is some useful information for you in that program.
Thank you, I will definitely check it out soon.
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

SteveR wrote: Tue Oct 25, 2022 1:20 pm Maybe there is some useful information for you in that program.
I have checked this source, and
- added an alert each time the deck is reshuffled
- added the 3:2 return of bet in case of blackjack
- differentiated the final message after 10 hands, depending on the gain or loss of the initial sum.
- I have adjusted and added the rules to README:
"These are the rules of this version of the game.
The object of a game of blackjack is to get a hand of cards that has a value of 21 without going over 21 (which is called "busting"). The player plays against the dealer, who is also trying to get to 21 without busting.
A hand of blackjack normally goes like this:
The 52 card deck is shuffled (the player will be alerted each time the deck is reshuffled).
The player and the dealer are dealt one open card each.
The cards have a "value" equal to the number printed on a card, regardless of set. Kings, Queens and Jacks are all worth 10, and an Ace is worth 11, unless the player would bust, in which case the Ace is worth 1.
If the player gets a card with a value of 10 and an ace, he has blackjack, he has automatically won the round and his bet is paid back 3:2.
In any other case, the player can keep on hitting, or choose to stand when he thinks it is apropriate.
If the player stands and hasn't busted, the dealer has to hit until he has a value greater than the player's, then stands.
The values of the two hands are compared, and the higher value wins.
After 10 hands, the player is presented with his total cash, and is asked whether he wishes to play again."
I am not sure if I am going to incorporate other features of the game, like the split or double funcionality. I think would rather keep this game simple.
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

Also, I added a closed card as well to the dealer and to the player at the beggining of each hand

Image
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

After doing some improvements on another project (namely bucket https://gitlab.com/christosangel/bucket), it was natural to incorporate these changes to Blackjack.

By clicking on the settings image 🛠, right next to the slide, the user can set the appearance of the game according to his liking.
Image
The user can set
  • the background color
  • the back image of the deck
  • Keys that hide / show again the game (boss key :wink: )
  • Sound On / Off
Clicking on the Done button will bring the user back to the game.
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: Blackjack

Post by Drugwash »

Yay, finally the twins are back looking the same! :lol:
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

Drugwash wrote: Tue Nov 08, 2022 6:35 am Yay, finally the twins are back looking the same! :lol:
:lol: :lol: :lol: :lol:
StrangeAngel
Level 1
Level 1
Posts: 18
Joined: Mon Oct 24, 2022 12:24 am

Re: Blackjack

Post by StrangeAngel »

I'm like it. I've never played blackjack. Here I tried :)
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

StrangeAngel wrote: Thu Nov 24, 2022 2:21 pm I'm like it. I've never played blackjack. Here I tried :)
I am glad you like it :)
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: Blackjack

Post by christosangelopoulos »

Updated the program in order to incorporate the logic and settings evolved in the other "twin game" called Bucket I wrote along with this.
Image
Clicking on the Settings button the user can set
  • the background color
  • the deck of cards
  • the back image of the deck
  • the Initial Sum
  • Prefered currency and format (currency symbol before/after the sum)
  • Key that hides/shows again the game (boss key 😉 )
  • Sound On / Off
Clicking on the Done button will bring the user back to the game.
Clicking on the Save or Load button, the user can save/load settings to/from a file.
The files saved from the Bucket game can be used with this game, too, and vice versa.
Locked

Return to “Programming & Development”