Sfoglia il codice sorgente

Create a hpal function which can compile

return function and palindrom function still to write.
DricomDragon 5 anni fa
parent
commit
3f12d02369
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      hpal.hs

+ 8 - 0
hpal.hs

@@ -0,0 +1,8 @@
+r _ = 1
+
+ispal n = True
+
+hpal n = 
+	if ispal n
+	then 0
+	else 1 + hpal (n + r n)