Fall 2012, David Matuszek
I had said:
These turn out to be incompatible. For various reasons, the parameter lists and return types should not be the same as in Java, but I need to know what they are in order to write my unit tests. For that reason, I will require the following parameter lists and return types for each method. Please let me know ASAP if you find any further problems.
Note: The specifications below explicitly include the return types. This is to make it clear what should be returned. You can let Scala infer the return types.
Revised due date: 6am November 30.
object Bridge
def main(args: Array[String]) def run()
main. You may omit this method and move its functionality into main. def makePlayers(): Seq[Player] def makeCards(): Seq[Card] def playTrick(???): ???
playTrick method. Therefore, you can do anything you like with the parameters and return type. class Card(val value: Int, val suit: String)
def value: Int
def suit: Int
String
def isBiggerThan(thatCard: Card): Boolean override def toString: Stringclass Player(name: String)
override def toString: String def shuffle(cards: Seq[Card]) : Seq[Card] def deal(cards: Seq[Card], players: Seq[Player]): Unit def showHand
def hand: Seq[Card]
def addCardToHand(card: Card): Unit def takeCardFromHand(card: Card): Unit
def playAnyCard(): Card def tryToFollowSuit(suit: String): Card