cooley's alliance game in javascript