Modifies board by replacing every card with f(card), without affecting other state of the game.
This operation must be able to interleave with other operations (e.g. look() should not
block while a map() is in progress), but the board must remain observably consistent for
players: if two cards on the board match each other before map() is called, then it must not
be possible for any player to observe a board state in which that pair of cards do not match.
f must be a pure function from cards to cards:
given some legal card c, f(c) should be a legal replacement card which is consistently
the same every time f(c) is called for that same c.
Returns
the state of the board after the replacement, in the format
described in the ps4 handout
Modifies board by replacing every card with f(card), without affecting other state of the game.
This operation must be able to interleave with other operations (e.g. look() should not block while a map() is in progress), but the board must remain observably consistent for players: if two cards on the board match each other before map() is called, then it must not be possible for any player to observe a board state in which that pair of cards do not match.
f must be a pure function from cards to cards: given some legal card
c
, f(c) should be a legal replacement card which is consistently the same every time f(c) is called for that samec
.Returns
the state of the board after the replacement, in the format described in the ps4 handout