Skip to content

Instantly share code, notes, and snippets.

@pbellon
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbellon/e58889c5720526258441 to your computer and use it in GitHub Desktop.
Save pbellon/e58889c5720526258441 to your computer and use it in GitHub Desktop.
KATA9 - Such password generator

How to run it

1. Install Dogescript (wow)

npm install dogescript

2. Compile script (such compile)

dogescript script.djs script.js

3. Run (much passwordz)

node script.js "You password sentence"

shh Such password generator
such such_count much str
very obj is {}
very result is ''
much very i as 0 next i smaller str.length next i more 1
obj[str[i]] is (obj[str[i]] || 0) + 1
wow
much very i in obj
very val is obj[i]
result += i
result += val
wow
wow result
such barkstring much str
very processed is plz str.toLowerCase
processed is plz processed.replace with /\W/g, ''
processed is plz processed.split with ''
processed is plz processed.sort
processed is plz processed.join with ''
wow processed
such passwow much sentence
very pass is plz barkstring with sentence
pass is plz such_count with pass
wow pass
very pass is plz passwow with process.argv[2]
plz console.log with 'Such pass: ', pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment