misc: add more scripts

This commit is contained in:
2020-11-05 16:31:14 +01:00
parent afd306ad06
commit 6c1248e814
11 changed files with 2481 additions and 0 deletions

14
misc/Nolindrom.hs Normal file
View File

@@ -0,0 +1,14 @@
module Nolindrom where
nolindrom :: Int -> Integer -> Bool
nolindrom i n
| i >= 100 = True
| otherwise =
let r = read . reverse . show $ n
n' = r + n
in not (palindrome n') && nolindrom (succ i) n'
where
palindrome x =
let s = show x
in s == reverse s