0% found this document useful (0 votes)
27 views22 pages

Blackjack Game Development in Python

The document describes a computer science project on the game of Blackjack created by a student. It includes an introduction to the rules and objectives of Blackjack, the hardware and software requirements for the project, and a description of how the cards are dealt in the game. It also discusses the scope of learning strategic thinking and decision making through playing Blackjack, as well as opportunities to improve the game for educational purposes in the future.

Uploaded by

schrujhana.jagan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views22 pages

Blackjack Game Development in Python

The document describes a computer science project on the game of Blackjack created by a student. It includes an introduction to the rules and objectives of Blackjack, the hardware and software requirements for the project, and a description of how the cards are dealt in the game. It also discusses the scope of learning strategic thinking and decision making through playing Blackjack, as well as opportunities to improve the game for educational purposes in the future.

Uploaded by

schrujhana.jagan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COMPUTER SCIENCE

PROJECT ON “BLACKJACK”

ACADEMIC YEAR : 2022 - 2023

Project submitted in partial fulfilment of Practical Examination for Class


XII, All India Senior Secondary Certificate Examination

SUBMITTED TO : SUBMITTED BY :

MRS. CHANDRA PRIYA CN NAME : SCHRUJHANA JAGAN


REG NO : 1134
CLASS : 11 AN2

SUGUNA PIP SCHOOL, COIMBATORE.


1 of 19
(CBSE, Affiliation No. 1930213)

2 of 19
CONTENTS

Teacher’s Signature

3 of 19
CERTIFICATE

This is to certify that Ms./[Link] Jagan, Roll No. 1134 of


class XI (Session 2022-23), Suguna Pip School has completed the
project based on the topic “BLACKJACK” as a part of the paper of
Computer Science (083).
It is a bona-fide piece of work done under my supervision and
guidance to the best of my knowledge. It is the original work of the
candidate and is a result of her/his effort in partial fulfilment of
requirement as per AISSCE curriculum of class XI.

TEACHER IN-CHARGE PRINCIPAL

EXTERNAL

DATE OF THE EXAMINATION


4 of 19
ACKNOWLEDGEMENT

I would like to thank Mr. POOVANNAN, Principal, Coimbatore for his


immeasurable direction towards course of action and support
throughout the project.

I would also like to thank my Faculty Guide, [Link] , for her


valuable mentoring throughout the project. The interesting and valuable
lectures of my teacher has helped me understand the various
concepts related to “Blackjack” and see their presence in the actual
world.

I got ample opportunity to do research, which enriched and broadened


my knowledge and understanding of this area. I am seriously indebted
to them.

Thanks to my parents, friends and everyone else who have been


directly or indirectly supportive during the course of my project.

STUDENT NAME : Schrujhana Jagan

REGISTRATION NO : 1134

CLASS : 11 AN2

DATE OF SUBMISSION : 02/03/2023


5 of 19
6 of 19
INTRODUCTION

Blackjack is a card-based game played at casinos. The participants in this game do not
compete with each other but the dealer assigned by the casino. The rules are :The magic
number for Blackjack is 21. The values for all the cards dealt to a player are added and if
the sum exceeds 21, the player busts and loses instantly.

If a player gets an exact 21, the player wins against the dealer. Otherwise, in order to win,
the sum of the player’s cards must be more than the sum of the dealer’s cards.

The ace card has a definite value of 10, whereas the ace can be counted as 1 or 11 suitable
to the player’s chances of winning. The value of the rest of the cards is defined by their
number.

The dealing of the cards in a game of Blackjack is as follows:


 A card is dealt to the player facing upwards (visible to everyone).
 The dealer deals a card to himself visible to everyone.
 Another card is given to the player facing upwards.
 The dealer deals a card facing downwards for himself.
 The player has to decide whether to stand with the current set of cards or get another card.
 If the player decides to hit, another card is dealt.
 If the player decides to stand, then the dealer reveals his hidden card.
 The dealer does not have the authority to decide whether to hit or stand. The general rule is
that the dealer needs to keep hitting more cards if the sum of dealer’s cards is less than 17.
 As soon as the sum of dealer’s cards is either 17 or more, the dealer is obliged to stand.
 According to the final sum of the cards, the winner is decided.

The programming of the Blackjack game becomes simple as soon as the rules are
understood. Creating a terminal-based game from scratch requires three main
components: The Game Design, The Game Logic, and Management of Player Interaction.

7 of 19
OBJECTIVE

The Game Logic, and Management of Player Interaction. The entire game logic revolves around the

dealing of cards and player’s choices for either hitting or standing. As soon as we handle the
above two things Creating a terminal-based game from scratch requires three main components: The

Game Design,,we are done for the day. The picture included shows the game being
played. I used python to code this [Link] being a user friendly platform it
helps beginners coders like me to understanding coding in a easier [Link] helped
me to find the syntax in codes faster. I also learned how important it was to give
proper names to variables and functions.

