Bill Allombert on Sun, 23 Jan 2022 08:43:09 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Addressable bits buffer, how?


On Sat, Jan 22, 2022 at 02:18:21PM +0100, Bill Allombert wrote:
> On Sat, Jan 22, 2022 at 01:37:53PM +0100, Ruud H.G. van Tol wrote:
> > 
> > https://rosettacode.org/wiki/Pangram_checker#PARI.2FGP
> 
> You should use Vecsmall(string)
> 
> pangram(s)=
> {
>   my([a,z]=Vecsmall("az"));
>   #vecsort([x|x<-Vecsmall(s),x>=a && x<=z],,8)==26
> }

Or more idiomatically:

pangram(s)=
{
  my([a,z]=Vecsmall("az"));
  #Set([x|x<-Vecsmall(s),x>=a && x<=z])==26
}

Cheers,
Bill.