Convert printGameState() to gameStateToString()