We describe a concise and elegant functional program, written in Haskell, that computes solutions for a classic puzzle known as the snake cube. The program reflects some of the fundamental characteristics of the functional style, identifying key abstractions, and defining a small collection of operators for manipulating and working with the associated values. Well-suited for an introductory course on functional programming, this example highlights the use of visualization tools to explain and demonstrate the choices of data structures and algorithms that are used in the development. Copyright © Cambridge University Press 2013.
CITATION STYLE
Jones, M. P. (2013). Solving the snake cube puzzle in Haskell. Journal of Functional Programming, 23(2), 145–160. https://doi.org/10.1017/S0956796813000014
Mendeley helps you to discover research relevant for your work.