|
|
|
|
|
by moonchild
1955 days ago
|
|
That's not pattern matching, it's just switching on arbitrary values. You can do the same thing in d, which doesn't have pattern matching. Pattern matching is something like this: switch [playerA.move, playerB.move]
case [x, x]: Tied()
case [Rock, x]: Winner(if x == Scissors then playerA else playerB)
|
|