尝试将洗牌牌的多笔成交的结果保存在表中。另外,有没有更好的方法来做多笔交易(如函数或循环(?
我试过列表:
# SETUP for a deck is done
cards <- setup(deck)
deal <- cards$deal
shuffle <- cards$shuffle
deal()
#deal works
# Creating a collection of decks
deckr <- function(){
a<- deal()
b<- deal()
c<- deal()
list(a,b,c)
}
deckr()
你可以做
deals <- list()
for (i in 1:3)
deals[[i]] <- deal()