our version of war game in JS