how to create chess game using javascript