0% found this document useful (0 votes)
29 views

Python Programme Final

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
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Python Programme Final

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
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

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./Mr.Schrujhana 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, Mrs.Chandrapriya , 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 project.Python being a user friendly platform it
helps beginners coders like me to understanding coding in a easier manner.It 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!")
time.sleep(2)
print("The game is about to start!\n Let's play Hangman!")
time.sleep(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 = random.choice(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 = guess.strip()
if len(guess.strip()) == 0 or len(guess.strip()) >= 2 or guess <= "9":
print("Invalid Input, Try a letter\n")
hangman()

elif guess in word:


already_guessed.extend([guess])
index = word.find(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:
time.sleep(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
time.sleep(1)
print(" \n"
" | | \n"
" | |\n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

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

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

elif count == 5:
time.sleep(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 curriculum.Hangman 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

• www.wikipedia.com

• www.python.com

• jurnal.untan.ac.id

• pcgamebenchmark.com

• www.programiz.com

22 of 19

You might also like