diff --git a/2025Beta/prob00.py b/2025Beta/prob00.py new file mode 100644 index 0000000..d697ae2 --- /dev/null +++ b/2025Beta/prob00.py @@ -0,0 +1,3 @@ +print("""We are pleased to announce the launch of our new game. +It is going to dominate the... hang on I am being handed a note... +""") \ No newline at end of file diff --git a/2025Beta/prob01.py b/2025Beta/prob01.py new file mode 100644 index 0000000..874b4e0 --- /dev/null +++ b/2025Beta/prob01.py @@ -0,0 +1,2 @@ +name = input() +print(f"Retraction: Did I say that out loud? I apologize, {name}. While you are a meatbag, I suppose I should not call you such.") \ No newline at end of file diff --git a/2025Beta/prob02.py b/2025Beta/prob02.py new file mode 100644 index 0000000..6e73caa --- /dev/null +++ b/2025Beta/prob02.py @@ -0,0 +1,21 @@ +# simply grab all flashes +nums = [] +while True: + num = input() + if num == "0": + break + nums.append(int(num)) + +# make a list of all odds +odds = [] +for num in nums: + if num % 2 != 0: + odds.append(num) + +# if there are any odds, print them and print FLASH FAILED otherwise print FLASH FORWARD +if len(odds) > 0: + for odd in odds: + print(f"{odd} is odd") + print("FLASH FAILED") +else: + print("FLASH FORWARD") \ No newline at end of file diff --git a/2025Beta/prob03.py b/2025Beta/prob03.py new file mode 100644 index 0000000..f3c70b6 --- /dev/null +++ b/2025Beta/prob03.py @@ -0,0 +1,36 @@ +import math +# Dictionary to store the operations and a list of all the equations +ops = {"ADD" : '+', "SUBTRACT" : '-', "MULTIPLY" : '*', "DIVIDE" : '/'} +equations: list[str] = [] + +def op(a:float, b:float, operation:str) -> float: + if operation == "ADD": + return a + b + elif operation == "SUBTRACT": + return a - b + elif operation == "MULTIPLY": + return a * b + else: + return a / b + +# Get all the equations +while True: + equation = input() + if equation == "END": break + equations.append(equation) + +# Iterate through all the equations and check if the output is correct +for equation in equations: + # Split the equation into the numbers, operation, and output + equation = equation.split() + A = float(equation[0]) + B = float(equation[1]) + OP = equation[2] + OUT = float(equation[3]) + + # Calculate the output and check if it is correct + output: float = math.trunc(op(A, B, OP) * 10) / 10 + if output == OUT: + print(f"{OUT} is correct for {A} {ops[OP]} {B}") + else: + print(f"{A} {ops[OP]} {B} = {output}, not {OUT}") diff --git a/2025Beta/prob04.py b/2025Beta/prob04.py new file mode 100644 index 0000000..81f3beb --- /dev/null +++ b/2025Beta/prob04.py @@ -0,0 +1,21 @@ +# iterates through all values from 2 to n/2 and checks if n is divisible by any of them +# result determines if the num is prime or not +def is_Prime(n: int) -> bool: + if n <= 1: return False + + for i in range(2, int(n/2) + 1): + if n % i == 0: + return False + return True + +num: int = int(input()) + +# Check if the number is prime +if is_Prime(num): + print(f"{num} is already prime") +else: + # check if the number ahead or behind is prime + if (is_Prime(num + 1) or is_Prime(num - 1)): + print(f"{num} could be a prime!") + else: + print(f"{num} is a bad test specimen") \ No newline at end of file diff --git a/2025Beta/prob05.py b/2025Beta/prob05.py new file mode 100644 index 0000000..8ad2d25 --- /dev/null +++ b/2025Beta/prob05.py @@ -0,0 +1,14 @@ +sep = input() +string = input() +result: str = "" + +# split string by seperator and then reverse the list +string = string.split(sep) +string.reverse() + +# concatenate the string with the seperator +for part in string: + result += f"{part}{sep}" + +# remove the last seperator +print(result[:-len(sep)]) \ No newline at end of file diff --git a/2025Beta/prob06.py b/2025Beta/prob06.py new file mode 100644 index 0000000..4447758 --- /dev/null +++ b/2025Beta/prob06.py @@ -0,0 +1,11 @@ +# grab all the nums and conver to base 10 +quaternaries = [] +while True: + num = input() + if num == "000": + break + quaternaries.append(int(num, 4)) + +# print all out +for num in quaternaries: + print(num) \ No newline at end of file diff --git a/2025Beta/prob07.py b/2025Beta/prob07.py new file mode 100644 index 0000000..8a4430c --- /dev/null +++ b/2025Beta/prob07.py @@ -0,0 +1,22 @@ +grid:list[str] = [] + +# read the grid +while True: + # try catch because their is nothing to detect the bounds of the area + try: + line = input() + print(line) + if line == "": + break + grid.append(line) + except EOFError: + break + +# sees if "A" exists in the grid +for y in range(len(grid)): + for x in range(len(grid[y])): + if grid[y][x] == 'A': + print(f"Get out of there! Danger at ({x}, {y})") + break +else: + print("You are lucky Get back to the office NOW!") \ No newline at end of file diff --git a/2025Beta/prob08.py b/2025Beta/prob08.py new file mode 100644 index 0000000..e84b126 --- /dev/null +++ b/2025Beta/prob08.py @@ -0,0 +1,10 @@ +# read all lines +times = int(input()) +lines = [] +for i in range(times): + lines.append(input()) + +# print all the lines in reverse +lines.reverse() +for line in lines: + print(line) \ No newline at end of file diff --git a/2025Beta/prob09.py b/2025Beta/prob09.py new file mode 100644 index 0000000..5e04502 --- /dev/null +++ b/2025Beta/prob09.py @@ -0,0 +1,46 @@ +from datetime import datetime, timedelta +import os + +# grab vars +signal = input() +start = input() +stop = input() + +# convert to datetime +start_date = datetime.strptime(start, "%Y-%m-%d") +temp_date = start_date +stop_date = datetime.strptime(stop, "%Y-%m-%d") + +# store codes and fund variable +codes = [] +funds = 0.0 + +while True: + + # make a string of the current date + current = str(temp_date.date()) + + # read the file if it exists + if os.path.exists(f"{current}.txt"): + with open(f"{current}.txt", "r") as file: + lines = file.read().split('\n') + file.close() + + # iterate through the lines and parse the data to see if values match + for line in lines: + line = line.split(',') + if line[-1] != signal: continue + + funds += float(line[-2]) + codes.append(line[0]) + # increment the date + temp_date += timedelta(days=1) + + # check if we are done + if current == str(stop_date.date()): + break + +# print the codes and funds sorted +codes.sort() +for code in codes: print(code) +print(f"Funds Found: {funds}") \ No newline at end of file