> to_shuffle_cards <- function() {
+ rep_times = 1
+ cards <- matrix(nrow=4, sample(rep(1:52,times=rep_times), 52, replace=FALSE))
+ rownames(cards) <- c("player1","player2","player3","player4")
+ cards <- as.table(cards)
+ return(cards)
+ }
> x <- to_shuffle_cards()
> y <- to_shuffle_cards()
> x
A B C D E F G H I J K L M
player1 4 34 19 45 3 42 27 24 37 40 51 22 5
player2 35 16 17 38 1 30 13 47 33 26 15 44 52
player3 7 39 41 10 36 23 48 14 20 31 25 6 46
player4 12 49 8 21 18 43 2 50 28 9 32 29 11
> y
A B C D E F G H I J K L M
player1 31 17 15 37 5 18 43 3 51 13 9 38 19
player2 20 27 10 45 30 32 7 48 47 11 2 25 42
player3 41 34 29 50 8 4 28 35 23 44 1 12 52
player4 6 49 16 24 40 14 36 21 26 33 46 22 39
#
沒有留言:
張貼留言