0
這是我的代碼哈斯克爾錯誤解析錯誤(可能是不正確的縮進)
font a = let x= ord a in
if x>=0 || x<=31 || x>=126 then ["*****","*****","*****","*****","*****","*****","*****"]
else
auxfont (fontBitmap!!(x-32))
where
auxfont b = let y = map trns (map rInt (map show b)) in
convertir y []
trns z = modA [] 1 z
modA o l k
| l < 8 = modA (o++[(k `mod` 2)]) (l+1) (k `div` 2)
| otherwise o
convertir (e1:e2:e3:e4:e5) f
| e1==[] = f
| otherwise convertir [tail(e1),tail(e2),tail(e3),tail(e4),tail(e5)] (f++[(psr(head(e1)))++(psr(head(e2)))++(psr(head(e3)))++(psr(head(e4)))++(psr(head(e5)))])
psr 0 = " "
psr 1 = "*"
,我不得不和這個錯誤在convertir:
[1 of 2] Compiling Pixels (Pixels.hs, interpreted)
Pixels.hs:122:13: parse error (possibly incorrect indentation)
Failed, modules loaded: none.
在'otherwise'之後需要'='。 – augustss
兩人之後。 –