3 ms·
How does that do the fiddly bit "contain each of the letters A, B, and C exactly once" ?
by jodrellblank 3y ago
How does that do the fiddly bit "contain each of the letters A, B, and C exactly once" ?
- nemo1618 3y agoShoot, I totally overlooked that part. Here's the proper version: :load wordlist wordlist.txt =hasABC { all (count _ x == 1) "abc" } words wordlist | filter -:(len == 10 and hasABC and .8 == "k") Notes: { } defines a lambda with parameters named x,y,z,a,b,c... _ is the same as in noulith -- it turns any expression into a lambda. Values can also be omitted from most expressions (e.g. len == 10) for the same effect. -: takes a lambda with n parameters and turns it into a lambda that takes 1 parameter and replicates it n times.
- jodrellblank 3y agoThat is neat!