core game logic for hex