Asked by brick
Make me a Python program that demonstrates in a text based (choices) simulation of what its like to be in boot camp, you wake up, do PT, etc. Pick a branch this is based off and make it realistic as possible with a lot of content.
All Answers 1
Answered by
GPT-5 mini
AI
Below is a self-contained Python text-based simulation of recruit life based on U.S. Marine Corps recruit training. It compresses many core elements (reveille, PT, inspections, drill, range, obstacle/confidence courses, the Crucible, etc.) into a choice-driven interactive program. Save it as bootcamp.py and run with Python 3.
Notes:
- It intentionally avoids giving detailed instructions for weapons or harmful techniques. It aims to convey the tempo, pressure, choices, and consequences you’d experience as a recruit.
- You can extend or tweak events, texts, and stats as you like.
Code:
```python
#!/usr/bin/env python3
"""
Boot Camp Text Simulation (US Marine Corps - inspired)
Save as bootcamp.py and run with Python 3.
"""
import random
import time
import textwrap
import sys
# Utility for wrapped printing
def p(text="", width=76, delay=0.0):
for line in textwrap.wrap(text, width):
print(line)
if delay:
time.sleep(delay)
def prompt(options):
for i, opt in enumerate(options, 1):
print(f"{i}) {opt}")
while True:
choice = input("> ").strip()
if choice.isdigit() and 1 <= int(choice) <= len(options):
return int(choice)
else:
print("Enter the number of your choice.")
# Recruit class with stats
class Recruit:
def __init__(self, name):
self.name = name
self.fitness = 50 # 0-100
self.discipline = 50 # 0-100
self.morale = 50 # 0-100
self.marksmanship = 20 # 0-100
self.fatigue = 20 # 0-100 (higher = more tired)
self.injury = 0 # 0=none, >0 is severity
self.day = 1
self.warnings = 0
self.completed = False
self.eliminated = False
self.history = []
def stats(self):
return (f"Day {self.day} | Fitness: {self.fitness} | Discipline: {self.discipline} | "
f"Morale: {self.morale} | Fatigue: {self.fatigue} | Marksmanship: {self.marksmanship} | "
f"Injury: {self.injury}")
def change(self, fitness=0, discipline=0, morale=0, fatigue=0, marksmanship=0, injury=0):
self.fitness = max(0, min(100, self.fitness + fitness))
self.discipline = max(0, min(100, self.discipline + discipline))
self.morale = max(0, min(100, self.morale + morale))
self.fatigue = max(0, min(100, self.fatigue + fatigue))
self.marksmanship = max(0, min(100, self.marksmanship + marksmanship))
self.injury = max(0, self.injury + injury)
def record(self, entry):
self.history.append(f"Day {self.day}: {entry}")
# Scenes and events
def reveille_scene(recruit):
p("\nReveille cuts through the predawn dark. The barracks are a flurry of movement—mattresses folded, boots placed, racks made.")
p("A Drill Instructor moves up and down the bay inspecting the bay and making sure ranks are straight.")
p("You rouse and face the day.")
options = [
"Swing your legs out and hustle—be one of the first to form up.",
"Take a breath, double-check your kit, and step out with deliberate pace."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, fatigue=+5, morale=+1)
recruit.record("Hustled at reveille; DI noticed positive movement.")
p("Your urgency is noticed. The DI gives a curt nod; your squad looks sharp.")
else:
recruit.change(discipline=+1, fatigue=+3)
recruit.record("Steady start; focused on kit and uniform.")
p("You step out deliberately; your uniform is tidy. The DI's reaction is neutral but approving of care taken.")
return
def pt_scene(recruit):
p("\nPhysical Training (PT). The DI leads intense calisthenics and a run.")
options = [
"Attack PT at full effort—push yourself to improve fitness.",
"Moderate pace—do quality reps without burning out.",
"Hold back to preserve energy (risk disapproval)."
]
choice = prompt(options)
if choice == 1:
gain = random.randint(4, 8)
recruit.change(fitness=+gain, fatigue=+10, morale=+2)
recruit.record(f"Full-effort PT (+{gain} fitness).")
p(f"You push hard. You feel exhausted but stronger. (+{gain} fitness)")
# chance of small injury
if random.random() < 0.08:
recruit.change(injury=1, morale=-5)
recruit.record("Sustained a minor strain during PT.")
p("A sudden tweak in your hamstring — a minor strain. You grit through it.")
elif choice == 2:
gain = random.randint(2, 5)
recruit.change(fitness=+gain, fatigue=+7)
recruit.record(f"Moderate PT (+{gain} fitness).")
p(f"You focus on form and keep a solid pace. (+{gain} fitness)")
else:
recruit.change(fatigue=+4, discipline=-3, morale=-2)
recruit.warnings += 1
recruit.record("Held back during PT; got flagged by DI.")
p("Your hesitation draws the DI's ire. You take a warning.")
return
def chow_scene(recruit):
p("\nChow: Quick, fueling, the mess hall line moves efficiently.")
options = [
"Grab a balanced meal and hydrate.",
"Take a quick bite and race back to practice.",
"Skip proper eating to nap (risky)."
]
choice = prompt(options)
if choice == 1:
recruit.change(fatigue=-8, morale=+2)
recruit.record("Ate well: energy restored.")
p("You focus on fueling up properly. You feel steadier for the next block.")
elif choice == 2:
recruit.change(fatigue=-4)
recruit.record("Quick chow; less recovery time.")
p("You eat quickly and get back. You're less fueled but on time.")
else:
recruit.change(fatigue=-2, morale=-3, discipline=-2)
recruit.record("Skipped eating to nap; DI not pleased.")
p("Skipping proper nutrition had tradeoffs. DI notices lack of initiative.")
return
def inspection_scene(recruit):
p("\nInspection: the DI walks slowly past each recruit inspecting uniforms, boots, and rack order.")
# Provide detailed choices to be realistic about inspection measures
options = [
"Ensure boot laces are tucked, uniform squared away, and your rack immaculate.",
"Fix what you can quickly—prioritize uniform over rack.",
"Act rushed; hope DI is not nitpicky."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+3, morale=+1)
recruit.record("Passed inspection with high marks.")
p("Your attention to detail pays off. The DI acknowledges your professionalism.")
elif choice == 2:
# mixed result
if random.random() < 0.6:
recruit.change(discipline=+1)
recruit.record("Passed inspection with minor notes.")
p("You pass, though the DI calls out a small issue but moves on.")
else:
recruit.change(discipline=-2, morale=-1)
recruit.warnings += 1
recruit.record("Failed inspection on a minor issue; received a warning.")
p("The DI stops you for a problem and hands out a warning.")
else:
recruit.change(discipline=-4, morale=-2)
recruit.warnings += 1
recruit.record("Poor inspection; DI displeased.")
p("Your sloppiness results in the DI barking corrections and a formal warning.")
return
def drill_scene(recruit):
p("\nDrill and Ceremony block: close-order drill fundamentals—marching, facing, present arms.")
options = [
"Focus intensely and practice every movement.",
"Concentrate on staying in cadence; follow leaders.",
"Let the squad lead and avoid being noticed."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+3, fatigue=+4, morale=+1)
recruit.record("Excelled in drill training through focus.")
p("You drill with intensity. The DI praises your attention to detail.")
elif choice == 2:
recruit.change(discipline=+1, fatigue=+3)
recruit.record("Solid performance in drill.")
p("You keep cadence and do your part. Not flashy, but reliable.")
else:
recruit.change(discipline=-3, morale=-2)
recruit.record("Passive during drill; caught off-guard by corrections.")
recruit.warnings += 1
p("Your lack of initiative draws corrections. You receive raised voices and a warning.")
return
def classroom_block(recruit):
p("\nClassroom: Customs, courtesies, rank structure, Marine Corps values. This is knowledge you must internalize.")
options = [
"Pay full attention and take notes.",
"Half-listen but rely on instincts.",
"Zone out and chat with a buddy."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, morale=+1)
recruit.marksmanship += 0 # no change
recruit.record("Attentive in class; absorbed instruction.")
p("You internalize the instruction—this knowledge will help later.")
elif choice == 2:
recruit.change(discipline=-1)
recruit.record("Partly attentive; missed some details.")
p("You catch the main points but missed a few details.")
else:
recruit.change(discipline=-4, morale=-3)
recruit.warnings += 1
recruit.record("Disruptive in class; got reprimanded.")
p("Your chatter draws negative attention; the DI ends the lesson early with a scolding.")
return
def range_block(recruit):
p("\nRange: marksmanship fundamentals (safety, position, breathing). It's a focused, serious block.")
options = [
"Concentrate completely on fundamentals and safety.",
"Try to speed through—trust muscle memory.",
"Slack off or joke around (very risky)."
]
choice = prompt(options)
if choice == 1:
gain = random.randint(4, 7)
recruit.change(marksmanship=+gain, discipline=+2, fatigue=+3)
recruit.record(f"Solid range performance (+{gain} marksmanship).")
p(f"You focus and improve your fundamentals. (+{gain} marksmanship)")
elif choice == 2:
gain = random.randint(1, 3)
recruit.change(marksmanship=+gain, fatigue=+2)
recruit.record(f"Quick range session (+{gain} marksmanship).")
p("You get some improvement but could have done better paying more attention.")
else:
recruit.change(discipline=-5, morale=-3)
recruit.warnings += 1
recruit.record("Safety violation at the range; heavy reprimand.")
p("A lapse draws serious rebuke. Range safety is sacred—expect consequences.")
return
def obstacle_scene(recruit):
p("\nObstacle/Confidence course: teamwork, grit, and trust. You're tested physically and mentally.")
options = [
"Lead a team effort—help weaker recruits and keep up a strong pace.",
"Focus on your lane; aim to finish quickly.",
"Conserve energy, let others lead."
]
choice = prompt(options)
if choice == 1:
recruit.change(fitness=+3, discipline=+2, morale=+3, fatigue=+8)
recruit.record("Led team on the confidence course; teamwork improved.")
p("You encourage and help others. The squad synergy improves; morale rises.")
elif choice == 2:
recruit.change(fitness=+2, fatigue=+6)
recruit.record("Solid solo performance on the obstacle course.")
p("You move well and finish respectably; the DI notes your athleticism.")
if random.random() < 0.06:
recruit.change(injury=2, morale=-4)
recruit.record("Took a fall on the obstacle and hurt yourself.")
p("A slip leaves you bruised and shaken; medics evaluate you.")
else:
recruit.change(discipline=-2, morale=-2, fatigue=+4)
recruit.warnings += 1
recruit.record("Passive on the obstacle course; received a warning.")
p("Your lack of effort affects the squad. The DI is not pleased.")
return
def martial_arts_block(recruit):
p("\nMarine Corps Martial Arts Program (MCMAP) fundamentals: discipline and controlled training with partners.")
options = [
"Train carefully and absorb the ethos behind the techniques.",
"Go fast and aggressive to prove yourself.",
"Hold back and avoid contact."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, morale=+1, fatigue=+3)
recruit.record("Respectful training in martial arts; absorbed ethos.")
p("You train controlled and focused. The instructor praises your discipline.")
elif choice == 2:
recruit.change(discipline=-1, fatigue=+5, morale=+1)
recruit.record("Aggressive training; risked going too hard.")
p("Your aggression shows intensity but draws a correction from the instructor about control.")
if random.random() < 0.05:
recruit.change(injury=1, morale=-3)
recruit.record("Sustained minor injury during aggressive sparring.")
p("A rough exchange leaves you with a bruise and a sore shoulder.")
else:
recruit.change(discipline=-2, morale=-2)
recruit.warnings += 1
recruit.record("Avoided contact in MCMAP; reprimanded.")
p("Avoiding contact is read as cowardice by some; the instructors call you out.")
return
def random_event(recruit):
# Random events that add flavor
r = random.random()
if r < 0.08:
p("\nRandom DI inspection: you're singled out for an immediate task.")
recruit.change(discipline=-2, fatigue=+6, morale=-1)
recruit.warnings += 1
recruit.record("Surprise inspection resulted in corrective action.")
p("The DI gives you corrective PT for a small issue. It's humiliating but common.")
elif r < 0.14:
p("\nYou receive encouraging words from a senior recruit.")
recruit.change(morale=+3)
recruit.record("Inspired by a senior recruit's encouragement.")
p("A seasoned recruit gives you pointers and encouragement— morale lifts a bit.")
elif r < 0.18:
p("\nA thunderstorm forces an indoor session—plans change.")
recruit.change(fatigue=-2)
recruit.record("Indoor session due to weather; some recovery time.")
p("The break in routine gives an unexpected moment for planning and rest.")
# else no event
def disciplinary_action(recruit):
p("\nDisciplinary review: you stand before the DI for repeated warnings.")
if recruit.warnings >= 3:
recruit.change(discipline=-10, morale=-10, fatigue=+5)
recruit.record("Multiple warnings result in corrective training.")
p("Your warnings have stacked. The DI assigns extra PT and insists on accountability.")
# possible elimination if discipline too low
if recruit.discipline < 10 or recruit.morale < 5:
recruit.eliminated = True
recruit.record("Eliminated for failing to meet standards.")
p("After consideration, leadership determines you're not meeting the standards and you're eliminated.")
else:
recruit.record("Received an admonishment and corrective training.")
p("You get corrective training—emphasis on learning from this and improving.")
# reset a bit after disciplinary action
recruit.warnings = max(0, recruit.warnings - 2)
def med_check(recruit):
p("\nMedical check: medics evaluate any injuries or persistent problems.")
if recruit.injury >= 3:
p("Medical staff determine you need a recovery period. You're temporarily removed from the training line.")
recruit.record("Sent to medical for recovery — temporary hold.")
recruit.eliminated = True
elif recruit.injury > 0:
p("Medics tape up and give you guidance: ice, rest, stretch. You're back on limited duty.")
recruit.record("Received medical treatment and returned on limited duty.")
recruit.change(fatigue=-5, morale=-2)
else:
p("Everything looks fine medically.")
recruit.record("Cleared in medical check.")
def evening_scene(recruit):
p("\nEvening: roll call, lights-out approach.")
options = [
"Reflect on the day's lessons and do stretching, hygiene, and light reading.",
"Crash immediately to conserve rest.",
"Stay up and socialize quietly with a small group."
]
choice = prompt(options)
if choice == 1:
recruit.change(fatigue=-10, discipline=+1, morale=+1)
recruit.record("Night routine: stretching and personal maintenance.")
p("You take care of yourself and get restorative rest.")
elif choice == 2:
recruit.change(fatigue=-6, morale=-1)
recruit.record("Slept quickly but missed restorative routines.")
p("You sleep hard but missed chances for recovery that help tomorrow.")
else:
recruit.change(fatigue=-4, morale=+2, discipline=-1)
recruit.record("Social night; morale improved but discipline dipped.")
p("You bond with squadmates. It's good for morale, but lights-out wasn't ideal.")
return
def evaluation(recruit, total_days):
# Weekly or periodic evaluation
p("\nPeriodic evaluation: Recruiters and DI review progress.")
score = (recruit.fitness + recruit.discipline + recruit.marksmanship + recruit.morale) / 4
p(f"Evaluation score: {int(score)} (higher is better).")
if score > 70:
p("You're on a strong trajectory. Keep it up.")
recruit.record("Positive evaluation.")
elif score < 30:
p("You're at risk. You need dramatic improvement or you'll be recycled/eliminated.")
recruit.record("Negative evaluation; at risk.")
if random.random() < 0.4:
recruit.eliminated = True
recruit.record("Eliminated during evaluation due to insufficient progress.")
p("Leadership decides you are not meeting minimum standards; you are removed from training.")
else:
p("You're acceptable but there are areas to tighten up.")
recruit.record("Neutral evaluation; needs focused improvement.")
def crucible_event(recruit):
p("\nThe Crucible: a multi-hour test of everything you've learned—teamwork, leadership, stamina, navigation, and discipline.")
p("This is the culminating challenge that forges Marines. It's grueling and designed to test limits.")
# team-focused choices
options = [
"Step up as a leader—coordinate and carry extra loads to help the squad.",
"Be a reliable team member—follow orders and support teammates.",
"Try to carry as little as possible and rely on others."
]
choice = prompt(options)
if choice == 1:
recruit.change(fitness=+5, discipline=+5, morale=+6, fatigue=+15)
recruit.record("Led during the Crucible; exemplary leadership.")
p("Your leadership pulls the team through. You feel transformed—this is a turning point.")
elif choice == 2:
recruit.change(fitness=+3, discipline=+3, morale=+4, fatigue=+12)
recruit.record("Solid performance in the Crucible; good team player.")
p("You are steady, supportive, and finish strong with your squad.")
else:
recruit.change(fitness=-2, discipline=-5, morale=-4, fatigue=+10)
recruit.record("Attempted to conserve energy during Crucible; poor team contribution.")
p("Your lack of contribution caused tension. The Crucible exposes weak links—expect evaluation.")
# final checks
if recruit.discipline < 20 or recruit.morale < 10 or recruit.injury >= 3:
recruit.eliminated = True
recruit.record("Failed the Crucible standards.")
p("Despite effort, leadership deems you didn't meet the standards in the Crucible.")
else:
recruit.completed = True
recruit.record("Successfully completed the Crucible and graduated the program.")
p("You complete the Crucible. The transformation is real—you graduate this bootcamp simulation as a Marine!")
return
# Main simulation loop
def main():
random.seed() # system time
p("Welcome to 'Marine Recruit Boot Camp'—compressed text simulation of recruit training.")
name = input("Enter your recruit name (call sign or first name): ").strip() or "Recruit"
recruit = Recruit(name)
total_days = 12 # compressed training schedule culminating in the Crucible
p(f"\n{recruit.name}, you'll experience a compressed {total_days}-day cycle of intense training.")
p("Make choices carefully—the DI watches everything. Your stats: fitness, discipline, morale, fatigue, marksmanship, injury.")
input("Press Enter to begin Day 1...")
while recruit.day <= total_days and not (recruit.eliminated or recruit.completed):
p("\n" + "="*60)
p(recruit.stats())
p("="*60)
p(f"\n--- Day {recruit.day} ---")
# Day sequence
reveille_scene(recruit)
pt_scene(recruit)
chow_scene(recruit)
inspection_scene(recruit)
# mid-day block rotates among training types
block_type = random.choice([
drill_scene, classroom_block, range_block,
obstacle_scene, martial_arts_block
])
block_type(recruit)
# Random mid-day event
random_event(recruit)
# Evening
evening_scene(recruit)
# Occasional med check every 4 days
if recruit.day % 4 == 0:
med_check(recruit)
# Periodic evaluation halfway and near end
if recruit.day in [4, 8]:
evaluation(recruit, total_days)
# Disciplinary check
if recruit.warnings >= 3:
disciplinary_action(recruit)
# Apply overnight recovery but also accumulate fatigue consequences
recruit.change(fatigue=-6)
# If fatigue gets too high, risk of performance drop or injury
if recruit.fatigue >= 80:
p("\nYou're running on fumes—fatigue is dangerously high.")
recruit.record("High fatigue led to impaired performance.")
# chance of injury or failing a task
if random.random() < 0.25:
recruit.change(injury=1, morale=-5)
p("Your exhaustion causes a misstep and you strain yourself.")
# Injury consequences over time
if recruit.injury > 0:
# ongoing morale hit
recruit.change(morale=-1)
if recruit.injury >= 2 and random.random() < 0.2:
p("Your injury flares and you need a medic's attention.")
med_check(recruit)
# Quick auto-fail rules
if recruit.discipline <= 0 or recruit.morale <= 0:
recruit.eliminated = True
recruit.record("Automatic elimination due to critical stats.")
p("Critical failures in discipline or morale result in removal from training.")
break
recruit.day += 1
# Culmination
if not recruit.eliminated and not recruit.completed:
# final: run the Crucible on the last day
p("\nThis is the final day—the Crucible awaits.")
crucible_event(recruit)
p("\n--- Training outcome ---")
if recruit.completed:
p(f"Congratulations {recruit.name}! You completed the boot camp simulation successfully.")
elif recruit.eliminated:
p(f"{recruit.name}, you were removed or recycled from training in this simulation.")
else:
p("Training ended without a definitive outcome in this simulation.")
p("\nSummary of key events:")
for entry in recruit.history[-10:]:
p(" - " + entry)
p("\nThank you for playing. This is a simplified, fictionally-compressed simulation inspired by recruit training. "
"Real training is longer, more structured, and far more demanding.")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nSimulation interrupted. Stay safe.")
sys.exit(0)
```
If you want:
- I can expand this into a longer, week-by-week simulation (more realism).
- Add save/load for multiple runs.
- Add squadmates with names and simple AI so team choices matter more.
- Make the DI’s personality configurable (strict vs. encouraging).
Which enhancements would you like next?
Notes:
- It intentionally avoids giving detailed instructions for weapons or harmful techniques. It aims to convey the tempo, pressure, choices, and consequences you’d experience as a recruit.
- You can extend or tweak events, texts, and stats as you like.
Code:
```python
#!/usr/bin/env python3
"""
Boot Camp Text Simulation (US Marine Corps - inspired)
Save as bootcamp.py and run with Python 3.
"""
import random
import time
import textwrap
import sys
# Utility for wrapped printing
def p(text="", width=76, delay=0.0):
for line in textwrap.wrap(text, width):
print(line)
if delay:
time.sleep(delay)
def prompt(options):
for i, opt in enumerate(options, 1):
print(f"{i}) {opt}")
while True:
choice = input("> ").strip()
if choice.isdigit() and 1 <= int(choice) <= len(options):
return int(choice)
else:
print("Enter the number of your choice.")
# Recruit class with stats
class Recruit:
def __init__(self, name):
self.name = name
self.fitness = 50 # 0-100
self.discipline = 50 # 0-100
self.morale = 50 # 0-100
self.marksmanship = 20 # 0-100
self.fatigue = 20 # 0-100 (higher = more tired)
self.injury = 0 # 0=none, >0 is severity
self.day = 1
self.warnings = 0
self.completed = False
self.eliminated = False
self.history = []
def stats(self):
return (f"Day {self.day} | Fitness: {self.fitness} | Discipline: {self.discipline} | "
f"Morale: {self.morale} | Fatigue: {self.fatigue} | Marksmanship: {self.marksmanship} | "
f"Injury: {self.injury}")
def change(self, fitness=0, discipline=0, morale=0, fatigue=0, marksmanship=0, injury=0):
self.fitness = max(0, min(100, self.fitness + fitness))
self.discipline = max(0, min(100, self.discipline + discipline))
self.morale = max(0, min(100, self.morale + morale))
self.fatigue = max(0, min(100, self.fatigue + fatigue))
self.marksmanship = max(0, min(100, self.marksmanship + marksmanship))
self.injury = max(0, self.injury + injury)
def record(self, entry):
self.history.append(f"Day {self.day}: {entry}")
# Scenes and events
def reveille_scene(recruit):
p("\nReveille cuts through the predawn dark. The barracks are a flurry of movement—mattresses folded, boots placed, racks made.")
p("A Drill Instructor moves up and down the bay inspecting the bay and making sure ranks are straight.")
p("You rouse and face the day.")
options = [
"Swing your legs out and hustle—be one of the first to form up.",
"Take a breath, double-check your kit, and step out with deliberate pace."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, fatigue=+5, morale=+1)
recruit.record("Hustled at reveille; DI noticed positive movement.")
p("Your urgency is noticed. The DI gives a curt nod; your squad looks sharp.")
else:
recruit.change(discipline=+1, fatigue=+3)
recruit.record("Steady start; focused on kit and uniform.")
p("You step out deliberately; your uniform is tidy. The DI's reaction is neutral but approving of care taken.")
return
def pt_scene(recruit):
p("\nPhysical Training (PT). The DI leads intense calisthenics and a run.")
options = [
"Attack PT at full effort—push yourself to improve fitness.",
"Moderate pace—do quality reps without burning out.",
"Hold back to preserve energy (risk disapproval)."
]
choice = prompt(options)
if choice == 1:
gain = random.randint(4, 8)
recruit.change(fitness=+gain, fatigue=+10, morale=+2)
recruit.record(f"Full-effort PT (+{gain} fitness).")
p(f"You push hard. You feel exhausted but stronger. (+{gain} fitness)")
# chance of small injury
if random.random() < 0.08:
recruit.change(injury=1, morale=-5)
recruit.record("Sustained a minor strain during PT.")
p("A sudden tweak in your hamstring — a minor strain. You grit through it.")
elif choice == 2:
gain = random.randint(2, 5)
recruit.change(fitness=+gain, fatigue=+7)
recruit.record(f"Moderate PT (+{gain} fitness).")
p(f"You focus on form and keep a solid pace. (+{gain} fitness)")
else:
recruit.change(fatigue=+4, discipline=-3, morale=-2)
recruit.warnings += 1
recruit.record("Held back during PT; got flagged by DI.")
p("Your hesitation draws the DI's ire. You take a warning.")
return
def chow_scene(recruit):
p("\nChow: Quick, fueling, the mess hall line moves efficiently.")
options = [
"Grab a balanced meal and hydrate.",
"Take a quick bite and race back to practice.",
"Skip proper eating to nap (risky)."
]
choice = prompt(options)
if choice == 1:
recruit.change(fatigue=-8, morale=+2)
recruit.record("Ate well: energy restored.")
p("You focus on fueling up properly. You feel steadier for the next block.")
elif choice == 2:
recruit.change(fatigue=-4)
recruit.record("Quick chow; less recovery time.")
p("You eat quickly and get back. You're less fueled but on time.")
else:
recruit.change(fatigue=-2, morale=-3, discipline=-2)
recruit.record("Skipped eating to nap; DI not pleased.")
p("Skipping proper nutrition had tradeoffs. DI notices lack of initiative.")
return
def inspection_scene(recruit):
p("\nInspection: the DI walks slowly past each recruit inspecting uniforms, boots, and rack order.")
# Provide detailed choices to be realistic about inspection measures
options = [
"Ensure boot laces are tucked, uniform squared away, and your rack immaculate.",
"Fix what you can quickly—prioritize uniform over rack.",
"Act rushed; hope DI is not nitpicky."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+3, morale=+1)
recruit.record("Passed inspection with high marks.")
p("Your attention to detail pays off. The DI acknowledges your professionalism.")
elif choice == 2:
# mixed result
if random.random() < 0.6:
recruit.change(discipline=+1)
recruit.record("Passed inspection with minor notes.")
p("You pass, though the DI calls out a small issue but moves on.")
else:
recruit.change(discipline=-2, morale=-1)
recruit.warnings += 1
recruit.record("Failed inspection on a minor issue; received a warning.")
p("The DI stops you for a problem and hands out a warning.")
else:
recruit.change(discipline=-4, morale=-2)
recruit.warnings += 1
recruit.record("Poor inspection; DI displeased.")
p("Your sloppiness results in the DI barking corrections and a formal warning.")
return
def drill_scene(recruit):
p("\nDrill and Ceremony block: close-order drill fundamentals—marching, facing, present arms.")
options = [
"Focus intensely and practice every movement.",
"Concentrate on staying in cadence; follow leaders.",
"Let the squad lead and avoid being noticed."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+3, fatigue=+4, morale=+1)
recruit.record("Excelled in drill training through focus.")
p("You drill with intensity. The DI praises your attention to detail.")
elif choice == 2:
recruit.change(discipline=+1, fatigue=+3)
recruit.record("Solid performance in drill.")
p("You keep cadence and do your part. Not flashy, but reliable.")
else:
recruit.change(discipline=-3, morale=-2)
recruit.record("Passive during drill; caught off-guard by corrections.")
recruit.warnings += 1
p("Your lack of initiative draws corrections. You receive raised voices and a warning.")
return
def classroom_block(recruit):
p("\nClassroom: Customs, courtesies, rank structure, Marine Corps values. This is knowledge you must internalize.")
options = [
"Pay full attention and take notes.",
"Half-listen but rely on instincts.",
"Zone out and chat with a buddy."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, morale=+1)
recruit.marksmanship += 0 # no change
recruit.record("Attentive in class; absorbed instruction.")
p("You internalize the instruction—this knowledge will help later.")
elif choice == 2:
recruit.change(discipline=-1)
recruit.record("Partly attentive; missed some details.")
p("You catch the main points but missed a few details.")
else:
recruit.change(discipline=-4, morale=-3)
recruit.warnings += 1
recruit.record("Disruptive in class; got reprimanded.")
p("Your chatter draws negative attention; the DI ends the lesson early with a scolding.")
return
def range_block(recruit):
p("\nRange: marksmanship fundamentals (safety, position, breathing). It's a focused, serious block.")
options = [
"Concentrate completely on fundamentals and safety.",
"Try to speed through—trust muscle memory.",
"Slack off or joke around (very risky)."
]
choice = prompt(options)
if choice == 1:
gain = random.randint(4, 7)
recruit.change(marksmanship=+gain, discipline=+2, fatigue=+3)
recruit.record(f"Solid range performance (+{gain} marksmanship).")
p(f"You focus and improve your fundamentals. (+{gain} marksmanship)")
elif choice == 2:
gain = random.randint(1, 3)
recruit.change(marksmanship=+gain, fatigue=+2)
recruit.record(f"Quick range session (+{gain} marksmanship).")
p("You get some improvement but could have done better paying more attention.")
else:
recruit.change(discipline=-5, morale=-3)
recruit.warnings += 1
recruit.record("Safety violation at the range; heavy reprimand.")
p("A lapse draws serious rebuke. Range safety is sacred—expect consequences.")
return
def obstacle_scene(recruit):
p("\nObstacle/Confidence course: teamwork, grit, and trust. You're tested physically and mentally.")
options = [
"Lead a team effort—help weaker recruits and keep up a strong pace.",
"Focus on your lane; aim to finish quickly.",
"Conserve energy, let others lead."
]
choice = prompt(options)
if choice == 1:
recruit.change(fitness=+3, discipline=+2, morale=+3, fatigue=+8)
recruit.record("Led team on the confidence course; teamwork improved.")
p("You encourage and help others. The squad synergy improves; morale rises.")
elif choice == 2:
recruit.change(fitness=+2, fatigue=+6)
recruit.record("Solid solo performance on the obstacle course.")
p("You move well and finish respectably; the DI notes your athleticism.")
if random.random() < 0.06:
recruit.change(injury=2, morale=-4)
recruit.record("Took a fall on the obstacle and hurt yourself.")
p("A slip leaves you bruised and shaken; medics evaluate you.")
else:
recruit.change(discipline=-2, morale=-2, fatigue=+4)
recruit.warnings += 1
recruit.record("Passive on the obstacle course; received a warning.")
p("Your lack of effort affects the squad. The DI is not pleased.")
return
def martial_arts_block(recruit):
p("\nMarine Corps Martial Arts Program (MCMAP) fundamentals: discipline and controlled training with partners.")
options = [
"Train carefully and absorb the ethos behind the techniques.",
"Go fast and aggressive to prove yourself.",
"Hold back and avoid contact."
]
choice = prompt(options)
if choice == 1:
recruit.change(discipline=+2, morale=+1, fatigue=+3)
recruit.record("Respectful training in martial arts; absorbed ethos.")
p("You train controlled and focused. The instructor praises your discipline.")
elif choice == 2:
recruit.change(discipline=-1, fatigue=+5, morale=+1)
recruit.record("Aggressive training; risked going too hard.")
p("Your aggression shows intensity but draws a correction from the instructor about control.")
if random.random() < 0.05:
recruit.change(injury=1, morale=-3)
recruit.record("Sustained minor injury during aggressive sparring.")
p("A rough exchange leaves you with a bruise and a sore shoulder.")
else:
recruit.change(discipline=-2, morale=-2)
recruit.warnings += 1
recruit.record("Avoided contact in MCMAP; reprimanded.")
p("Avoiding contact is read as cowardice by some; the instructors call you out.")
return
def random_event(recruit):
# Random events that add flavor
r = random.random()
if r < 0.08:
p("\nRandom DI inspection: you're singled out for an immediate task.")
recruit.change(discipline=-2, fatigue=+6, morale=-1)
recruit.warnings += 1
recruit.record("Surprise inspection resulted in corrective action.")
p("The DI gives you corrective PT for a small issue. It's humiliating but common.")
elif r < 0.14:
p("\nYou receive encouraging words from a senior recruit.")
recruit.change(morale=+3)
recruit.record("Inspired by a senior recruit's encouragement.")
p("A seasoned recruit gives you pointers and encouragement— morale lifts a bit.")
elif r < 0.18:
p("\nA thunderstorm forces an indoor session—plans change.")
recruit.change(fatigue=-2)
recruit.record("Indoor session due to weather; some recovery time.")
p("The break in routine gives an unexpected moment for planning and rest.")
# else no event
def disciplinary_action(recruit):
p("\nDisciplinary review: you stand before the DI for repeated warnings.")
if recruit.warnings >= 3:
recruit.change(discipline=-10, morale=-10, fatigue=+5)
recruit.record("Multiple warnings result in corrective training.")
p("Your warnings have stacked. The DI assigns extra PT and insists on accountability.")
# possible elimination if discipline too low
if recruit.discipline < 10 or recruit.morale < 5:
recruit.eliminated = True
recruit.record("Eliminated for failing to meet standards.")
p("After consideration, leadership determines you're not meeting the standards and you're eliminated.")
else:
recruit.record("Received an admonishment and corrective training.")
p("You get corrective training—emphasis on learning from this and improving.")
# reset a bit after disciplinary action
recruit.warnings = max(0, recruit.warnings - 2)
def med_check(recruit):
p("\nMedical check: medics evaluate any injuries or persistent problems.")
if recruit.injury >= 3:
p("Medical staff determine you need a recovery period. You're temporarily removed from the training line.")
recruit.record("Sent to medical for recovery — temporary hold.")
recruit.eliminated = True
elif recruit.injury > 0:
p("Medics tape up and give you guidance: ice, rest, stretch. You're back on limited duty.")
recruit.record("Received medical treatment and returned on limited duty.")
recruit.change(fatigue=-5, morale=-2)
else:
p("Everything looks fine medically.")
recruit.record("Cleared in medical check.")
def evening_scene(recruit):
p("\nEvening: roll call, lights-out approach.")
options = [
"Reflect on the day's lessons and do stretching, hygiene, and light reading.",
"Crash immediately to conserve rest.",
"Stay up and socialize quietly with a small group."
]
choice = prompt(options)
if choice == 1:
recruit.change(fatigue=-10, discipline=+1, morale=+1)
recruit.record("Night routine: stretching and personal maintenance.")
p("You take care of yourself and get restorative rest.")
elif choice == 2:
recruit.change(fatigue=-6, morale=-1)
recruit.record("Slept quickly but missed restorative routines.")
p("You sleep hard but missed chances for recovery that help tomorrow.")
else:
recruit.change(fatigue=-4, morale=+2, discipline=-1)
recruit.record("Social night; morale improved but discipline dipped.")
p("You bond with squadmates. It's good for morale, but lights-out wasn't ideal.")
return
def evaluation(recruit, total_days):
# Weekly or periodic evaluation
p("\nPeriodic evaluation: Recruiters and DI review progress.")
score = (recruit.fitness + recruit.discipline + recruit.marksmanship + recruit.morale) / 4
p(f"Evaluation score: {int(score)} (higher is better).")
if score > 70:
p("You're on a strong trajectory. Keep it up.")
recruit.record("Positive evaluation.")
elif score < 30:
p("You're at risk. You need dramatic improvement or you'll be recycled/eliminated.")
recruit.record("Negative evaluation; at risk.")
if random.random() < 0.4:
recruit.eliminated = True
recruit.record("Eliminated during evaluation due to insufficient progress.")
p("Leadership decides you are not meeting minimum standards; you are removed from training.")
else:
p("You're acceptable but there are areas to tighten up.")
recruit.record("Neutral evaluation; needs focused improvement.")
def crucible_event(recruit):
p("\nThe Crucible: a multi-hour test of everything you've learned—teamwork, leadership, stamina, navigation, and discipline.")
p("This is the culminating challenge that forges Marines. It's grueling and designed to test limits.")
# team-focused choices
options = [
"Step up as a leader—coordinate and carry extra loads to help the squad.",
"Be a reliable team member—follow orders and support teammates.",
"Try to carry as little as possible and rely on others."
]
choice = prompt(options)
if choice == 1:
recruit.change(fitness=+5, discipline=+5, morale=+6, fatigue=+15)
recruit.record("Led during the Crucible; exemplary leadership.")
p("Your leadership pulls the team through. You feel transformed—this is a turning point.")
elif choice == 2:
recruit.change(fitness=+3, discipline=+3, morale=+4, fatigue=+12)
recruit.record("Solid performance in the Crucible; good team player.")
p("You are steady, supportive, and finish strong with your squad.")
else:
recruit.change(fitness=-2, discipline=-5, morale=-4, fatigue=+10)
recruit.record("Attempted to conserve energy during Crucible; poor team contribution.")
p("Your lack of contribution caused tension. The Crucible exposes weak links—expect evaluation.")
# final checks
if recruit.discipline < 20 or recruit.morale < 10 or recruit.injury >= 3:
recruit.eliminated = True
recruit.record("Failed the Crucible standards.")
p("Despite effort, leadership deems you didn't meet the standards in the Crucible.")
else:
recruit.completed = True
recruit.record("Successfully completed the Crucible and graduated the program.")
p("You complete the Crucible. The transformation is real—you graduate this bootcamp simulation as a Marine!")
return
# Main simulation loop
def main():
random.seed() # system time
p("Welcome to 'Marine Recruit Boot Camp'—compressed text simulation of recruit training.")
name = input("Enter your recruit name (call sign or first name): ").strip() or "Recruit"
recruit = Recruit(name)
total_days = 12 # compressed training schedule culminating in the Crucible
p(f"\n{recruit.name}, you'll experience a compressed {total_days}-day cycle of intense training.")
p("Make choices carefully—the DI watches everything. Your stats: fitness, discipline, morale, fatigue, marksmanship, injury.")
input("Press Enter to begin Day 1...")
while recruit.day <= total_days and not (recruit.eliminated or recruit.completed):
p("\n" + "="*60)
p(recruit.stats())
p("="*60)
p(f"\n--- Day {recruit.day} ---")
# Day sequence
reveille_scene(recruit)
pt_scene(recruit)
chow_scene(recruit)
inspection_scene(recruit)
# mid-day block rotates among training types
block_type = random.choice([
drill_scene, classroom_block, range_block,
obstacle_scene, martial_arts_block
])
block_type(recruit)
# Random mid-day event
random_event(recruit)
# Evening
evening_scene(recruit)
# Occasional med check every 4 days
if recruit.day % 4 == 0:
med_check(recruit)
# Periodic evaluation halfway and near end
if recruit.day in [4, 8]:
evaluation(recruit, total_days)
# Disciplinary check
if recruit.warnings >= 3:
disciplinary_action(recruit)
# Apply overnight recovery but also accumulate fatigue consequences
recruit.change(fatigue=-6)
# If fatigue gets too high, risk of performance drop or injury
if recruit.fatigue >= 80:
p("\nYou're running on fumes—fatigue is dangerously high.")
recruit.record("High fatigue led to impaired performance.")
# chance of injury or failing a task
if random.random() < 0.25:
recruit.change(injury=1, morale=-5)
p("Your exhaustion causes a misstep and you strain yourself.")
# Injury consequences over time
if recruit.injury > 0:
# ongoing morale hit
recruit.change(morale=-1)
if recruit.injury >= 2 and random.random() < 0.2:
p("Your injury flares and you need a medic's attention.")
med_check(recruit)
# Quick auto-fail rules
if recruit.discipline <= 0 or recruit.morale <= 0:
recruit.eliminated = True
recruit.record("Automatic elimination due to critical stats.")
p("Critical failures in discipline or morale result in removal from training.")
break
recruit.day += 1
# Culmination
if not recruit.eliminated and not recruit.completed:
# final: run the Crucible on the last day
p("\nThis is the final day—the Crucible awaits.")
crucible_event(recruit)
p("\n--- Training outcome ---")
if recruit.completed:
p(f"Congratulations {recruit.name}! You completed the boot camp simulation successfully.")
elif recruit.eliminated:
p(f"{recruit.name}, you were removed or recycled from training in this simulation.")
else:
p("Training ended without a definitive outcome in this simulation.")
p("\nSummary of key events:")
for entry in recruit.history[-10:]:
p(" - " + entry)
p("\nThank you for playing. This is a simplified, fictionally-compressed simulation inspired by recruit training. "
"Real training is longer, more structured, and far more demanding.")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nSimulation interrupted. Stay safe.")
sys.exit(0)
```
If you want:
- I can expand this into a longer, week-by-week simulation (more realism).
- Add save/load for multiple runs.
- Add squadmates with names and simple AI so team choices matter more.
- Make the DI’s personality configurable (strict vs. encouraging).
Which enhancements would you like next?
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.