-
-
Save groundwater/3277303 to your computer and use it in GitHub Desktop.
Some Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Prize { | |
def * (int x) = { | |
val list = List() | |
for (i=0; i<x; i++){ | |
list.append( this ) | |
} | |
list | |
} | |
} | |
case class CoinPrize(multipler: Int) extends Prize | |
case class TicketPrize() extends Prize | |
case class NoPrize() extends Prize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment