Help- with checkers

So some of you know that my next big project is Checkers. Anyhow, obviously, I need some help with this.

So here is what I know how to do:

  • Let a player decide which piece he/she wants to move
  • Let them move that piece to where they want it to
  • Make sure this is a possible move from an actual piece
  • Let a player capture the opponents piece

Here is what I partially know how to do:

  • Let a player win via getting out all of the opponents pieces

Here is what I do not know how to do:

  • Let a player win via stalemate
  • Force a player to move a piece that can get another piece out



For this:

So a checkers piece moving affects the board in the following ways:

  • Blocking a capture
  • Walking into a capture
  • Unblocking a capture

This is a lot, but fortunately, there is only a small zone that a movement affects. You would check that small area if there are any potential captures, and you would force the player to move any pieces that can capture.

1 Like

Yeah, but how would I check efficiently without using 30% memory?

So have the starter coordinate and the ending coordinate and devise a mechanism that uses recursion and a counter with a certain target to check for all possible captures.

1 Like

Cool! But how would the starter/ending coordinate mechanism work? I guess I could run through every single piece and add 9, see if an opponents piece is there, do that with 11, for every single piece, for every single opponents piece, and use too much memory. Wait, idea! But hold on that, how would I even store force captures?

Use a few properties with indexing? I’ll think about this more.

That might work. Also, keep in mind I only have 47% memory left.

1 Like

Indexing, recursion, and other techniques might take up 10%, maximum 20%.

1 Like

Nice! I’ll sleep on this tonight! Don’t let me forget to credit you in the guide!

1 Like

Anyone have anymore ideas? Also, moving pieces is now a thing!