In short, a hash table is faster than any form of file access. It's also easier than using variables if you need to search for things and it's better than having a LOT of variables for no reason.

Basic hash table (deck of cards):
Code:
alias MakeDeck {
  hmake Deck 5
  var %Cards = 2,3,4,5,6,7,8,9,10,J,Q,K,A
  var %Suit = H,D,S,C
  var %cnt = 1
  while (%cnt <= 13) {
    var %cnt2 = 1
    while (%cnt2 <= 4) {
      hadd Deck $gettok(%Cards,%cnt,44) $+ $gettok(%Suit,%cnt2,44)
      inc %cnt2
    }
    inc %cnt
  }
}

alias DrawCard {
  var %random.card = $rand(1,$hget(Deck,0).item)
  var %card = $hget(Deck,%random.card).item
  hdel Deck %card
  echo -a You drew this card: %card -- Cards Remaining: $hget(Deck,0).item
}


The nested loops in the makedeck alias just make it easier to add all of the cards in a short amount of code. You could also just do 52 /hadd's or put all of the cards into a single variable and do a single loop through them. This was just faster for me to type out by having 2 loops. It isn't necessary for a hash table.