disp ← { ⍵ ⊃¨ ((2↓⎕D),'TJQKA')('♣♢♡♠') } disp¨ ⍳13 4 2♣ 2♢ 2♡ 2♠ 3♣ 3♢ 3♡ 3♠ 4♣ 4♢ 4♡ 4♠ 5♣ 5♢ 5♡ 5♠ 6♣ 6♢ 6♡ 6♠ 7♣ 7♢ 7♡ 7♠ 8♣ 8♢ 8♡ 8♠ 9♣ 9♢ 9♡ 9♠ T♣ T♢ T♡ T♠ J♣ J♢ J♡ J♠ Q♣ Q♢ Q♡ Q♠ K♣ K♢ K♡ K♠ A♣ A♢ A♡ A♠
disp ← ⊃¨ ∘ ((2↓⎕D),'TJQKA')('♣♢♡♠')
Pick (⊃
) serves our purposes here, but later we'll need a function which selects major cells of the right argument using scalars from the left. Let's start using it now. I
for index!
I ← ⌷⍤0 99 disp ← I¨ ∘ ((2↓⎕D),'TJQKA')('♣♢♡♠') ⍤ 1
The specification of rank 1 both ensures and documents that the inner function will only be called on vectors or scalars.