Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # Create Safe Runtime Environment
  2. setup <- functon(deck){
  3.  
  4. # Store a Prestine Copy
  5. DECK <- deck
  6.  
  7. # Deal Card Function
  8. deal <- function(){
  9. card <- deck[1, ]
  10. assign("deck", deck[-1, ], envir = globalenv())
  11. card
  12. }
  13.  
  14. # Shuffle Deck Function
  15. shuffle <- function(){
  16. random <- sample(1:52, size = 52)
  17. assign("deck", DECK[random, ], envir = globalenv())
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement