# Fake Marquee Text

In this challenge fake marquee text is text that is shown part by part, in a scrolling-like fashion.

Some examples:

testing 4

t
te
tes
test
esti
stin
ting
ing
ng
g

hello 2

h
he
el
ll
lo
o

foobarz 3

f
fo
foo
oob
oba
bar
arz
rz
z

Something a bit longer 10

S
So
Som
Some
Somet
Someth
Somethi
Somethin
Something
Something
omething a
mething a
ething a b
thing a bi
hing a bit
ing a bit
ng a bit l
g a bit lo
a bit lon
a bit long
bit longe
bit longer
it longer
t longer
longer
longer
onger
nger
ger
er
r

small 15

s
sm
sma
smal
small
small
small
small
small
small
small
small
small
small
small
mall
all
ll
l

aaa 3

a
aa
aaa
aa
a

brace yourself 6

b
br
bra
brac
brace
brace
race y
ace yo
ce you
e your
yours
yourse
oursel
urself
rself
self
elf
lf
f

You have to write a program or a function that takes in two input and prints the output as described above. You may or may not output trailing spaces in your output. This is code-golf so shortest code in bytes wins.

If your program is standalone (i.e. when run actually prints the lines) (Input can be hard-coded but easy to change) and sleeps a bit between each line of output you get a -10 bonus.

• What do you mean by "includes Output" ? May 13 '15 at 13:13
• Also, do we have to print the first and the last lines which are simply spaces ? May 13 '15 at 13:17
• Inspired by this? May 13 '15 at 14:18
• A single empty line at the beginning seems to be allowed. How about another empty line at the end?
– nimi
May 13 '15 at 17:57
• Since you're talking about "only visible output", can we assume that the input will only be printable ASCII? (character codes 0x20 to 0x7E) May 13 '15 at 23:24

# APL (Dyalog), 17 bytes

⌽⍉↑(⎕,⍨' '/⍨⊢)¨⍳⎕

Try it online!

(the program assumes ⎕IO←0 which is default on many machines)

### Explanation

⍳⎕               Create a range 0 .. input-1
¨                For each element in this range do:
' '/⍨⊢           A space duplicated right argument (which is the element in  the range) times
⎕,⍨              Concatenated with the input string to its right
⌽⍉               Transpose and reflect horizontally

# Python 3, 62 bytes

Definitely think it can be golfed further, particularly with the for loop notation.

Unfortunately I'm not that fluent with Python yet, maybe someone here can help.

def f(s,n):
s=n*" "+s
for i in range(len(s)):print(s[i:i+n])

Try it online!

I hope leading spaces are allowed.

• Welcome to site! Jun 23 '17 at 14:55

Try it online!

Try it online!