RosettaCodeData/Task/Look-and-say-sequence/EasyLang/look-and-say-sequence.easy
2023-12-16 21:33:55 -08:00

22 lines
316 B
Text

proc lookandsay . a$ .
s$ = ""
c = 1
p$ = substr a$ 1 1
for i = 2 to len a$
if p$ = substr a$ i 1
c += 1
else
s$ &= c & p$
p$ = substr a$ i 1
c = 1
.
.
s$ &= c & p$
swap a$ s$
.
b$ = 1
print b$
for k = 1 to 10
lookandsay b$
print b$
.