Advertisement
31ph4n70m

Funny_Words_Generator.coffee

Dec 16th, 2019
3,621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # coffeescript solution to codeabbey challenge 72
  2. INP1 = [22, 1838911]
  3. INP2 = [3, 5, 5, 4, 6, 8, 8, 5, 3, 5, 4, 7, 6, 4, 3, 5, 5, 7, 7, 5, 8, 6]
  4. CON = 'bcdfghjklmnprstvwxz'
  5. VOW = 'aeiou'
  6. A = 445
  7. C = 700001
  8. M = 2097152
  9. XN = INP1[1]
  10. LI = 0
  11. RSP = []
  12. for wl, j in INP2
  13.     WORD = ''
  14.     for i in [1..wl]
  15.         XN = (A*XN + C) % M
  16.         if i % 2 == 0
  17.             LI = XN % 5
  18.             WORD += VOW[LI]
  19.         else
  20.             LI = XN % 19
  21.             WORD += CON[LI]
  22.     RSP.push WORD
  23. console.log(RSP.join(" "))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement