CLI-Carnival 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: CLI_Carnival
3
+ Version: 0.1.0
4
+ Summary: It Is A Carnival with Games that Run In The Command Line
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
@@ -0,0 +1,14 @@
1
+ pyproject.toml
2
+ CLI_Carnival.egg-info/PKG-INFO
3
+ CLI_Carnival.egg-info/SOURCES.txt
4
+ CLI_Carnival.egg-info/dependency_links.txt
5
+ CLI_Carnival.egg-info/entry_points.txt
6
+ CLI_Carnival.egg-info/top_level.txt
7
+ Carnival/Number_Guesser.py
8
+ Carnival/anagram.py
9
+ Carnival/chance.py
10
+ Carnival/hangman.py
11
+ Carnival/main.py
12
+ Carnival/mastermind.py
13
+ Carnival/rock_paper_scissors.py
14
+ Carnival/word_cache.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ Carnival = Carnival.main:main
@@ -0,0 +1 @@
1
+ Carnival
@@ -0,0 +1,43 @@
1
+ import time
2
+ import random
3
+ import os
4
+ def guesser(ticket):
5
+ previous = []
6
+ number = random.randint(1, 101)
7
+ correct = False
8
+ os.system('clear')
9
+ while correct != True:
10
+
11
+ try:
12
+ guess = int(input("Please Guess A Number: "))
13
+ if number > guess:
14
+ if number - guess >= 25:
15
+ print("Way Too Low")
16
+ elif number - guess < 25 and number - guess > 5:
17
+ print("Too Low")
18
+ elif number - guess <= 5:
19
+ print("Barely Too Low")
20
+ if number < guess:
21
+ if guess - number >= 25:
22
+ print("Way Too High")
23
+ elif guess - number < 25 and guess - number > 5:
24
+ print("Too High")
25
+ elif guess - number <= 5:
26
+ print("Barely Too High")
27
+ if number == guess:
28
+ print("You Got It Correct!")
29
+ correct = True
30
+ previous.append(guess)
31
+ input("Press Enter To Continue")
32
+ os.system('clear')
33
+ print (f"Previous Guesses {previous}")
34
+ except:
35
+ print("Please Enter A Number")
36
+ continue
37
+ if 10 - len(previous) <= 0:
38
+ print("However, You Have Taken Too Many Tries, You Receive 0 Tickets")
39
+ else:
40
+ print(f"You Have Earned {10 - len(previous)} Tickets!")
41
+ input()
42
+ os.system('clear')
43
+ return 10 - len(previous)
@@ -0,0 +1,27 @@
1
+ import random
2
+ import os
3
+ from word_cache import *
4
+
5
+ def anagram(Tickets):
6
+ os.system('clear')
7
+ answer = list(cache[random.randint(1, len(cache))])
8
+ scramble = answer.copy()
9
+ random.shuffle(scramble)
10
+ answer = ''.join(answer)
11
+ scramble = ''.join(scramble)
12
+ print(f"Your Anagram Is {scramble}")
13
+ guess = input("What Do You Think The Correct Word Is? ").lower()
14
+ if guess == answer:
15
+ print()
16
+ print(f"You Got It Right, You Have Received {len(answer)} Tickets")
17
+ print()
18
+ input("Press Enter To Continue")
19
+ return len(list(answer))
20
+ else:
21
+ print("Sorry, That Is Incorrect")
22
+ print()
23
+ print(f"The Correct Answer Was {answer}"
24
+ )
25
+ print()
26
+ input("Press Enter To Continue")
27
+ return 0
@@ -0,0 +1,41 @@
1
+ import time
2
+ import os
3
+ import random
4
+ def chance(tickets):
5
+ os.system('clear')
6
+ timer = 0
7
+ timeing = 0.001
8
+ good = False
9
+ while good == False:
10
+ good = True
11
+ wager = int(input("How Many Tickets Are You Wagering? "))
12
+ if wager > tickets:
13
+ print(" You Cannot Wager More Tickets Than You Have")
14
+ good = False
15
+ print()
16
+ input("Press Enter To Continue")
17
+ os.system('clear')
18
+ rand = random.randint((-wager),(2 * wager))
19
+ problem = random.randint(0,2)
20
+ while timer < 75:
21
+ print(rand)
22
+ print(timeing)
23
+ print(timer)
24
+ rand += 1
25
+ time.sleep(0.00 + timeing)
26
+ os.system('clear')
27
+ timeing *= 1.1
28
+ timer += 1
29
+ if rand > (2 * wager):
30
+ rand = (-wager)
31
+ if rand <= 0:
32
+ print(f"******:( {rand} ):******")
33
+ print("Better Luck Next Time")
34
+ print()
35
+ input("Press Enter To Continue")
36
+ else:
37
+ print(f"!!!!!!!!!!{rand}!!!!!!!!!")
38
+ print("WINNER WINNER WINNER")
39
+ print()
40
+ input("Press Enter To Continue")
41
+ return rand
@@ -0,0 +1,70 @@
1
+ from word_cache import *
2
+ import random
3
+ import os
4
+ def hangman(tickets):
5
+ wrong = 0
6
+ rand = random.randint(1,501)
7
+ word = list(cache[rand])
8
+ wrong = 0
9
+ win = False
10
+ wronglet = []
11
+ while wrong != 6 and win != True:
12
+ while wrong !=6 and win != True:
13
+ os.system('clear')
14
+ print(art[wrong])
15
+ print(word)
16
+ print(f"Guessed Letters {wronglet}")
17
+ for letter in word:
18
+ if letter.isupper():
19
+ print(f" {letter} ", end="")
20
+ else:
21
+ print("--- ", end="")
22
+ guess = input("Please Guess A Letter Or A Word: ").lower()
23
+ if guess == cache[rand]:
24
+ win = True
25
+ print(f"You Got It Correct! You Have Earned {len(word)} Tickets")
26
+ print()
27
+ input("Press Enter To Continue")
28
+ os.system('clear')
29
+ return len(word)
30
+ for let in word:
31
+ if guess == let:
32
+ print(f"{guess} Is In The Word")
33
+ for i in range(len(word)):
34
+ if word[i] == guess:
35
+ word[i] = guess.upper()
36
+ if all(letter.isupper() for letter in word):
37
+ win = True
38
+ os.system('clear')
39
+ print(f""" {art[wrong]}
40
+ The Word Was {word}
41
+ You Have Received {len(word)}
42
+ """
43
+ )
44
+ input("Press Enter To Continue")
45
+ os.system('clear')
46
+ return len(word)
47
+ print()
48
+ input("Press Enter To Continue")
49
+ print()
50
+ break
51
+
52
+ else:
53
+ print("Sorry, That Letter Is Not In The Word")
54
+ wronglet.append(guess)
55
+ wrong += 1
56
+ print()
57
+ input('Press Enter To Continue')
58
+ break
59
+
60
+ if wrong >= 5:
61
+ print("Better Luck Next Time")
62
+ print()
63
+ input("Press Enter To Continue"
64
+ )
65
+ return 0
66
+ else:
67
+ print(f"You Got The Word Correct, You Have Received {len(word)} Tickets")
68
+ print()
69
+ input("Press Enter To Continue")
70
+ return len(word)
@@ -0,0 +1,95 @@
1
+ from rock_paper_scissors import *
2
+ from Number_Guesser import *
3
+ from chance import *
4
+ from hangman import *
5
+ from mastermind import *
6
+ from anagram import *
7
+
8
+ Tickets = 5
9
+ game_list = ["rock paper scissors", "number guess", "exit", "1", "2", "3", "chance", "4", "hangman", "5", "mastermind", "6", "anagram", "7"]
10
+ exit = False
11
+ while exit == False:
12
+ if Tickets <= 0:
13
+ print(Tickets)
14
+ print("Sorry, You Are Too Poor, Why Dont You Come Back When You Are A Little, Hmm, Richer")
15
+ print(""
16
+ )
17
+ exit = False
18
+ input()
19
+ break
20
+ os.system('clear')
21
+ print("Welcome to Mr Pythons Carnival Of Fun")
22
+ print("")
23
+ print(f"Your Current Ticket Count Is {Tickets}")
24
+ print("")
25
+ with open("leaderboard.txt") as f:
26
+ leader = [line.strip() for line in f if line.strip()]
27
+ leader.sort(key=lambda line: int(line.split()[-2]), reverse=True)
28
+ print("The Current Leaderboard:\n")
29
+ for line in leader:
30
+ print(line)
31
+ print()
32
+ print("""The Game Selection And Their Costs Are
33
+ 1: Rock Paper Scissors : 2 Tickets
34
+ 2: Number Guess : 5 Tickets
35
+ 3: Chance : Wagerable
36
+ 4: Hangman : 3
37
+ 5: Mastermind : 4
38
+ 6: Anagrams : 2
39
+ 7: Exit
40
+ """)
41
+ game = input("What Game Would You Like To Play? ").lower()
42
+ if game not in game_list:
43
+ os.system('clear')
44
+ print("Error: That Game Is Not In The Catalog")
45
+ input("")
46
+ os.system('clear')
47
+ else:
48
+ if game == "rock paper scissors" or game == "1":
49
+ Tickets -= 2
50
+ new_tickets = rock_paper_scissors(Tickets)
51
+ Tickets += new_tickets
52
+ os.system('clear')
53
+ if game == "number guess" or game == 2:
54
+ Tickets -= 5
55
+ new_tickets = guesser(Tickets)
56
+ Tickets += new_tickets
57
+ os.system('clear')
58
+ if game == "chance" or game == "3":
59
+ os.system('clear')
60
+ Tickets += chance(Tickets)
61
+ os.system('clear')
62
+ if game == "hangman" or game == "4":
63
+ os.system('clear')
64
+ Tickets -= 3
65
+ Tickets += hangman(Tickets)
66
+ os.system('clear')
67
+ if game == "mastermind" or game == "5":
68
+ os.system('clear')
69
+ Tickets -= 4
70
+ Tickets += mastermind(Tickets)
71
+ os.system('clear')
72
+ if game == "anagrams" or game == "6":
73
+ os.system('clear')
74
+ Tickets -= 2
75
+ Tickets += anagram(Tickets)
76
+ os.system('clear')
77
+ if game == "exit" or game == "7":
78
+ exit = True
79
+ os.system('clear')
80
+ correct = True
81
+ while correct == True:
82
+ correct = False
83
+ question = input("Would You Like To Save Your Tickets On The Leaderboard. Y/N: ").lower()
84
+ if question.lower() != "y" and question.lower() != "n" and question.lower() != "yes" and question.lower() != "n":
85
+ os.system('clear')
86
+ input(""" Please Make Sure Your Answer Is Either Yes, No, Y, or N.
87
+
88
+ Press Enter To Continue""")
89
+ correct = True
90
+ if question == "y" or "yes":
91
+ os.system('clear')
92
+ name = input("Please Enter A Name For You: ")
93
+ with open("leaderboard.txt", "a") as f:
94
+ f.write(f"{name} Has Earned {Tickets} Tickets\n")
95
+ break
@@ -0,0 +1,61 @@
1
+ import os
2
+ import time
3
+ import random
4
+
5
+ def mastermind(Tickets):
6
+ code1 = random.randint(1, 9)
7
+ code2 = random.randint(1, 9)
8
+ code3 = random.randint(1, 9)
9
+ code4 = random.randint(1, 9)
10
+ code5 = random.randint(1, 9)
11
+ code = str(code1) + str(code2) + str(code3) + str(code4) + str(code5)
12
+ win = False
13
+ attempt = 0
14
+ while win != True and attempt < 10:
15
+ while win != True and attempt < 10:
16
+ print(code)
17
+ guess = list(input("Please Guess A 5 Digit Combo: "))
18
+ if len(guess) != 5:
19
+ os.system('clear')
20
+ print("This Game Requires Exactly 5 Digits")
21
+ print()
22
+ input("Press Enter To Continue")
23
+ os.system('clear')
24
+ break
25
+ if all(s.isdigit() for s in guess) == False:
26
+ os.system('clear')
27
+ print("Please Only Enter Numbers")
28
+ print()
29
+ input("Press Enter To Continue")
30
+ os.system('clear')
31
+ break
32
+ print(f"Attempt {attempt}/10")
33
+ print(guess)
34
+ check = -1
35
+ for num in guess:
36
+ check += 1
37
+ if num in code:
38
+ if num == code[check]:
39
+ print("🟢", end="")
40
+ else:
41
+ print("🟡", end="")
42
+ else:
43
+ print("🔴", end="")
44
+ attempt += 1
45
+ if "".join(guess) == code:
46
+ win = True
47
+ if attempt >= 10 and win != True:
48
+ os.system('clear')
49
+ print("Too Many Attempts, You Have Failed")
50
+ print()
51
+ input("Press Enter To Continue")
52
+ if win == True:
53
+ os.system('clear')
54
+ print("You Gessed The Code, Congratulations, You Have Earned 8 Tickets")
55
+ print()
56
+ input("Press Enter To Continue")
57
+ return (10 - attempt)
58
+
59
+
60
+
61
+
@@ -0,0 +1,78 @@
1
+ import random
2
+ import os
3
+ points = 0
4
+ cpoints = 0
5
+ def rock_paper_scissors(ticket):
6
+ os.system('cls' if os.name == 'nt' else 'clear')
7
+ global points
8
+ global cpoints
9
+ cpoints = 0
10
+ points = 0
11
+ while points < 3 and cpoints < 3:
12
+ npoints = 0
13
+ print(f"Your Points: {points}")
14
+ print(f"Computer Points: {cpoints}")
15
+ computer = random.randint(1, 3)
16
+ if computer == 1:
17
+ guess = "Rock"
18
+ elif computer == 2:
19
+ guess = "Paper"
20
+ elif computer == 3:
21
+ guess = "Scissors"
22
+ proper = False
23
+ while proper == False:
24
+ proper = True
25
+ pguess = input("Your Guess: ").capitalize()
26
+ if pguess != "Rock" and pguess != "Scissors" and pguess != "Paper" and pguess != "Exit":
27
+ os.system('cls' if os.name == 'nt' else 'clear')
28
+ print("Invalid Throw, Try Again")
29
+ proper = False
30
+ input()
31
+ os.system('cls' if os.name == 'nt' else 'clear')
32
+ print(f"You Guessed: {pguess}")
33
+ print(f"Computer Guessed: {guess}")
34
+ if pguess == "Rock":
35
+ if guess == "Paper":
36
+ print("You Lose")
37
+ cpoints += 1
38
+ if guess == "Scissors":
39
+ print("You Win")
40
+ points += 1
41
+ if guess == "Rock":
42
+ print("Its A Tie")
43
+ if pguess == "Paper":
44
+ if guess == "Scissors":
45
+ print("You Lose")
46
+ cpoints += 1
47
+ if guess == "Rock":
48
+ print("You Win")
49
+ points += 1
50
+ if guess == "Paper":
51
+ print("Its A Tie")
52
+ if pguess == "Scissors":
53
+ if guess == "Rock":
54
+ print("You Lose")
55
+ cpoints += 1
56
+ if guess == "Paper":
57
+ print("You Win")
58
+ points += 1
59
+ if guess == "Scissors":
60
+ print("Its A Tie")
61
+ if pguess == "Exit":
62
+ break
63
+ os.system('cls' if os.name == 'nt' else 'clear')
64
+ if cpoints > points:
65
+ print ("You Have Lost")
66
+ print()
67
+ print (f"You Have Won {points} Tickets")
68
+ print()
69
+ print("Thank You For Playing, Press Enter To Return To The Carnival")
70
+ input()
71
+ os.system('cls' if os.name == 'nt' else 'clear')
72
+ return points
73
+ else:
74
+ print ("You Win")
75
+ print(f"You Have Won {points * 3} Tickets")
76
+ input()
77
+ os.system('cls' if os.name == 'nt' else 'clear')
78
+ return points * 3
@@ -0,0 +1,51 @@
1
+ cache = ["citrus", "sunflower", "kind", "tiger", "tusk", "bill", "string", "silk", "truth", "trunk", "sour", "universe", "engineer", "paw", "common", "crocodile", "bison", "mattress", "sparrow", "teacher", "wrench", "no", "spine", "interval", "go", "luminous", "a", "wool", "awkward", "foot", "foolish", "fear", "silent", "possible", "jar", "generous", "citizen", "vanilla", "high", "sweet", "floral", "tiny", "gold", "bark", "kernel", "seahorse", "wisdom", "dune", "factory", "ladle", "cinnamon", "ham", "sister", "meadow", "orbit", "anchor", "fix", "swan", "charcoal", "socket", "mirror", "cake", "spider", "orchid", "nail", "vine", "rabbit", "turkey", "pilot", "burnt", "jellyfish", "tell", "lion", "rough", "blossom", "cream", "lilac", "shy", "sink", "pigeon", "pie", "athlete", "tall", "middle", "sheep", "bicycle", "ordinary", "plug", "beak", "pansy", "bus", "mild", "yard", "difficult", "flashlight", "person", "theater", "pull", "stamp", "chocolate", "lightning", "sandwich", "earth", "chicken", "scale", "far", "petal", "slug", "toad", "cod", "expedition", "rest", "lock", "weak", "shield", "lose", "salt", "mouth", "thumb", "corner", "hedgehog", "lie", "plastic", "uncle", "learn", "squirrel", "soldier", "humble", "gentle", "nose", "spark", "judge", "immense", "baker", "stem", "speaker", "beaver", "interest", "raven", "iris", "flower", "couch", "fringe", "grin", "bright", "candle", "ash", "package", "zebra", "area", "task", "beach", "ripe", "beige", "forehead", "plate", "patient", "turquoise", "timid", "farm", "curl", "effect", "hopeless", "salad", "transparent", "pleased", "across", "shirt", "hill", "lily", "hoof", "dill", "chuckle", "barley", "poet", "soar", "parrot", "door", "stand", "finger", "koala", "moss", "clear", "tail", "kettle", "hawk", "cruel", "nation", "find", "playground", "clever", "bedroom", "arrive", "warm", "station", "carry", "side", "rumor", "reluctant", "warehouse", "short", "puzzled", "precise", "concert", "hold", "window", "catch", "murky", "cow", "wing", "scanner", "freezing", "shore", "zipper", "orangutan", "curry", "challenge", "walk", "uniform", "brother", "right", "minute", "grape", "fact", "mango", "onion", "rare", "green", "freckle", "the", "cinema", "box", "instant", "road", "rhododendron", "salty", "stay", "hip", "thunder", "gallery", "morning", "alpaca", "drift", "battery", "wood", "winter", "stage", "storm", "golden", "horn", "antenna", "present", "read", "amazed", "skin", "dress", "skill", "rainforest", "cauliflower", "candy", "if", "know", "arena", "sushi", "bitter", "cup", "sleep", "so", "moth", "rock", "armor", "large", "past", "time", "drill", "open", "sketch", "toffee", "history", "cupboard", "dim", "woods", "obvious", "scarlet", "brave", "ponytail", "melt", "float", "shadow", "phone", "rosemary", "feather", "cherry", "pathway", "around", "sprout", "heron", "bacon", "origin", "flamingo", "tram", "habit", "hummingbird", "thyme", "tart", "sugar", "wait", "squash", "smoke", "printer", "hail", "laugh", "firetruck", "subway", "lazy", "fable", "reflective", "screw", "website", "seagull", "fox", "spear", "sword", "place", "savory", "robin", "egg", "bring", "wasp", "truck", "parsley", "owl", "crow", "strange", "crunchy", "wind", "motorcycle", "not", "arid", "camera", "sharp", "snake", "clover", "computer", "rotten", "wall", "burn", "wrist", "pastry", "path", "mother", "chestnut", "bean", "plain", "mushroom", "move", "whale", "raspberry", "feel", "pharmacist", "run", "teal", "cloth", "send", "red", "careful", "eager", "olive", "dragonfly", "zinnia", "antler", "pan", "penguin", "dolphin", "actor", "pot", "hard", "sofa", "fierce", "raw", "problem", "microscope", "scooter", "bun", "crate", "coat", "modest", "radio", "taxi", "mouse", "average", "wardrobe", "astonished", "complex", "tendon", "heart", "graceful", "jam", "worm", "shocked", "fence", "yes", "file", "hibiscus", "tangy", "beyond", "pumpkin", "flame", "bottom", "headphone", "dawn", "rise", "harbor", "comfortable", "library", "back", "price", "pedal", "ambulance", "volcano", "tight", "legend", "stale", "cricket", "season", "berry", "solution", "ladder", "pizza", "vase", "handle", "dandelion", "glove", "low", "oyster", "fern", "anxious", "lantern", "whisker", "match", "orange", "day", "lung", "love", "iron", "clock", "document", "crowded", "taco", "shell", "chimpanzee", "ape", "dance", "lake", "thick", "stool", "starfish", "police", "break", "navy", "evening", "puzzle", "empty", "kangaroo", "stranger", "rain", "length", "lighter", "tale", "star", "office", "chin", "sea", "shop", "workshop", "grow", "pig", "cookie", "noodle", "brain", "snow", "desert", "trade", "ice", "carpet", "mechanic", "weight", "brilliant", "glittering", "bat", "steel", "lamp", "dentist", "glass", "location", "soil", "rainbow", "musty", "region", "cactus"]
2
+ art = ['''
3
+ +---+
4
+ | |
5
+ |
6
+ |
7
+ |
8
+ |
9
+ =========''', '''
10
+ +---+
11
+ | |
12
+ O |
13
+ |
14
+ |
15
+ |
16
+ =========''', '''
17
+ +---+
18
+ | |
19
+ O |
20
+ | |
21
+ |
22
+ |
23
+ =========''', '''
24
+ +---+
25
+ | |
26
+ O |
27
+ /| |
28
+ |
29
+ |
30
+ =========''', '''
31
+ +---+
32
+ | |
33
+ O |
34
+ /|\ |
35
+ |
36
+ |
37
+ =========''', '''
38
+ +---+
39
+ | |
40
+ O |
41
+ /|\ |
42
+ / |
43
+ |
44
+ =========''', '''
45
+ +---+
46
+ | |
47
+ O |
48
+ /|\ |
49
+ / \ |
50
+ |
51
+ ''']
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: CLI_Carnival
3
+ Version: 0.1.0
4
+ Summary: It Is A Carnival with Games that Run In The Command Line
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
@@ -0,0 +1,14 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "CLI_Carnival"
7
+ version = "0.1.0"
8
+ description = "It Is A Carnival with Games that Run In The Command Line"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ dependencies = [] # e.g. ["requests", "numpy"]
12
+
13
+ [project.scripts]
14
+ Carnival = "Carnival.main:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+