Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
49
Task/Hailstone-sequence/LOLCODE/hailstone-sequence.lol
Normal file
49
Task/Hailstone-sequence/LOLCODE/hailstone-sequence.lol
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
HAI 1.3
|
||||
|
||||
HOW IZ I hailin YR stone
|
||||
I HAS A sequence ITZ A BUKKIT
|
||||
sequence HAS A length ITZ 1
|
||||
sequence HAS A SRS 0 ITZ stone
|
||||
|
||||
IM IN YR stoner
|
||||
BOTH SAEM stone AN 1, O RLY?
|
||||
YA RLY, FOUND YR sequence
|
||||
OIC
|
||||
|
||||
MOD OF stone AN 2, O RLY?
|
||||
YA RLY, stone R SUM OF PRODUKT OF stone AN 3 AN 1
|
||||
NO WAI, stone R QUOSHUNT OF stone AN 2
|
||||
OIC
|
||||
|
||||
sequence HAS A SRS sequence'Z length ITZ stone
|
||||
sequence'Z length R SUM OF sequence'Z length AN 1
|
||||
IM OUTTA YR stoner
|
||||
IF U SAY SO
|
||||
|
||||
I HAS A hail27 ITZ I IZ hailin YR 27 MKAY
|
||||
VISIBLE "hail(27) = "!
|
||||
|
||||
IM IN YR first4 UPPIN YR i TIL BOTH SAEM i AN 4
|
||||
VISIBLE hail27'Z SRS i " "!
|
||||
IM OUTTA YR first4
|
||||
VISIBLE "..."!
|
||||
|
||||
IM IN YR last4 UPPIN YR i TIL BOTH SAEM i AN 4
|
||||
VISIBLE " " hail27'Z SRS SUM OF 108 AN i!
|
||||
IM OUTTA YR last4
|
||||
VISIBLE ", length = " hail27'Z length
|
||||
|
||||
I HAS A max, I HAS A len ITZ 0
|
||||
|
||||
BTW, DIS IZ RLY NOT FAST SO WE ONLY CHEK N IN [75000, 80000)
|
||||
IM IN YR maxer UPPIN YR n TIL BOTH SAEM n AN 5000
|
||||
I HAS A n ITZ SUM OF n AN 75000
|
||||
I HAS A seq ITZ I IZ hailin YR n MKAY
|
||||
BOTH SAEM len AN SMALLR OF len AN seq'Z length, O RLY?
|
||||
YA RLY, max R n, len R seq'Z length
|
||||
OIC
|
||||
IM OUTTA YR maxer
|
||||
|
||||
VISIBLE "len(hail(" max ")) = " len
|
||||
|
||||
KTHXBYE
|
||||
Loading…
Add table
Add a link
Reference in a new issue