repl.it
@JakeBusse/

Madlibber_Python

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import random

nouns = ["lock", "key", "bank", "Howie Mandell", "phone", "microphone", "speaker", "radio", "cage", "label", "can", "Betty White", "Katy Perry", "Taylor Swift", "Mark Cohn", "Elvis", "Mall of America", "Target", "Walmart", "Best Buy", "home", "rubber band", "glue", "coaster", "car", "motorcycle"]
pluralNouns = ["locks", "keys", "banks", "phones", "microphones", "speakers", "radios", "cages", "labels", "cans", "houses", "rubber bands", "glues", "coasters", "cars", "motorcycles"]
verbs = ["run", "walk", "jump", "skip", "shake", "eat", "drink", "consume", "enjoy"]
lyVerbs = ["fly", "dally", "dillydally", "imply"]
adjectives = ["red", "orange", "yellow", "green", "blue", "purple", "brown", "gray", "pink", "heavy", "large", "tall", "small", "petite", "ugly", "pretty", "beautiful", "crazy", "nice", "full", "empty", "stinky", "painful"]
adverbs = ["now", "then", "above", "abroad", "before", "after", "later", "fully", "seldom", "occasionally"]
bodyParts = ["head", "shoulder", "knee", "toe", "hand", "stomach", "arm", "nose", "tooth", "mouth"]
pluralBodyParts = ["legs", "arms", "elbows", "knees", "hands", "feet", "toes", "fingers", "shoulders", "eyes"]
names = ["John", "William", "Charles", "George", "James", "Joseph", "Frank", "Henry", "Elizabeth", "Katie", "Michelle", "Lauren", "Jenna"]
foods = ["Apple", "Orange", "Steak", "Chicken"]

def nounSelection():
  global noun
  noun = random.choice(nouns)
  return noun

def pluralNounSelection():
  global pluralNoun
  pluralNoun = random.choice(pluralNouns)
  return pluralNoun

def verbSelection():
  global verb
  verb = random.choice(verbs)
  return verb

def lyVerbSelection():
  global lyVerb
  lyVerb = random.choice(lyVerbs)
  return lyVerb

def adjectiveSelection():
  global adjective
  adjective = random.choice(adjectives)
  return adjective

def adverbSelection():
  global adverb
  adverb = random.choice(adverbs)
  return adverb

def bodyPartSelection():
  global bodyPart
  bodyPart = random.choice(bodyParts)
  return bodyPart

def pluralBodyPartSelection():
  global pluralBodyPart
  pluralBodyPart = random.choice(pluralBodyParts)
  return pluralBodyPart

def nameSelection():
  global name
  name = random.choice(names)
  return name

def foodSelection():
  global food
  food = random.choice(foods)
  return food

def intro():
  print("Welcome to the Madlibber, this application is used to aid in the common game of 'Madlibs' by choosing a random word (noun, verb, adjective, adverb, etc.).\n\n\n")
  print("SYSTEM READY")

intro()

# ----- LOGIC

def nounPrint():
  print("Does the noun need to be plural?")
  pluralWord = input()
  pluralWord = pluralWord.lower()
  if pluralWord == "no":
    nounSelection()
    print("\n" + noun)
    wordInput()
  elif pluralWord == "yes":
    pluralNounSelection()
    print("\n" + pluralNoun)
    wordInput()
  else:
    print("Please answer 'YES' or 'NO'")
    nounPrint()

def pluralNounPrint():
  pluralNounSelection()
  print("\n" + pluralNoun)
  wordInput()

def verbPrint():
  print("Does the verb have to end in '-ly'")
  lyWord = input()
  lyWord = lyWord.lower()
  if lyWord == "no":
    verbSelection()
    print("\n" + verb)
    wordInput()
  elif lyWord == "yes":
    lyVerbSelection()
    print("\n" + lyVerb)
    wordInput()
  else:
    print("Please answer 'YES' or 'NO'")
    verbPrint()

def lyVerbPrint():
  lyVerbSelection()
  print("\n" + lyVerb)
  wordInput()

def adjectivePrint():
  adjectiveSelection()
  print("\n" + adjective)
  wordInput()

def adverbPrint():
  adverbSelection()
  print("\n" + adverb)
  wordInput()

def bodyPartPrint():
  print("Does the body part need to be plural?")
  pluralWord = input()
  pluralWord = pluralWord.lower()
  if pluralWord == "no":
    bodyPartSelection()
    print("\n" + bodyPart)
    wordInput()
  elif pluralWord == "yes":
    pluralBodyPartSelection()
    print("\n" + pluralBodyPart)
    wordInput()
  else:
    print("Please answer 'YES' or 'NO'")
    bodyPartPrint()

def namePrint():
  nameSelection()
  print("\n" + name)
  wordInput()

def foodPrint():
  foodSelection()
  print("\n" + food)
  wordInput()

def help():
  print("Noun ---------- 'noun'\nPlural Noun ---------- 'nouns'\nVerb ---------- 'verb'\nVerb Ending in -ly ---------- 'verbly'\nAdjective ---------- 'adjective'\nAdverb ---------- 'adverb'\nPart of the Body ---------- 'body'\nName ---------- 'name'\nFood ---------- 'food'")
  wordInput()



def wordInput():
  print("\nPlease state the word type needed:")
  word = input()
  word = word.lower()

  if word == "noun":
    nounPrint()

  elif word == "nouns":
    pluralNounPrint()

  elif word == "verb":
    verbPrint()

  elif word == "verbly":
    lyVerbPrint()

  elif word == "adjective":
    adjectivePrint()

  elif word == "adverb":
    adverbPrint()

  elif word == "body":
    bodyPartPrint()

  elif word == "name":
    namePrint()

  elif word == "food":
    foodPrint()

# ---- HELP
  elif word == "help":
    help()

  else:
    print("For assistance please write 'HELP'")
    wordInput()

wordInput()