Log In  

Cart #peg_solitaire-15 | 2022-01-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6


This is my first PICO-8 cart! Enjoy!
It is a simple implementation of the classic board game Peg solitaire. I made this as an exercise to familiarize myself with PICO-8.

Rules

You can jump a peg over an adjacent peg into a hole, removing the jumped peg.
Your goal is to empty the board, except for a single peg in the marked hole.

Move count

Consecutive jumps with the same peg are counted as a single move.
Try to solve the puzzles in the least number of moves!

Keys

Arrows: Move your cursor
Arrows while holding X: Move a peg
Z: Undo last move

Tip: To make consecutive jumps with the same peg, just hold X and press the arrows you need.


Credits
Many board designs, especially those based on hexagonal grids, were inspired by this very nice website by George Bell:
http://www.gibell.net/pegsolitaire/index.html


Changelog

v1.1:

  • Added support for boards based on hexagonal grids
  • Added the triangular board

v1.2:

  • Fixed: a board was not solvable
  • Added boards based on hexagonal grids
  • Minor graphical improvements

v1.3:

  • Added the possibility of editing the starting configuration of the pegs
  • Minor fixes
P#105190 2022-01-16 18:51 ( Edited 2022-01-22 18:28)

Hi! I just tried this, but for some reason X+arrow doesn't move a peg for me. The highlight changes to blue when I press and hold X, so it does seem to know I'm hitting the right key, but the peg doesn't move.

P#105202 2022-01-16 20:27

@megashub: Hi! Thank you for your feedback! To move a peg, you need to hold X while you press an arrow key. I modified the "Keys" section in the hope to make it clearer.

If the move you are trying is not legal, nothing will happen.

P#105204 2022-01-16 20:31 ( Edited 2022-01-16 20:37)

Understood. That's what I'm doing (holding X while pressing an arrow key). The move is legal, just moving a peg to an orthogonally adjacent open hole (the first move).

P#105205 2022-01-16 21:04

neeevermind. I'm an idiot. I always need to jump pegs. Works fine.

P#105206 2022-01-16 21:05

You've got a lot of choices but I didn't see the Cracker Barrel triangle puzzle, @hathi. That's the one I really wanted to see and play. Can you add it ?

P#105211 2022-01-16 23:54 ( Edited 2022-01-17 00:05)

@dw817: I added the triangular board. Since in this variant the grid is not orthogonal, I'm afraid the commands may be a little tricky. Please let me know what you think about it.

P#105225 2022-01-17 11:56 ( Edited 2022-01-17 11:59)
4

@hathi, how marvelous ! I see you have. It's not orthogonal but still has the same feel - at least to me. Well done. Gold star effort. You first gold star in fact.

Here is a variant where the opening is in the center, just like the original Cracker Barrel puzzle plays.

Cart #peg_solitaire_mod-1 | 2022-01-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

P#105236 2022-01-17 17:59 ( Edited 2022-01-17 18:11)

@dw817: I'm happy to know that you liked it. And thank you for the golden star!

I plan to submit a (last?) version of the cart with some more triangle-based boards. I have already done the work of adding support for this variety, so...
I think I will include the Cracker Barrel version with the opening in the center.

P#105345 2022-01-18 22:26

Very nice, @hathi ! I see you added the Cracker Barrel Puzzle proper as well as a bunch of interesting others. ❤️ Favorited !

Here is some more information that may assist you:

https://en.wikipedia.org/wiki/Peg_solitaire
https://www.youtube.com/watch?v=965h3pp9_kQ

P#105445 2022-01-20 23:06 ( Edited 2022-01-20 23:10)

Ah yes, the Cracker Barrel days.

P#109477 2022-03-31 17:19

I might suggest something else, @hathi. For the puzzle where the movements are diagonal. While you can indeed hold down two arrow keys to get that movement, you might allow the cursor to move diagonally up and down just by pressing the UP and down arrow keys.

Where when you press that single arrow it will locate the nearest peg or hole even if diagonal, and select it.

P#109534 2022-04-01 21:33

Thank you for the feedback, @dw817. I made a test cart inspired by your suggestion. Here it is:

Cart #peg_solitaire_testcontrols-1 | 2022-05-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

However, I'm not sure the new controls are really practical to use. For example, consider this situation:

Here, moving the central peg e.g. to the lower right with a jump could be tricky, because it requires very precise timing in pressing two keys at the same time. Without correct timing, the peg could jump to the right or to the lower left instead.
In the cart you can find a board with the situation depicted here, so you can try it yourself.

Let me know what you think about it.

P#111553 2022-05-09 12:41 ( Edited 2022-05-09 12:42)

Hi @hathi:

In the example above, you could press UP and the cursor would move both up and right. If you press DOWN the cursor would move both down and left.

If you press either LEFT or RIGHT, the cursor moves respectively a full LEFT or RIGHT peg position.

...

Oh wait, I see what you are saying. OK do this. If it is possible for the peg to jump either up and left or up and right, highlight both. Then in pressing LEFT or RIGHT from here will determine that extra movement of LEFT or RIGHT when jumping UP.

P#111846 2022-05-15 14:53 ( Edited 2022-05-15 14:56)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 22:01:03 | 0.039s | Q:43