Project showcase

# Chinese Rings Puzzle With Arduino © CC BY-NC-ND

The Chinese Rings Puzzle with Arduino is my version of a centennial puzzle. Play it and have fun for a long time!!

• 5,701 views
• 17 respects

## Components and supplies

 Arduino UNO
×1
 DFRobot LCD Keypad Shield For Arduino https://www.dfrobot.com/product-51.html
×1

## Apps and online services

 Arduino IDE

### Introduction

Hello all,

The Chinese Rings Puzzle with Arduino is my version of a centennial Chinese puzzle.

It is very simple to play and it is an example of a combinatorial puzzle, and lots of patience and concentration is required to solve it.

The objective is to untangle the long loop from all nine rings, and the solution takes 341 moves (minimum possible).

Once you learn the method to solve the puzzle, you will see that is very easy to play it!

This project is very simple to be assembled, using only an Arduino UNO R3 and a LCD Keypad Shield.

It took me some time, but the code I developed reproduced exactly the same conditions and constraints as the original mechanical puzzle.

Let's do it and have a fun for a long time!!

LAGSILVA

### The Puzzle Story

Stewart Culin in his book "Games of the Orient" records a story that the Chinese Rings puzzle was invented by the famous Chinese hero Mung Ming (A.D. 181 - 234).

He apparently gave it to his wife when he went to war so she would have something to keep her busy in his absence. The story relates that she forgot her sorrow while trying to solve the puzzle.

This puzzle or the Cardano's Rings was introduced in Europe by Girolamo Cardano in 1550 and it is perhaps the greatest mechanical puzzle of China.

The original puzzle consists of a long loop with a handle on one end that is interlocked with nine rings.

### A Little of Math

The total of moves for a number of rings (n) is determined by the following equations:

1) When n is odd number:

T (n) = (2 ^ (n+1) − 1 ) / 3

2) When n is even number:

T (n) = (2 ^ (n+1) − 2 ) / 3

``````n	T(n)
1	1
2	2
3	5
4	10
5	21
6	42
7	85
8	170
9	341
10	682
11	1365
12	2730
13	5461
14	10922
15	21845
16	43690
17	87381
18	174762
19	349525
20	699050
``````

### Material List

• Arduino UNO R3

### Playing

The first line of LCD is shown the 09 rings, and in the second line is shown the pointer.

You must use the keys LEFT & RIGHT to move the pointer, and the key SELECT to remove or to insert a ring.

The LEFT key moves the pointer direct to the first ring position, and the RIGHT key moves the pointer one position step by step.

The LCD also shows the total amount of moves, counting every time you press SELECT key to remove or insert a ring.

The key RESTART is used to start again the game at any moment.

At the end, after you solve the puzzle completely, you will see the "Congratulations" message and your grade.

Note: You will see there are some restrictions to move the pointer and also to remove a ring, but this is part of the rules to solve the puzzle.

#### Author

##### LAGSILVA
• 29 projects
• 276 followers

June 2, 2017

#### Members who respect this project

and 9 others

See similar projects
you might like

• 1,945 views
• 1 comment
• 4 respects

#### Lottery Winner: Non-Repeating Random Numbers for Arduino

Project tutorial by LAGSILVA

• 9,475 views
• 39 respects

#### Arduino Pong Game - OLED Display

Project tutorial by Nick Koumaris

• 12,245 views
• 22 respects

#### Ternary Digital Clock with Arduino

Project tutorial by LAGSILVA

• 5,998 views
• 15 respects

#### Pi-Clock with Arduino

Project tutorial by LAGSILVA

• 2,576 views