Human: Why did the Roman Legion have a phalanx? Assistant: 
The phalanx was a formation of soldiers arranged in a line, with the front row of soldiers carrying a spear and the back row carrying a shield. The phalanx was used to break through enemy lines. The Romans used the phalanx to defeat the Carthaginians in the Punic Wars.