31ph4n70m

Neumann's_Random_Generator.coffee

Dec 19th, 2019
663
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # coffeescript solution to codeabbey challenge 24
  2. inp2 = [3488, 373, 5368, 751, 8342, 3416, 843, 6173, 7019, 381, 1054, 6303]
  3. counter = 0
  4. rsp = []
  5. vals = []
  6. aux = 0
  7. aux2 = 0
  8. for i, j in inp2
  9.     aux = i
  10.     while true
  11.         aux2 = Math.trunc((aux * aux / 100) % 10000)
  12.         if aux in vals
  13.             rsp.push counter
  14.             break
  15.         vals.push aux
  16.         counter += 1
  17.         aux = aux2
  18.     counter = 0
  19.     vals = []
  20. console.log(rsp.join(" "))
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×