The nine rings puzzle, 3 ways: a Rosetta Stone for programming paradigms

  • Authors:
  • Carolyn Pe Rosiene;Joel A. Rosiene

  • Affiliations:
  • University of Hartford, W. Hartford, CT;Eastern Connecticut State University, Willimantic, CT

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents an alternate and nifty illustration to programming paradigms - an ancient Chinese puzzle - the ingenious nine linked rings puzzle. The goal is to remove all nine rings from the puzzle's handle. The basic premise to the solution is - to remove a ring, the ring before it must be the lead ring. In order to make any ring a lead ring, all other in front of it must be removed. The puzzle is intrinsically recursive and therefore dovetails with a recursive solution. However, a declarative solution using the logic paradigm also demonstrates the strength and expressiveness of the paradigm. Three ways of implementing the puzzle are presented, including a synthesized and somewhat unnatural iterative algorithm to solve the puzzle. The nine linked rings puzzle is yet another great example of taking an ancient puzzle and applying modern day algorithmic approaches to express computations in a variety of approaches - a Rosetta stone for programming paradigms. The actual puzzle and solutions have been presented in a programming language course with encouraging and positive feedback from students. For a CS1 introduction to recursion, the recursive approach may also be utilized.