8 of 19
SCOPE

Blackjack being a game of strategy and high risks helps people to


sharpen their minds . It helps them to formulate strategies. In this
game the experts will try to exploit every opportunity while the
novices will play it safe. You see a similar pattern in life too. High
achievers will bust more often, while underachievers play too
conservatively, afraid to take calculated risks for fear of losing
what they have. Taking up blackjack is easy but it requires a large
amount of time and concentration to understand the players hand
and to formulate a play to defeat his play. It helps us to learn to
understand the importance of observing people and observing
things around us. By learning to play blackjack in online will
prevent us from playing as a novice in real life and losing money .
It acts as a training wheel before we are ready to play in a real
casino!

9 of 19
REQUIREMENTS
HARDWARE AND SOFTWARE REQUIREMENTS:

 An iPad / laptop / computer or any other tablet .


 Python 3.11.1
 Anaconda navigator

PROJECT NAME BLACKJACK IN PYTHON


LANGUAGE USED PYTHON CONSOLE BASED
PYTHON VERSION 2, X OR 3.X
DATABASE NONE

TYPE PYTHON APP


DEVELOPER IT SOURCECODE
UPDATES 0

10 of 19
DESCRIPTION

The dealing of the cards in a game of Blackjack is as follows:


 A card is dealt to the player facing upwards (visible to everyone).
 The dealer deals a card to himself visible to everyone.
 Another card is given to the player facing upwards.
 The dealer deals a card facing downwards for himself.
 The player has to decide whether to stand with the current set of cards or
get another card.
 If the player decides to hit, another card is dealt.
 If the player decides to stand, then the dealer reveals his hidden card.
 The dealer does not have the authority to decide whether to hit or stand.
The general rule is that the dealer needs to keep hitting more cards if the
sum of dealer’s cards is less than 17.
 As soon as the sum of dealer’s cards is either 17 or more, the dealer is
obliged to stand.
 According to the final sum of the cards, the winner is decided.

11 of 19
FUTURE SCOPE:

The use of Blackjack game was highly effective to increase


students’ out of thinking abilities. game technique, the students’
vocabulary increase significantly. Poor decision-making skills are
definitely going to land you in a bad situation. So this is why one
of the best benefits of playing blackjack is that you get to improve
your decision-making skills. Something that can benefit you in
day-to-day life.
The effectiveness of Blackjack game technique was also shown by
the students’ learning process as were able to stay in a place for a
long while to study since a blackjack game also takes time to
formulate strategies. The students show good participation and
attention in learning process. It also provides new ways for
students to improve their thinking abilities in a fun way.
Therefore in the future this would be an excellent game in
improving the strategic and thinking ability of children .

12 of 19
DRAWBACKS

• It can become addicting

• It encourages players to play more games where we might tend to


lose money

• It encourages gambling

• It makes us over competitive in some cases

13 of 19
SOURCE CODE :
import random
import time

# Initial Steps to invite in the game:


print("\nWelcome to Hangman game by IT SOURCE-CODE\n")
name = input("Enter your name: ")
print("Hello " + name + "! Best of Luck!")
[Link](2)
print("The game is about to start!\n Let's play Hangman!")
[Link](3)

# The parameters we require to execute the game:


def main():
global count
global display
global word
global already_guessed
global length
global play_game
words_to_guess
=
["january","border","image","film","promise","kids","lungs","doll","rhyme"
“damage”,"plants"]
word = [Link](words_to_guess)
length = len(word)
count = 0
display = '_' * length
already_guessed =
[] play_game = ""

# A loop to re-execute the game when the first round ends:

def play_loop():
global play_game
play_game = input("Do You want to play again? y = yes, n = no \n") while
play_game not in ["y", "n","Y","N"]:
play_game = input("Do You want to play again? y = yes, n = no \n")
if play_game == "y":
main()
14 of 19
elif play_game == "n":

15 of 19
print("Thanks For Playing! We expect you back again!")
exit()

# Initialising all the conditions required for the game:


def hangman():
global count
global display
global word
global already_guessed
global play_game
limit = 5
guess = input("This is the Hangman Word: " + display + " Enter your guess:
\n")
guess = [Link]()
if len([Link]()) == 0 or len([Link]()) >= 2 or guess <= "9":
print("Invalid Input, Try a letter\n")
hangman()

elif guess in word:


already_guessed.extend([guess])
index = [Link](guess)
word = word[:index] + "_" + word[index + 1:]
display = display[:index] + guess + display[index + 1:]
print(display + "\n")

elif guess in already_guessed:


print("Try another letter.\n")

else:
count += 1

if count == 1:
[Link](1)
print(" \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 2:
16 of 19
[Link](1)
print(" \n"
" | | \n"
" | |\n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 3:
[Link](1)
print(" \n"
" | | \n"
" | |\n"
" | | \n"
" | \n"
" | \n"
" | \n"
" | \n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 4:
[Link](1)
print(" \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | \n"
" | \n"
" | \n")
print("Wrong guess. " + str(limit - count) + " last guess remaining\n")

elif count == 5:
[Link](1)
print(" \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | /|\ \n"
" | / \ \n"
" | \n")
17 of 19
print("Wrong guess. You are hanged!!!\n")
print("The word was:",already_guessed,word)
play_loop()

if word == '_' * length:


print("Congrats! You have guessed the word correctly!")
play_loop()

elif count != limit:


hangman()

main()

hangman()

18 of 19
OUTPUT:

19 of 19
20 of 19
CONCLUSION :

From the entire data on the previous explanation, the


researcher can conclude that the implementation of Hangman
game contribute a significant enhancement to strengthen
young learners’ vocabulary .From the conclusion of this
research, the researcher gives recommendations dealing with
the result accomplished. (1) English teachers are suggested to
use Hangman game as a technique in teaching vocabulary. It
recommended because Hangman game provide motivation for
teaching and learning vocabulary. In implementing Hangman
game, the classroom would be noisy. English teacher should be
well-prepare in order to covers this problem. Beside that, the
teacher should explain the order clearly to avoid students’
confusion in playing Hangman game. (2) For the students, It
suggested that the students should be more responsible in
group. The students also suggested to pay attention to the
teacher’s explanation, especially when the teacher explains the
steps of playing Hangman game. (3) For other researchers who
have any intention to explore and complete this technique to
different kinds of material suitable with its characteristic and
school [Link] game also possible to be used in
other genre of text, for example report text, recount text, and
narrative text.

21 of 19
BIBLIOGRAPHY

• Sumita Arora

• [Link]

• [Link]

• [Link]

• [Link]

• [Link]

22 of 19

Common questions

Powered by AI

The educational benefits of blackjack include improved strategic thinking, decision-making skills, and mental sharpness. It provides a practical way to learn about risk management and strategy formulation. However, the drawbacks include the risk of addiction and the promotion of gambling tendencies, which can encourage excessive risk-taking and competition, potentially leading to financial and social consequences .

Blackjack is seen as a game that develops strategic thinking and decision-making skills. Players learn to assess risk and make calculated decisions to avoid 'busting' or losing. This translates into real life as it encourages high achievers to take calculated risks rather than playing too conservatively, similar to real-world scenarios where strategic risk-taking is necessary for success .

In blackjack, the player decides whether to 'hit' or 'stand' based on their cards, whereas the dealer follows a set of rules: the dealer must keep 'hitting' if their cards total less than 17, and must 'stand' once the total is 17 or more. This limits the dealer’s discretion compared to the player, emphasizing a predefined strategic role .

A player’s decision to 'hit' or 'stand' directly impacts the outcome by either increasing their hand total or maintaining it, thus influencing their chance of winning. This dynamic decision-making contrasts with the dealer’s fixed rule set, where decisions are automatic: the dealer hits below 17 and stands at 17 or higher. This procedural difference allows players more nuanced control over their potential to win against the dealer .

Playing blackjack online serves as training by helping individuals become familiar with the rules and strategies without financial risk, thus preparing them for real-life scenarios in casinos. Online practice helps refine decision-making abilities, allowing players to transition more confidently to physical tables with a better understanding of game dynamics .

The key components in developing a terminal-based blackjack game include Game Design, Game Logic, and management of Player Interaction. Game Design involves creating an interface and flow of the game; Game Logic involves implementing blackjack rules and mechanics; and Player Interaction involves handling inputs and feedback, crucial for creating an engaging and functional game experience .

The ace's dual functionality, being counted as either 1 or 11, adds strategic depth to blackjack. Players must assess their total hand value and future card draws to choose the ace's value optimally. This flexibility can lead to either an advantageous hand or a risky situation if misjudged, requiring players to carefully evaluate probabilities and potential outcomes in their decisions .

Python is a user-friendly language that is especially suitable for beginners due to its simple syntax and readability. In the development of a blackjack game, Python allows beginners to quickly grasp concepts like variable naming, game logic implementation, and interaction handling, making it an effective language for creating a terminal-based game .

Incorporating blackjack into education could significantly improve strategic thinking by teaching students risk management, probability, and decision-making under pressure. As students engage with game-based learning, they can develop critical thinking skills in an engaging and interactive manner, preparing them for complex problem-solving tasks in real-world scenarios . However, it requires careful integration to balance educational benefits with the risk of promoting gambling behavior.

The development and execution of a Python-based blackjack game require specific hardware like a computer or tablet and software tools such as Python 3.11.1 and Anaconda Navigator. These tools provide the necessary environment for coding, testing, and running the game, and are essential for enabling the interaction between the game's logic and user input, thus facilitating developmental efficiency and gameplay experience .

You might also like