MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / validate_code

Method validate_code

codeclash/arenas/corewar/corewar.py:97–107  ·  view source on GitHub ↗
(self, agent: Player)

Source from the content-addressed store, hash-verified

95 # Sum across every "…scores…" + "Results:" block (the record shift writes two).
96 pending: list[int] = []
97 saw_results = False
98 for line in lines:
99 m = score_pat.search(line)
100 if m:
101 pending.append(int(m.group(1)))
102 elif line.strip().startswith("Results:"):
103 saw_results = True
104 for i, v in enumerate(pending[-len(shift) :]): # the N score lines of this block
105 scores[shift[i].name] += v
106 for i, w in enumerate(line.strip()[len("Results:") :].split()[:-1]): # omit ties
107 if i < len(shift):
108 wins[shift[i].name] += int(w)
109 pending = []
110 if not saw_results:

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected