-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path004.vl
More file actions
18 lines (16 loc) · 769 Bytes
/
004.vl
File metadata and controls
18 lines (16 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ Project Euler problem #4 $
i999;}. $ two numbers to multiply together in a[0] and a[1] $
'ay}Y*}p}p $ store the product in a[2] and a[3] $
$ check for palindrome $
$ b array of digits $
$ c[0] = 10^n, c[1] = n $
$ d[0] reversed number $
$ e = temp $
$ f = current max $
'ci1;}i0;'dp
3`ay10/pv'ep1`cY'ey`bp3`ay0?j1`ca^ $ split product into digit array $
1`cY`bY'cy*V'dy+p1`cx0>j'cy10*p^ $ generate reversed number $
2`aY'dy-0!j'dY'fy-0<j'dy'fp $ set new max if bigger than previous $
'ay900<ji999;1`ay900?2jx13k $ decrement starting numbers $
'ax14k $ loop back to multiplcation $
'fyl $ output max $