def isLegalMove(x1:Int, y1:Int, x2:Int, y2:Int): Boolean = {code here}
def - this tells Scala that we are defining a method
parameters - these must have the pattern name:type
return value: this follows the parameters, and must be preceded by a colon. if there is no return value, then you follow the parameters with an equals sign
method body: comes after the return value, preceded by an equals sign
No comments:
Post a Comment