Skip to content

Commit

Permalink
fix bug in warrior count to end simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
bobertlo committed Dec 6, 2024
1 parent eec1f33 commit c5d3d03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/vmars/sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func (g *Game) runCycle() {

count := g.sim.WarriorCount()
living := g.sim.WarriorLivingCount()
if ((count > 1 && living > 1) || living > 0) && g.sim.CycleCount() < g.sim.MaxCycles() {
if ((count > 1 && living > 1) || (count < 2 && living > 0)) && g.sim.CycleCount() < g.sim.MaxCycles() {
g.sim.RunCycle()
} else {
g.finished = true
Expand Down

0 comments on commit c5d3d03

Please sign in to comment.