P101 war game in JS