Files
SirRoboGarage/ModularBot_garage/tests/test_gun_diversity_verbose.nim
SirStone 254c7dc997 feat(ModularBot): pluggable bot with 4 guns, phantom meteor movement, radar harness
- Gun harness: virtual bullet tracker, rolling fitness, auto-selector
- Guns: head-on, linear (extrapolation), circular (integrated formula), tsetlin machine (learning)
- Movement: phantom meteor gravity engine (danger histograms, phantom bullets, fire detection)
- Radar: harness + radar_lock adapter
- Color-coded modules: turret/bullet color per gun, body per movement, scan per radar
- Beats Target, SpinBot, Crazy, TrackFire in 10-round battles
2026-09-20 00:37:10 +02:00

35 lines
1.4 KiB
Nim

import std/os
import std/strutils
import test_framework/test_framework
if not existsEnv("TR_SERVER_JAR") or not existsEnv("TR_BATTLE_RUNNER"):
echo "Skipping: TR_SERVER_JAR / TR_BATTLE_RUNNER not set"
quit(0)
let modularBotDir = "/home/davide/Projects/SirRoboGarage/ModularBot_garage"
let sampleBotsDir = "/home/davide/Downloads/robocode-tankroyale/sample-bots-nim-linux-1.0.7"
echo "\n" & "=".repeat(60)
echo "BATTLE 1: ModularBot vs SpinBot (Circular Movement)"
echo "=".repeat(60)
let r1 = runBattle(@[modularBotDir, sampleBotsDir / "SpinBot"], rounds = 10)
echo "\nFinal Scores:"
for bot in r1.results:
echo " " & bot.name & ": score=" & $bot.totalScore & " rank=" & $bot.rank & " firstPlaces=" & $bot.firstPlaces & " survived=" & $bot.survivalCount
echo "Winner: " & r1.winners[0]
echo "\n" & "=".repeat(60)
echo "BATTLE 2: ModularBot vs Crazy (Unpredictable Movement)"
echo "=".repeat(60)
let r2 = runBattle(@[modularBotDir, sampleBotsDir / "Crazy"], rounds = 10)
echo "\nFinal Scores:"
for bot in r2.results:
echo " " & bot.name & ": score=" & $bot.totalScore & " rank=" & $bot.rank & " firstPlaces=" & $bot.firstPlaces & " survived=" & $bot.survivalCount
echo "Winner: " & r2.winners[0]
echo "\n" & "=".repeat(60)
echo "SUMMARY"
echo "=".repeat(60)
echo "Battle 1 (vs SpinBot): " & (if "ModularBot" in r1.winners: "WON" else: "LOST")
echo "Battle 2 (vs Crazy): " & (if "ModularBot" in r2.winners: "WON" else: "LOST")