This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('hello world') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Component 1 of elements Quiz project - selecting the difficulty | |
Gets the difficulty the user wants to play at | |
And links that with the corresponding elements | |
Written by Nathan Smith | |
05/08/2021""" | |
import ast | |
# Making sure that the input is valid and |
OlderNewer