[Jprogramming] Shuffle and deal 4 bridge hands

Linda Alvord lindaalvord36 at outlook.com
Sun Oct 14 22:16:47 UTC 2018


I don't know what you mean?

Linda



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Björn Helgason <gosinn at gmail.com>
Date: 10/14/18 1:46 PM (GMT-05:00)
To: Programming forum <programming at jsoftware.com>
Subject: Re: [Jprogramming] Shuffle and deal 4 bridge hands

shuf is missing a ' at the end.

On 13 Oct 2018 23:47, "Linda Alvord" <lindaalvord36 at outlook.com> wrote:

>
> This should now work in most J environments.
>
> F=:52$'23456789TJQKA'
> S=:13#u: 9824 9829 9830 9827
> deck=:S,.F
> shuf=: 13 :'<"2|."2 y {~ /:~"1 (|.x)$?~*/|.x
>
> Save code above in a file and then run the script.
> Here's how it looks in android.
>
> 13 4 shuf deck
> ┌──┬──┬──┬──┐
> │♣A│♣J│♣K│♣9│
> │♣Q│♣6│♣T│♣3│
> │♦K│♣5│♣8│♦A│
> │♦T│♣4│♣7│♦J│
> │♦9│♣2│♦Q│♦8│
> │♦6│♦2│♦7│♥K│
> │♥A│♥Q│♦5│♥6│
> │♥T│♥J│♦4│♥3│
> │♥8│♥9│♦3│♠A│
> │♥7│♥4│♠Q│♠K│
> │♥5│♥2│♠T│♠9│
> │♠8│♠J│♠7│♠6│
> │♠5│♠2│♠3│♠4│
> └──┴──┴──┴──┘
>
> Linda
>
> Sent from my Verizon, Samsung Galaxy smartphone
> ----------------------------------------------------------------------
> For information about J forums see https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffd.xuwubk.eu.org%3A443%2Fhttp%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7C35ade353a4514b1a961408d631fcf381%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636751359811224265&sdata=Q5nc%2FIzl5x6i1tZ9ufoJKd01ovT9yU%2FYu%2F3asF5o934%3D&reserved=0
----------------------------------------------------------------------
For information about J forums see https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffd.xuwubk.eu.org%3A443%2Fhttp%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7C35ade353a4514b1a961408d631fcf381%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636751359811224265&sdata=Q5nc%2FIzl5x6i1tZ9ufoJKd01ovT9yU%2FYu%2F3asF5o934%3D&reserved=0


More information about the Programming mailing list