Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Download the sample project from here and edit it

Final Abhishek Computer Project Documentation (1).docx - Google Docs

TITLE – Menu driven program for Morse Code Conversion and Casino Game

Leave the name and section blank


Change the year
Leave certificate blank only change 12 to 11 and leave section blank, change year
Leave acknowledgement and index as it is

System software

Windows 11

Python 3.12

Remove mysql

Hardware

Just change it to windows 11 operating system

Project synopsis

Just copy whatever is below this and remove the introduction and other heading there

Aim for Morse Code Conversion:

The aim of the Morse Code Conversion project is to create a user-friendly Python program that
facilitates seamless conversion between English text and Morse code. This project aims to provide
a tool that allows users to input text and receive its Morse code representation or input Morse
code and receive the corresponding English text. The program should run in a loop, enabling users
to make multiple conversions until they choose to exit. This project aims to enhance understanding
and communication through the use of Morse code.

Aim for Casino Slot Machine Game:

The aim of the Casino Slot Machine Game project is to develop an interactive Python game that
simulates the experience of a casino slot machine. This project aims to entertain users by providing
a simple and engaging game where they can place bets, spin the reels, and potentially win or lose
virtual currency. The game aims to offer an enjoyable experience with clear instructions, visual
representation of the slot machine, and realistic payout mechanisms. Additionally, the program
aims to handle user input gracefully, ensuring a smooth gaming experience. The overall goal is to
create a fun and interactive application that emulates the thrill of a casino slot machine.

ABOUT OUR PROJECT

1. Morse Code Conversion:

• Converts English text to Morse code and vice versa.

• Uses a dictionary (MORSE_CODE_DICT) to map characters to their Morse code equivalents.


• The program runs in a loop, allowing the user to choose between text-to-Morse or Morse-to-
text conversion until they choose to quit by entering 'q'.

2. Casino Slot Machine Game:

• Simulates a basic slot machine game.

• The player starts with a balance of $1000.

• They can place bets (up to their current balance) or choose to quit the game.

• The slot machine has various symbols, and winning combinations result in different payouts.

• The game continues until the player decides to quit or runs out of funds.

Remove the whole structure of invoice page

Design work

Libraries used

Random:

• Imported for generating random numbers, specifically used in the casino game to simulate
spinning reels and determining the symbols.

CODING

(careful with indentation)

#MORSE CODE AND CASINO - COMPUTER PROJECT

choice = input('enter 1 for MORSE CODE--ENGLISH or 2 for CASINO')


if choice == '1':
MORSE_CODE_DICT = { 'A':'.-', 'B':'-...',
'C':'-.-.', 'D':'-..', 'E':'.',
'F':'..-.', 'G':'--.', 'H':'....',
'I':'..', 'J':'.---', 'K':'-.-',
'L':'.-..', 'M':'--', 'N':'-.',
'O':'---', 'P':'.--.', 'Q':'--.-',
'R':'.-.', 'S':'...', 'T':'-',
'U':'..-', 'V':'...-', 'W':'.--',
'X':'-..-', 'Y':'-.--', 'Z':'--..',
'1':'.----', '2':'..---', '3':'...--',
'4':'....-', '5':'.....', '6':'-....',
'7':'--...', '8':'---..', '9':'----.',
'0':'-----', ', ':'--..--', '.':'.-.-.-',
'?':'..--..', '/':'-..-.', '-':'-....-',
'(':'-.--.', ')':'-.--.-', ' ':'/'}

while True:
print("1. Text to Morse Code")
print("2. Morse Code to Text")
choice = input("Enter your choice (1 or 2, q to quit): ")

if choice.lower() == 'q':
break

if choice == '1':
text_input = input("Enter the text to convert to Morse Code: ")
morse_code = ''
for char in text_input.upper():
if char in MORSE_CODE_DICT:
morse_code += MORSE_CODE_DICT[char] + ' '
else:
morse_code += ' '
print("Morse Code: ", morse_code)

elif choice == '2':


morse_input = input("Enter the Morse Code to convert to Text: ")
morse_code = morse_input.split(' ')
text_result= ''
for code in morse_code:
for key, value in MORSE_CODE_DICT.items():
if code == value:
text_result += key
print("Text: ", text_result)

