Hostname: page-component-77f85d65b8-pkds5 Total loading time: 0 Render date: 2026-03-28T19:33:33.164Z Has data issue: false hasContentIssue false

Solving the snake cube puzzle in Haskell

Published online by Cambridge University Press:  25 March 2013

MARK P. JONES*
Affiliation:
Department of Computer Science, Portland State University, Portland, Oregon, USA (e-mail: mpj@cs.pdx.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Functional Pearls
Copyright
Copyright © Cambridge University Press 2013
Supplementary material: File

Jones Supplementary Material

Supplementary Material

Download Jones Supplementary Material(File)
File 51.1 KB
Submit a response

Discussions

No Discussions have been published for this article.