46
5
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" ? – Optimizer – 2015-05-13T13:13:56.210
Also, I suggest you specify the input structure and format. For example, what if I want my text to have spaces ? – Optimizer – 2015-05-13T13:14:41.127
1Also, do we have to print the first and the last lines which are simply spaces ? – Optimizer – 2015-05-13T13:17:45.437
What about trailing spaces on the last few lines ? – Optimizer – 2015-05-13T13:18:00.523
@Optimizer Spaces can be treated exactly like the other symbols, may be inside or after the message. – Caridorc – 2015-05-13T13:20:34.163
My question was regarding trailing spaces on the lines where the complete string is printed. For example
aaa 3
, do we print a space after theaa
on the 3rd line or not ? – Optimizer – 2015-05-13T13:23:39.497@Optimizer only the visible output is important in this challenge, as spaces are invisible you may or may not print them on your choosing. – Caridorc – 2015-05-13T13:25:40.247
2
Inspired by this?
– Spikatrix – 2015-05-13T14:18:52.873@CoolGuy yes, I forgot to mention that – Caridorc – 2015-05-13T14:39:30.710
1A single empty line at the beginning seems to be allowed. How about another empty line at the end? – nimi – 2015-05-13T17:57:54.367
@nimi only the visible output is important in this challenge – Caridorc – 2015-05-13T20:03:49.597
2Since you're talking about "only visible output", can we assume that the input will only be printable ASCII? (character codes 0x20 to 0x7E) – Martin Ender – 2015-05-13T23:24:40.287
@MartinBüttner input can be assumed to be in the character codes 0x20 to 0x7E – Caridorc – 2015-05-14T11:31:10.590
Why don't we just start calling marquees
scrolly texts
again? It would make the world a better place. – Shaun Bebbers – 2017-06-23T09:52:39.760Old question, but this should probably specify maximums for the inputs: how large can
n
be? How long can the string be? My answer works for all given samples, but fails for extremely large inputs. – BradC – 2017-06-23T14:42:46.037@BradC I guess max
n
should be 79 the standard max line length – Caridorc – 2017-06-23T18:30:35.827