else:
print("Invalid choice. Please enter either 1 or 2.")

elif choice == '2':


#CASINO
import random

def display_slot_machine(reels):
print("\n=== Slot Machine ===")
for row in reels:
print(" ".join(row))
print("===================")

def spin_reels():
symbols = ["Cherry", "Lemon", "Orange", "Plum", "Bell", "Bar", "Seven"]
return [random.choice(symbols) for _ in range(3)]

def calculate_payout(reels, bet):


# Check for winning combos and calculate payout
payouts = {"Cherry": {2: 5, 3: 10}, "Lemon": {3: 20}, "Orange": {3: 30},
"Plum": {3: 40}, "Bell": {3: 50}, "Bar": {3: 100}, "Seven": {3: 200}}

symbol_counts = {symbol: reels.count(symbol) for symbol in set(reels)}


common_symbol = max(symbol_counts, key=symbol_counts.get)#

return payouts.get(common_symbol,{}).get(symbol_counts[common_symbol],
0) * bet

def display_balance(balance):
print("\nYour balance: $",balance)

def get_player_bet(balance):
while True:
try:
bet = int(input("Place your bet (0 to quit): "))
if 0 <= bet <= balance:
return bet
else:
print("Invalid bet. enter a value between 0 and your current balance.")
except ValueError:
print("Invalid input. enter a number.")

def casino_game():
balance = 1000

while balance > 0:


display_balance(balance)

# Get the player's bet


bet = get_player_bet(balance)

if bet == 0:
print("Thanks for playing! Goodbye.")
break

# Spin the reels


reels = spin_reels()

# Display the slot machine


display_slot_machine(reels)

# Calculate and display the payout


payout = calculate_payout(reels, bet)
print(f"\nYou won ${payout}!")

# Update the balance


balance += payout - bet

else:
print("Game over! You ran out of funds.")
if __name__ == "__main__":
casino_game()

else:
print('invalid choice')

output

morse code

Casino slot machine


Further development area

### Morse Code Conversion Project:

1. **Graphical User Interface (GUI):**

- Develop a GUI using libraries like Tkinter or PyQt to provide a more user-friendly interface for
Morse code conversion.

2. **Audio Output:**

- Integrate sound output to represent Morse code as audio signals, allowing users to hear the code
in addition to visual representation.

3. **Decode Unknown Morse Code:**

- Implement a feature to automatically decode Morse code without spaces, allowing users to input
continuous Morse code strings.

4. **Text-to-Speech Integration:**

- Add a feature to convert Morse code to spoken words using text-to-speech (TTS) libraries.

### Casino Slot Machine Game:

1. **Graphics and Animation:**

- Enhance the visual appeal with graphical elements and animations. Libraries like Pygame can be
used for creating interactive and visually appealing interfaces.

2. **Multiple Paylines:**

- Implement a system with multiple paylines, giving players more chances to win and making the
game more exciting.

3. **Bonus Rounds:**

- Introduce bonus rounds or mini-games that players can access based on specific conditions or
winning combinations.
4. **Player Profiles and Persistence:**

- Implement a system to save player profiles, allowing users to track their progress and
achievements over multiple sessions.

5. **Soundtrack and Effects:**

- Enhance the audio experience with background music, sound effects, and interactive sounds
during spins and wins.

6. **Settings and Customization:**

- Allow players to customize aspects such as bet amounts, the number of reels, or even the
appearance of the slot machine.

7. **Leaderboards and Social Features:**

- Integrate leaderboards to encourage competition among players. Consider adding social features
for sharing achievements.

8. **Mobile Optimization:**

- Optimize the game for mobile devices, making it accessible to a broader audience.

9. **Progressive Jackpot System:**

- Implement a progressive jackpot system that grows over time as more players participate.

10. **Achievements and Rewards:**

- Add an achievement system with rewards to incentivize continued gameplay.

BIBILOGRAPHY

https://morsecode.world/international/morse2.html

https://en.wikipedia.org/wiki/Casino_game

save and send me the blank copy and then edit it with your name and class and submit it to your
teacher

You might also like