fork download
  1. # Ant Games (https://a...content-available-to-author-only...s.ai/) — Bridge Stress Test: Warren Truss Load Calculator
  2. # Standalone physics toy demo (not game source code).
  3. # Built by an AI-assisted indie game studio using Claude Code.
  4. # Free to play in the browser with no downloads or accounts required:
  5. # Play: https://a...content-available-to-author-only...s.ai/play/bridge-stress-test/
  6. # Guide: https://a...content-available-to-author-only...s.ai/guide/bridge-stress-test/
  7. # FAQ: https://a...content-available-to-author-only...s.ai/guide/bridge-stress-test/faq.html
  8. # Trailer: https://y...content-available-to-author-only...u.be/zS5S8DIAf80
  9. # Studio: https://a...content-available-to-author-only...s.ai/ | Contact: info@antgames.ai
  10.  
  11. import math
  12.  
  13. MATERIALS = {
  14. "Wood": {"max_kn": 180.0, "cost_per_m": 12},
  15. "Steel": {"max_kn": 520.0, "cost_per_m": 35},
  16. "Reinforced": {"max_kn": 840.0, "cost_per_m": 62},
  17. "Suspension": {"max_kn": 680.0, "cost_per_m": 48},
  18. }
  19.  
  20. def warren_truss_forces(span_m: float, bays: int, height_m: float, train_load_kn: float):
  21. """Simple static equilibrium estimate at mid-span for a symmetric Warren truss."""
  22. bay_len = span_m / bays
  23. diag_angle = math.atan2(height_m, bay_len / 2.0)
  24. reaction_kn = train_load_kn / 2.0
  25. max_moment_knm = (train_load_kn * span_m) / 4.0
  26. chord_force_kn = max_moment_knm / height_m
  27. diag_force_kn = reaction_kn / math.sin(diag_angle)
  28. return {
  29. "reaction_kn": round(reaction_kn, 1),
  30. "chord_force_kn": round(chord_force_kn, 1),
  31. "diag_force_kn": round(diag_force_kn, 1),
  32. "peak_member_kn": round(max(chord_force_kn, diag_force_kn), 1),
  33. }
  34.  
  35. if __name__ == "__main__":
  36. print("Ant Games — Bridge Stress Test (https://a...content-available-to-author-only...s.ai/play/bridge-stress-test/)")
  37. print("60 levels across 5 lines, 8 materials + counterweights, 8 trains, 7 hazards, 45 achievements")
  38. res = warren_truss_forces(span_m=24.0, bays=4, height_m=4.5, train_load_kn=360.0)
  39. print(f"Mid-span 360 kN train -> Reaction: {res['reaction_kn']} kN | Chord: {res['chord_force_kn']} kN | Diagonal: {res['diag_force_kn']} kN")
  40. for mat, spec in MATERIALS.items():
  41. ratio = (res["peak_member_kn"] / spec["max_kn"]) * 100.0
  42. status = "PASS" if ratio <= 100.0 else "FAIL"
  43. print(f" {mat:12s} | peak utilization: {ratio:5.1f}% | {status}")
  44. print("Studio disclosure: Built with Claude Code (AI-assisted studio) — https://a...content-available-to-author-only...s.ai/")
  45.  
Success #stdin #stdout 0.03s 5092KB
stdin
Standard input is empty
stdout
Ant Games — Bridge Stress Test (https://a...content-available-to-author-only...s.ai/play/bridge-stress-test/)
60 levels across 5 lines, 8 materials + counterweights, 8 trains, 7 hazards, 45 achievements
Mid-span 360 kN train -> Reaction: 180.0 kN | Chord: 480.0 kN | Diagonal: 216.3 kN
  Wood         | peak utilization: 266.7% | FAIL
  Steel        | peak utilization:  92.3% | PASS
  Reinforced   | peak utilization:  57.1% | PASS
  Suspension   | peak utilization:  70.6% | PASS
Studio disclosure: Built with Claude Code (AI-assisted studio) — https://a...content-available-to-author-only...s.ai/