Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 2025Beta/prob00.py
Original file line number Diff line number Diff line change
@@ -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...
""")
2 changes: 2 additions & 0 deletions 2025Beta/prob01.py
Original file line number Diff line number Diff line change
@@ -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.")
21 changes: 21 additions & 0 deletions 2025Beta/prob02.py
Original file line number Diff line number Diff line change
@@ -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")
36 changes: 36 additions & 0 deletions 2025Beta/prob03.py
Original file line number Diff line number Diff line change
@@ -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}")
21 changes: 21 additions & 0 deletions 2025Beta/prob04.py
Original file line number Diff line number Diff line change
@@ -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")
14 changes: 14 additions & 0 deletions 2025Beta/prob05.py
Original file line number Diff line number Diff line change
@@ -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)])
11 changes: 11 additions & 0 deletions 2025Beta/prob06.py
Original file line number Diff line number Diff line change
@@ -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)
22 changes: 22 additions & 0 deletions 2025Beta/prob07.py
Original file line number Diff line number Diff line change
@@ -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!")
10 changes: 10 additions & 0 deletions 2025Beta/prob08.py
Original file line number Diff line number Diff line change
@@ -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)
46 changes: 46 additions & 0 deletions 2025Beta/prob09.py
Original file line number Diff line number Diff line change
@@ -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}")