RosettaCodeData/Task/Password-generator/Quackery/password-generator.quackery
2024-07-13 15:19:22 -07:00

34 lines
1.2 KiB
Text

[ [] unrot
over - 1+ times [ i over + rot join swap ]
drop ] is range ( n n --> [ )
[ char a char z range ] constant is lowers ( --> $ )
[ char A char Z range ] constant is uppers ( --> $ )
[ char 0 char 9 range ] constant is digits ( --> $ )
[ $ \!"#$%&'()*+,-./:;<=>?@[]^_{|}~\ ] is others ( --> $ )
[ [] ' [ lowers uppers digits others ]
tuck witheach
[ do dup size random peek join ]
[] rot witheach [ do join ]
rot 4 - times
[ dup dup size random peek
rot join swap ]
drop shuffle ] is password ( n --> $ )
[ swap times
[ dup password echo$ cr ] drop ] is passwords ( n n --> )
[ say "'passwords' generates a specified" cr
say "number of passwords of a specified" cr
say "length. For example," cr
cr
say " 5 10 passwords" cr
cr
say "will generate five ten-character" cr
say "passwords." cr ] is help
say "Type 'help' for help with passwords."