Skip to content

Instantly share code, notes, and snippets.

@audreyt
Forked from gugod/pw.ls
Created November 20, 2012 20:56
Show Gist options
  • Save audreyt/4121038 to your computer and use it in GitHub Desktop.
Save audreyt/4121038 to your computer and use it in GitHub Desktop.
#!/usr/bin/env lsc -d
require! fs
dictwords = lines fs.read-file-sync \/usr/share/dict/words \utf8
pick = -> it[ floor Math.random! * * ]
pwgen = -> [ pick dictwords for til 4 ].join ''
console.log pwgen!
@audreyt
Copy link
Author

audreyt commented Nov 20, 2012

第四列的 [rand * *] 和 Perl 6 簡直如出一轍。

@vendethiel
Copy link

also pick = (.[floor Math.random! * *]) :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment