Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Password-generator/F-Sharp/password-generator-1.fs
Normal file
10
Task/Password-generator/F-Sharp/password-generator-1.fs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// A function to generate passwords of a given length. Nigel Galloway: May 2nd., 2018
|
||||
let N = (set)"qwertyuiopasdfghjklzxcvbnm"
|
||||
let I = (set)"QWERTYUIOPASDFGHJKLZXCVBNM"
|
||||
let G = (set)"7894561230"
|
||||
let E = (set)"""!"#$%&'()*+,-./:;<=>?@[]^_{|}~[||]"""
|
||||
let L = Array.ofSeq (Set.unionMany [N;I;G;E])
|
||||
let y = System.Random 23
|
||||
let pWords n=
|
||||
let fN n = not (Set.isEmpty (Set.intersect N n )||Set.isEmpty (Set.intersect I n )||Set.isEmpty (Set.intersect G n )||Set.isEmpty (Set.intersect E n ))
|
||||
Seq.initInfinite(fun _->(set)(List.init n (fun _->L.[y.Next()%(Array.length L)])))|>Seq.filter fN|>Seq.map(Set.toArray >> System.String)
|
||||
1
Task/Password-generator/F-Sharp/password-generator-2.fs
Normal file
1
Task/Password-generator/F-Sharp/password-generator-2.fs
Normal file
|
|
@ -0,0 +1 @@
|
|||
pWords 8 |> Seq.take 5 |> Seq.iter(printfn "%s")
|
||||
Loading…
Add table
Add a link
Reference in a new issue