This is JavaScript version for Doodles-game