Files
kurt/examples/euler/4.kurt
2024-08-22 00:24:19 +03:00

33 lines
765 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;; test
;; (format nil "~a~%" 906609)
;; palindrom sayılar ters çevrildiğinde kendine eşit olan sayılardır.
;; iki basamaklı iki sayının çarpımından oluşan en büyük palindrom
;; 9009 = 91 x 99 dur.
;; üç basamaklı iki sayının çarpımından oluşan en büyük palindromu bulun.
kütüphane "std.kurt"
makro palindrome? (a -- bool)
0 döngü üst 0 > iken
10 * üst 10 % + ;;eş dump
değiş 10 / değiş
yap değiş düş
=
son
bel 0 store64
100 döngü eş 1000 < iken
100 döngü eş 1000 < iken
2eş * eş palindrome? ise
eş bel load64 > ise
eş bel değiş store64
yap
yap düş
1 +
yap düş
1 +
yap düş
bel load64 dump