@name CardGen
@persist [CardTypes Cards]:array
@trigger all

if(first() || duped()){
    
    function table generateCard(){
        return table(CardTypes[randint(1,CardTypes:count()),string],Cards[randint(1,CardTypes:count()),string])
    }
    
}

if(first() || duped()){
    
    CardTypes = array(
    "Hearts",
    "Diamonds",
    "Clubs",
    "Spades"
    )
    
    Cards = array(
    "Ace",
    "Two",
    "Three",
    "Four",
    "Five",
    "Six",
    "Seven",
    "Eight",
    "Nine",
    "Ten",
    "Jack",
    "Queen",
    "King"
    )
    
    ## Example
    local TheCard = generateCard() # Generates a table, first index is the type, second index is the card
    print("Type : " + TheCard[1,string] + " | Card : " + TheCard[2,string] )
    
}
