setup monorepo

This commit is contained in:
Matt Arnold 2025-09-04 13:59:01 -04:00
commit 9ca7d28cca
3 changed files with 107 additions and 0 deletions

30
LICENSE Normal file
View File

@ -0,0 +1,30 @@
Copyright (c) 2025 Matt Arnold. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modificatio
n, are permitted provided that the following conditions are met:
1. Redistribution of source code must retain the above copyright notice, t
his list of conditions and the following disclaimer.
2. Redistribution in binary form must reproduce the above copyright notice
, this list of conditions and the following disclaimer in the documentation an
d/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contribut
ors may be used to endorse or promote products derived from this software with
out specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AN
D ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIE
D WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCL
AIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR AN
Y DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LO
SS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A
NY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD
ING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWAR
E, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR U
SE IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACIL
ITY.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# misc
My monorepo for misc stuff.

74
mythic.py Normal file
View File

@ -0,0 +1,74 @@
#!/usr/bin/env python3
# Code mostly written using llms no copyright is claimed
# but in case there is copyrightable matter here
# To the extent possible under law, Matt Arnold
# has waived all copyright and related or neighboring rights
# to Mythic Pie. This work is published from: United States.
import random
# Define the Fate table from Mythic Game Master Emulator
fate_table = [
"Exceptional Yes",
"Yes",
"Yes, but...",
"No, but...",
"No",
"Exceptional No"
]
# Define the Chaos Factor table from Mythic Game Master Emulator
chaos_factor_table = {
1: "Stable",
2: "Low",
3: "Moderate",
4: "Elevated",
5: "High",
6: "Very High",
7: "Extreme",
8: "Absolute Chaos",
9: "Total Chaos",
10: "Impossible Chaos"
}
# Define the Chaos Factor adjustments table from Mythic Game Master Emulator
chaos_factor_adjustments_table = {
"Stable": 0,
"Low": 1,
"Moderate": 2,
"Elevated": 3,
"High": 4,
"Very High": 5,
"Extreme": 6,
"Absolute Chaos": 7,
"Total Chaos": 8,
"Impossible Chaos": 9
}
# Function to roll Fate
def roll_fate(chaos_factor):
# Roll 2d10, one die for the Fate chart, one die for the Fate Modifier
fate_roll = random.randint(1, 10)
modifier_roll = random.randint(1, 10)
# Calculate the final Fate roll
final_roll = fate_roll + modifier_roll + chaos_factor_adjustments_table[chaos_factor] - 6
# If the final roll is less than 1, set it to 1
if final_roll < 1:
final_roll = 1
# If the final roll is greater than 6, set it to 6
if final_roll > 6:
final_roll = 6
# Return the result
return fate_table[final_roll - 1]
# Test the function with a Chaos Factor of "Moderate"
chaos_factor = "Moderate"
new_chaos_factor = random.randint(1, 10) + chaos_factor_adjustments_table[chaos_factor]
print("Chaos Factor:", chaos_factor_table[new_chaos_factor])
print("Fate Roll:", roll_fate(chaos_factor))