Solitaire peg puzzle plus (resta 1)

{% trans 'Sorry, your browser does not support canvas -- please either update your browser or submit your requirements by phone or email.' %}

Accelerometer

Avatar for Purparus Purparus

This program simulates the board game "Solitaire peg puzzle" (Resta-1) which is composed by 32 pins distributed as a "+" (plus) having the middle point free. The target is to remove the pieces jumping one over its neighbor that has a free space at its side. until you leave only one piece in the middle. Unfortunately codebug has only 25 available leds therefore the board here contains only 20 pieces what may make impossible to leave only one but it is enough for you to challenge your colleagues to see who leaves the lowest number of pieces (the number of pieces left is presented at the end of the game when no more moves are possible).. Due to the number of movement options against only two buttons, the logic applied is the following: - Button "A" selects a mode each time your press it: 1 - moves the pin selection to right, looping down 2- moves the pin selection to the left, looping up 3 - jumps the pin to right, 4 - jumps the pin to the left, 5 - jumps the pin down 6- jumps the pin up each time you jump, the "jumped over" pin is removed each time an option is selected and timely after that, the program will blink the leds in a give pattern according the current selection as a reminder: 1 - leds will blink sequentially from left to right. move mode 2- leds will blink sequentially from right to left. move mode 3 - leds will blink sequentially from left to right and then alternately. jump mode 4 - leds will blink sequentially from right to left and then alternately. jump mode 5 - leds will blink sequentially from top to bottom and then alternately. jump mode 6 - leds will blink sequentially from bottom to top and then alternately. jump mode Button "B" executes the movement/jump according the selection done by "A" Suggestions: extend the program to cover the 30-pins board scrolling the leds on codebug display have fun]

Report this project
Back to top