I am trying to code a game of Bridge in APL the part I'm stuck on is when printing hands I want to return 4 separate hands to be scored of all random cards and I want to sort the cards by suit first and then within the suits sort by Ace to two I am able to accomplish each one of these sorts individually
HAND←DEAL;CHAR;DECK
DECK←MAKE_DECK
CHAR←DECK[;13?52]
⍝HAND←CHAR[;'SHDC23456789TJQKA'”³CHAR]
HAND←CHAR[;'CDHS'”³CHAR]
sorts by suit but not the numbers in the suit and I also dont know how to make it deal 4 hands instead of just one hand of 13 cards
example output:
Q982AQT93T934 AKJ657428J987 K865AKJ54KQT3 T743JQ762A652
SSSSHHHHHDDDC SSSSSHHHDCCCC HHHHDDDDDCCCC SSSSHDDDDCCCC