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
| import random | |
| import string | |
| availablewords = ['anaconda','all of me','rude','chandelier','guts over fear','maps'] | |
| punc = set(string.punctuation) | |
| hangman = "HANGMAN" | |
| tried = set() | |
| def hangmangame(): | |
| again = True | |
| while again: | |
| alreadySaid = set(['a','e','i','o','u','A','E','I','O','U']) |
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
| <pre class="brush: jscript; title: ; notranslate" title=""> | |
| var generate = function (len, chars) { | |
| var ret = '', | |
| charsLen = chars.length; | |
| while (len--) { | |
| ret += chars[Math.floor(Math.random() * charsLen)]; | |
| } | |
| return ret; | |
| }; |
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
| firstclass = [0]*8 #list that stores first class data | |
| economyclass = [0]*8 #list that stores economy class data | |
| booked = {} #Stores names and seat numbers of booked people | |
| def displayseats(): #This will display seats in a formatted way | |
| print("First Class Economy Class") | |
| for each in range(0,4): | |
| if firstclass[each] == 0: | |
| print("(" +str(each+1) + ")", end='') |
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
| firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data | |
| economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data | |
| booked = {} #Stores names and seat numbers of booked people | |
| def displayseats(): #This will display seats in a formatted way | |
| print("First Class Economy Class") | |
| for each in range(0,4): | |
| if firstclass[each] == 0: | |
| print("(" +str(each+1) + ")", end='') |
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
| firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data | |
| economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data | |
| booked = {} #Stores names and seat numbers of booked people | |
| def displayseats(): #This will display seats in a formatted way | |
| print("First Class Economy Class") | |
| for each in range(0,4): | |
| if firstclass[each] == 0: | |
| print("(" +str(each+1) + ")", end='') |
NewerOlder