## Story

> "You have serious coding skillz? You wannabe a [scener](https://en.wikipedia.org/wiki/Demoscene)? Complete this mission and u can get in teh crew!"

You have read a similar message on your favourite [diskmag](https://en.wikipedia.org/wiki/Disk_magazine) back in the early 90s, and got really excited. You contacted the demo crew immediately and they gave you the following job: write a vertical sinus scroller... **for the printer!**

## Your task

Write a function that takes three parameters: `text`, `amp` (for [peak amplitude](https://en.wikipedia.org/wiki/Amplitude)) and `period` (or [wavelength](https://en.wikipedia.org/wiki/Wavelength)). Return a string (split into multiple lines) that will display the text as a vertical sine wave.

Note: `amp` and `period` are measured in characters and are always positive integers; `text` is never empty.

## Example

```python
>>> scroller('Hello World!', 3, 10)
'   H\n     e\n      l\n      l\n     o\n    \n W\no\nr\n l\n   d\n     !'
```

Doesn't make much sense? Well, let's print it!

```python
   H        1
     e      2
      l     3
      l     4
     o      5
            6
 W          7
o           8
r           9
 l         10
   d        1
     !      2

3210123
```

(Obviously, the numbers are only shown above to demonstrate `amp` and `period`)

Happy coding!

*Note:* due to the inevitable use of floats, solutions with slight rounding errors (1 space difference in less than 10% of the output lines) will be accepted.

---

## My other katas

If you enjoyed this kata then please try [my other katas](https://www.codewars.com/collections/katas-created-by-anter69)! :-)

#### *Translations are welcome!*

Difficulty: introductory

Starter code:

def scroller(text, amp, period):
	

Solutions:
from math import pi, sin

def scroller(text, amp, period):
    return '\n'.join(' ' * (amp + int(round(sin(i * 2 * pi / period) * amp))) + c for i, c in enumerate(text))


import math
def scroller(text, amp, period):
    l = lambda i, c: ' '*(amp+i) + c + "\n"
    return (''.join([l(round(amp * math.sin(2*math.pi*(i/period))), text[i]) for i in range(len(text))]))[:-1]

from math import sin, pi

def scroller(text, amp, period):
    step = 2 * pi / period
    output = []
    
    for i, char in enumerate(text):
        line = ' ' * (int(round(amp * sin(step * i) + amp))) + char
        output.append(line)
    
    return '\n'.join(output)

from math import*;scroller=lambda t,a,p:"\n".join(" "*round(a+a*sin(i/p*tau))+c for i,c in enumerate(t))

from math import*;scroller=lambda s,a,l:'\n'.join('{:>{:.0f}}'.format(c,1+a*(1+sin(n*2*pi/l)))for n,c in enumerate(s))

def sinus(u):
  y = (abs(u) * 16 - 8) * u
  return (abs(y) * 0.224 + 0.776) * y

def scroller(t, a, p):
  return "\n".join(' ' * round((sinus(i % p / p - 1/2) + 1) * a) + c for i, c in enumerate(t))

import math
def scroller(text, amp, period):
    phi = 2*math.pi/period 
    ans = []
    for i, e in enumerate(text):
        x = math.sin(phi*i)+1 
        t = round(x*amp)
        temp = ' '*int(t) + e
        ans.append(temp)
    return '\n'.join(ans)

from math import sin, pi

def scroller(text, amp, period):
    ans = [f'{" " * round(amp + sin(2 * pi / period * i) * amp)}{ch}'
           for i, ch in enumerate(text)]
    return '\n'.join(ans)

from math import sin, pi


def scroller(text, amp, period):
    ret = []
    for m, i in enumerate(text):
        ret.append('{}{}'.format(' ' * round(amp + (amp * sin(m * pi * 2/ period))), i))
    return '\n'.join(ret)

from math import sin, pi


def sin_gen(text, amp, period):
    for n, i in enumerate(text):
        yield int(round(amp + amp * sin((2 * pi / period) * n)))


def scroller(text, amp, period):
    return "\n".join([" " * y + text[i] for i, y in enumerate(sin_gen(text, amp, period))])