use Scala to complete a chess game in exercises of book "Agile Java"