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 – 10 years ago
Also, I suggest you specify the input structure and format. For example, what if I want my text to have spaces ? – Optimizer – 10 years ago
1Also, do we have to print the first and the last lines which are simply spaces ? – Optimizer – 10 years ago
What about trailing spaces on the last few lines ? – Optimizer – 10 years ago
@Optimizer Spaces can be treated exactly like the other symbols, may be inside or after the message. – Caridorc – 10 years ago
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 – 10 years ago@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 – 10 years ago
2
Inspired by this?
– Spikatrix – 10 years ago@CoolGuy yes, I forgot to mention that – Caridorc – 10 years ago
1A single empty line at the beginning seems to be allowed. How about another empty line at the end? – nimi – 10 years ago
@nimi only the visible output is important in this challenge – Caridorc – 10 years ago
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 – 10 years ago
@MartinBüttner input can be assumed to be in the character codes 0x20 to 0x7E – Caridorc – 10 years ago
Why don't we just start calling marquees
scrolly texts
again? It would make the world a better place. – Shaun Bebbers – 8 years agoOld 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 – 8 years ago@BradC I guess max
n
should be 79 the standard max line length – Caridorc – 8 years ago