D
Size: a a a
D
А
M
/*
* APL Bridge Game
*
* (I wasn't sure what you did in MAKE_DECK, maybe there is some special
* stuff going on? Otherwise there is no reason to make a dedicated
* function for that. Also, as a non-native english-speaker, I'm not sure
* about the naming of cards etc. - pls. fix as appropriate...)
*/
DECK←(52⍴'AKQJ0987654'),[.5]13/'SHDC'
/*
* I am then dealing the cards and just create an array of indices into
* DECK;
*/
HANDS←4 13⍴52?52
/*
* These need to be sorted row-wise. (I'm doing it using "classic" style
* which will hopefully work in all APL-Dialects...):
*/
x←0
x←x+1 ⋄ HANDS[x;]←HANDS[x;⍋HANDS[x;]] ⋄ →(x<4)/⎕LC
/*
* (Pls. note that this line will only work within a function, not when
* you execute it directly in the interpreter - there is no ⎕LC he
* could → to...)
* So, what's the hand of player 1?
*/
DECK[;HANDS[1;]]
JAQJ08740Q4K7
SSHHHHHHDDCCC
/*
* Hope you can put together a nice function from that ;-)
*
* [MBaas] [so/q/35836727] [cc by-sa 3.0]
*/
D
АК
D
M
CPU Time: 0.00 s
Memory: 2656 KB
СМ
RB
СМ
AR
M
M
AR
СМ
AR
M
AR
M
IG