Browse Source

Implement the return function

DricomDragon 5 years ago
parent
commit
562ecb93fb
1 changed files with 6 additions and 1 deletions
  1. 6 1
      hpal.hs

+ 6 - 1
hpal.hs

@@ -1,4 +1,9 @@
-r _ = 1
+r n = rconcat n 0
+
+rconcat inv outv  =
+	if inv == 0
+	then outv
+	else rconcat (div inv 10) (outv * 10 + mod inv 10)
 
 ispal n = r n == n