-
Notifications
You must be signed in to change notification settings - Fork 0
/
problem0004.lol
38 lines (36 loc) · 1.27 KB
/
problem0004.lol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
BTW Project Euler problem 4
BTW Find the largest palindromic 6-digit number
BTW This exploits the fact that a palindrome of the form ABCCBA
BTW is equal to A * 100000 + B * 10000 + C * 1000 + C * 100 + B * 10 + A
BTW which is A * 100001 + B * 10010 + C * 1100
BTW which is 11(A * 9091 + B * 910 + C * 100)
HAI 1.2
I HAS A a ITZ 9
I HAS A Dun ITZ FAIL
IM IN YR Outer UPPIN YR x WILE BOTH OF DIFFRINT a AN 0 AN NOT Dun
I HAS A b ITZ 9
IM IN YR Second UPPIN YR x WILE BOTH OF DIFFRINT b AN -1 AN NOT Dun
I HAS A c ITZ 9
IM IN YR Third UPPIN YR x WILE BOTH OF DIFFRINT c AN -1 AN NOT Dun
I HAS A m ITZ 90
IM IN YR Inner UPPIN YR x WILE BOTH OF DIFFRINT m AN 9 AN NOT Dun
I HAS A p ITZ PRODUKT OF 9091 AN a
p R SUM OF p AN PRODUKT OF 910 AN b
p R SUM OF p AN PRODUKT OF 100 AN c
I HAS A q ITZ QUOSHUNT OF p AN m
I HAS A r ITZ MOD OF p AN m
BOTH OF BOTH SAEM r AN 0 AN BOTH SAEM q AN SMALLR OF q AN 999
O RLY?
YA RLY
VISIBLE PRODUKT OF p AN 11
Dun R WIN
OIC
m R DIFFRENCE OF m AN 1
IM OUTTA YR Inner
c R DIFFERENCE OF c AN 1
IM OUTTA YR Third
b R DIFFERENCE OF b AN 1
IM OUTTA YR Second
a R DIFFERENCE OF a AN 1
IM OUTTA YR Outer
KTHXBYE