Javascript-based 3 man chess engine