系列: Angelia
haskell
5 行
· 更新於 2026-02-03
exercise_7.hs
Angelia/Haskell/Week_6_Lab/exercise_7.hs
-- Define the riffle function
riffle :: [a] -> [a] -> [a]
riffle [] ys = ys -- If the first list is empty, return the second list
riffle xs [] = xs -- If the second list is empty, return the first list
riffle (x:xs) (y:ys) = x : y : riffle xs ys -- Alternate elements from both lists recursively
相關文章
Angelia
haskell
EN
更新於 2026-02-03
Adding.hs
Adding.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Adding.hs).
閱讀文章 →
Angelia
haskell
EN
更新於 2026-02-03
Area.hs
Area.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Area.hs).
閱讀文章 →
Angelia
haskell
EN
更新於 2026-02-03
Chess.hs
Chess.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Chess.hs).
閱讀文章 →
Angelia
haskell
EN
更新於 2026-02-03
ChessGraphics.hs
ChessGraphics.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/ChessGraphics.hs).
閱讀文章 →
Angelia
haskell
EN
更新於 2026-02-03
Examples.hs
Examples.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Examples.hs).
閱讀文章 →
Angelia
haskell
EN
更新於 2026-02-03
Fibonacci.hs
Fibonacci.hs — haskell source code from the Angelia learning materials (Angelia/Haskell/Fibonacci.hs).
閱讀文章 →