thru=: <. + i.@(+*)@-~ chr=: a.&i. lower=: 'a' thru&.chr 'z' upper=: 'A' thru&.chr 'Z' digit=: '0' thru&.chr '9' other=: ('!' thru&.chr '~')-.lower,upper,digit,'`\' all=: lower,upper,digit,other pwgen =:verb define"0 :: pwhelp NB. pick one of each, remainder from all, then shuffle (?~y) { (?@# { ])every lower;upper;digit;other;(y-4)#