Skip to content

Instantly share code, notes, and snippets.

print('hello world')
@Mathsmaniac
Mathsmaniac / Movie_Tickets.py
Created June 8, 2021 03:15
the one about movie tickets
totalprice = 0
counta = 0
counts = 0
countc = 0
countg = 0
while True:
yesno = input("Do you want to sell a ticket? (Y/N)")
if yesno == 'N' or yesno == 'n':
break
print('What ype of ticket do you want')
@Mathsmaniac
Mathsmaniac / 01User_Balance.py
Created June 27, 2021 21:38
This function gets an input, and if it is a whole number between 1 and 10, it puts the value inuser_balance
"""
Component 1 of Lucky Unicorn
This function gets an input, and if it is a whole number between 1 and 10, it
puts the value in user_balance
Otherwise, it raises errors and tells the user that a invalid input is entered
until a valid input is entered.
Written by Nathan Smith
28/06/21
"""
@Mathsmaniac
Mathsmaniac / 02Token_GeneratorV2.py
Created July 6, 2021 03:18
Includes constants for payout amounts and loop range
"""
Component 2 of Lucky Unicorn - v2 advanced testing
Include constants for payout amounts and loop range
Format currency for payout calculation
Created by Nathan Smith
28/06/21
"""
import random
@Mathsmaniac
Mathsmaniac / 03Winnings_System.py
Created July 9, 2021 01:37
Calculate winnings for session
"""Component 3 of Lucky Unicorn game - winnings system
Calculate winnings for session
Assumes starting balance of $10 and allows manual input of token for testing purposes
Created by Nathan Smith
08/07/2021
"""
# Assuming starting balance of $10
user_balance = 10
UNICORN_PAYOUT = 5
@Mathsmaniac
Mathsmaniac / Lucky_Unicorn_v1.py
Created July 20, 2021 21:10
First version of fully working program, not yet tested for usability
"""Lucky Unicorn - fully working program, combining all 4 components
First version of fully working program, not yet tested for usability
Created by Nathan Smith
28/06/21
"""
import random
# Integer checking function
@Mathsmaniac
Mathsmaniac / Lucky_Unicorn_v2.py
Created July 22, 2021 06:49
Includes post usability testing changes: Adds introduction at start Makes feedback messages clearer regarding wins and losses
"""Lucky Unicorn - fully working program, combining all 4 components v2
Includes post usability testing changes:
Adds introduction at start
Makes feedback messages clearer regarding wins and losses
Created by Nathan Smith
28/06/21
"""
import random
@Mathsmaniac
Mathsmaniac / Lucky_Unicorn_v3.py
Created July 22, 2021 07:43
Adds token formatting function To clearly differentiate tokens making them readily identifiable
"""Lucky Unicorn - fully working program, combining all 4 components v3
Adds token formatting function
To clearly differentiate tokens making them readily identifiable
Created by Nathan Smith
28/06/21
"""
import random
@Mathsmaniac
Mathsmaniac / Lucky_Unicorn_v4.py
Created July 22, 2021 08:38
Added round counter and included round details in feedback to player
"""Lucky Unicorn - fully working program, combining all 4 components v3
Added round counter and included round details in feedback to player
Created by Nathan Smith
28/06/21
"""
import random
# Integer checking function
@Mathsmaniac
Mathsmaniac / 02make_question.py
Created August 22, 2021 20:51
Will get the amount of elements corresponding to the difficulty And then ask the question with those, and only those elements in it Will also have the answer for the question stored in a separate variable
"""Component 2 of elements Quiz project - making the question to ask the user
Will get the amount of elements corresponding to the difficulty
And then ask the question with those, and only those elements in it
Will also have the answer for the question stored in a separate variable
Written by Nathan Smith
05/08/2021"""
import ast
import random