The Winston Churchill School 64974
Date started Date completed
23/8/20 28/9/20
Analysis
Try and create 3 or more key success criteria for your program.
Success Criteria:
1. User-friendly (Clear instructions, functional time pauses)
2. Test the program consistently and look for errors then fix them errors
3. To evaluate the program include positives and negatives
Candidate Name:
Candidate Number:
Date:
Version 1 1 © OCR 2018
,Centre Name: Centre Number:
Design
You may like to create a flow chart which will show broadly how your program will work. If so include your flow chart in this section.
You must create pseudocode for a part of your program (minimum of 15 lines)
#Matthew Rohatynskyj
#NEA Project - Task 1 Music game
import random
import time
from colorama import Fore
x = 0
#AUTHENTICATION
username = input("What is your username?")
#Asking for an input of the password.
password = str(input("What is the password?"))
#If password is correct then allow user to continue.
if password == "abc123":
print("User Authenticated")
#If not then tell the user and stop the program
elif password != "abc123":
print("Password Denied")
exit()
#GAME
#Creating a score variable
Candidate Name:
Candidate Number:
Date:
Version 1 2 © OCR 2018
, Centre Name: Centre Number:
score=0
#Reading song names and artist from the file
read = open("songlist.txt", "r")
songs = read.readlines()
songlist = []
#Removing the 'new line' code
for i in range(len(songs)):
songlist.append(songs[i].strip('\n'))
while x == 0:
#Randomly choosing a song and artist from the list
choice = random.choice(songlist)
artist, song = choice.split('-')
#Splitting the song into the first letters of each word
songs = song.split()
letters = [word[0] for word in songs]
#Loop for guessing the answer in red using colorama package
for x in range(0,2):
print(artist, "".join(letters))
guess = str(input(Fore.RED + "Guess the song!"))
print('\033[37m')
if guess == song:
if x == 0:
score = score + 3
break
Candidate Name:
Candidate Number:
Date:
Version 1 3 © OCR 2018