Skip to content

Commit

Permalink
random-string: simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Apr 5, 2011
1 parent 2899dda commit e171c7e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions random-string/random-string.factor
Expand Up @@ -9,11 +9,8 @@ CONSTANT: valid-chars $[
CHAR: A CHAR: Z [a,b] CHAR: a CHAR: z [a,b] append
]

: random-char ( -- ch )
valid-chars random ;

: random-string ( n -- string )
[ random-char ] "" replicate-as ;
[ valid-chars random ] "" replicate-as ;

: run-random-string ( -- )
8 random-string print readln drop ;
Expand Down

0 comments on commit e171c7e

Please sign in to comment.