This file contains hidden or 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 hidden or 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
    
  
  
    
  | def calc_ticket(type): | |
| adult = 12.50 | |
| student = 9.00 | |
| child = 7.00 | |
| gift = 0.00 | |
| if type == "a": | |
| price = adult | |
| elif type == "s": | |
| price = student | |
| elif type == "c": | 
  
    
      This file contains hidden or 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 Game | |
| Get amount user wants to play with | |
| Created by Joseph Wong | |
| 24/06/21""" | |
| # Integer checking function | |
| def integer_checker(question, low, high): | |
| valid = False | 
  
    
      This file contains hidden or 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 game | |
| Generate the random token | |
| Created by Joseph Wong | |
| 25/06/21 | |
| """ | |
| import random | |
| tokens = ["horse", "zebra", "donkey", "unicorn"] | 
  
    
      This file contains hidden or 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 game | |
| Generate the random token | |
| Created by Joseph Wong | |
| 25/06/21 | |
| """ | |
| import random | |
| tokens = ["horse", "zebra", "donkey", "unicorn"] | 
  
    
      This file contains hidden or 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 game | |
| Generate the random token | |
| Created by Joseph Wong | |
| 25/06/21 | |
| """ | |
| import random | |
| # Balancing the odds - now only a 1/10 chance of getting a unicorn | |
| tokens = ["horse", "horse", "horse", # Keeping line length under 79 chars | |
| "zebra", "zebra", "zebra", | 
  
    
      This file contains hidden or 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 game - v4 advanced testing | |
| Include constants for payout amounts and loop range | |
| Format currency for payout calculation | |
| Created by Joseph Wong | |
| 27/06/21 | |
| """ | |
| import random | |
| HOW_MUCH = 100 # Constant representing the amount spent by user | 
  
    
      This file contains hidden or 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 Joseph Wong | |
| 28/06/2021 | |
| """ | |
| # Assume starting balance of $10 | |
| user_balance = 10 | 
  
    
      This file contains hidden or 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 Joseph Wong | |
| 29/06/21 | |
| """ | |
| import random | |
| # Integer checking function | 
  
    
      This file contains hidden or 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: | |
| Add introduction at start and make feedback messages clearer | |
| regarding wins and losses | |
| Created by Joseph Wong | |
| 1/07/21 | |
| """ | |
| import random | 
OlderNewer