Here’s a combinatorics quiz: If you have 2 ordered lists (lengths N, M), how many ways can they be interleaved into a single list while still preserving the partial ordering from the original lists? So if the lists were:List 1: A,BList 2: X,YThe following would be valid: A,B,X,Y A,X,Y,B X,Y,A,B A,X,B,Y But ‘ yxab’ would…

# Tag: dlr

## Battle Simulation: size vs. smarts (part 3)

How much stupidity does it take to prevail over intelligence? I previously explored simulating Real-time-strategy battles with IronPython. (Part 1, Part 2). We saw that even with very simple rules, different strategies are better than others. If two armies of equal size attack each other, a good strategy clobbers a bad one. In this entry,…

## Battle Simulations with Iron Python (part 2)

I previously wrote about modeling RTS battles with IronPython. In this entry I’ll explore a new policy for attacking that was suggested on the last thread. Previously, I compared 2 policies for picking which opponent to attack: 1. Attack the weakest enemy.2. Attack a random enemy. Each turn (eg, after each round of shooting each…

## RTS Battle simulation with IronPython

I used Python to simulate Age of Empires archer battles. I wanted to be able to answer questions like: If 12 archers attack 10 archers, what will the margin of victory be? If two armies of the same size attack each other, how do different strategies affect the outcome? This also led to some practical…