Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create Safe Runtime Environment
- setup <- functon(deck){
- # Store a Prestine Copy
- DECK <- deck
- # Deal Card Function
- deal <- function(){
- card <- deck[1, ]
- assign("deck", deck[-1, ], envir = globalenv())
- card
- }
- # Shuffle Deck Function
- shuffle <- function(){
- random <- sample(1:52, size = 52)
- assign("deck", DECK[random, ], envir = globalenv())
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement