Move things

This commit is contained in:
Cal Wing 2025-02-27 22:10:04 +10:00
parent 136f1a6981
commit 196c4058c6

83
a1.py
View File

@ -270,48 +270,45 @@ def main():
##### End of Assisgnment #####
# See if I get what the task sheet wants
# [NOTE] It seems I am witing my own test suite :/ that wasn't the initention lol
# Tests do equal what I get when i test it in the shell
def sheet_tasks():
from debug_lib import NO_EVAL, TUPLE_EVAL
from debug_lib import compair_outputs, auto_input
# from a1_alex import calc_daily_profit
TASKS = (
(determine_power_used, (5e6, 250, 8, 85), 500.9191176470588),
(determine_water_released, (300, 250, 8, 85), 2994495.4128440367),
(determine_cost_to_pump, (300, 8, 0.02), 48),
(calc_speed_at_outlet, (30,), 24.261079942986875),
(calc_new_water_height, (20, 40000, 1, 30), (19.985143183382704, 592567.1021442247)),
(calc_heights_water_out, (40, 5, 40000, 1, 30), ((39.97898928844613, 39.95798409574207, 39.93698442188801), (838016.4324684857, 837796.3120398963, 837576.1916037091), TUPLE_EVAL)),
(calc_energy_power, tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30), ((386.6002008976669, 386.4523727180418, 386.3045723539472), (46392.024107720026, 46374.28472616501, 46356.548682473665), TUPLE_EVAL)),
(calc_daily_profit, (calc_energy_power(*(tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30)))[0], 0.02, 0.005, 85), 2718.700033709491)
)
compair_outputs(TASKS)
print("\nTask 8")
print_table(280, 20, 6, 30, 20, 40000, 1, 30, 0.02, 0.005, 85)
print("\nTask 9")
global input # This is some magic I wrote a while ago to be an automatic input func
input = auto_input([
"h", "s", "q", "n",
"r", "test", "test_data.txt",
"p 280 20 6",
"r", "test", "test_data_2.txt",
's',
"q", "y"
])
main()
if __name__ == '__main__':
# See if I get what the task sheet wants
# [NOTE] It seems I am witing my own test suite :/ that wasn't the initention lol
# Tests do equal what I get when i test it in the shell
def sheet_tasks():
from debug_lib import NO_EVAL, TUPLE_EVAL
from debug_lib import compair_outputs, auto_input
# from a1_alex import calc_daily_profit
TASKS = (
(determine_power_used, (5e6, 250, 8, 85), 500.9191176470588),
(determine_water_released, (300, 250, 8, 85), 2994495.4128440367),
(determine_cost_to_pump, (300, 8, 0.02), 48),
(calc_speed_at_outlet, (30,), 24.261079942986875),
(calc_new_water_height, (20, 40000, 1, 30), (19.985143183382704, 592567.1021442247)),
(calc_heights_water_out, (40, 5, 40000, 1, 30), ((39.97898928844613, 39.95798409574207, 39.93698442188801), (838016.4324684857, 837796.3120398963, 837576.1916037091), TUPLE_EVAL)),
(calc_energy_power, tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30), ((386.6002008976669, 386.4523727180418, 386.3045723539472), (46392.024107720026, 46374.28472616501, 46356.548682473665), TUPLE_EVAL)),
(calc_daily_profit, (calc_energy_power(*(tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30)))[0], 0.02, 0.005, 85), 2718.700033709491)
)
compair_outputs(TASKS)
print("\nTask 8")
print_table(280, 20, 6, 30, 20, 40000, 1, 30, 0.02, 0.005, 85)
print("\nTask 9")
global input # This is some magic I wrote a while ago to be an automatic input func
input = auto_input([
"h", "s", "q", "n",
"r", "test", "test_data.txt",
"p 280 20 6",
"r", "test", "test_data_2.txt",
's',
"q", "y"
])
main()
sheet_tasks()