Great question!
I'd suggest you start by thinking about how exactly you determine if a piece should be flipped. In any of your eight directions, you flip any pieces of the opposite color between your piece and the first piece of the same color, and don't flip any if there are any empty spaces before you reach that piece. (Note that this is a pretty handy way to deal with even the case where there are 0 pieces of the opposite color between the two, because you'll flip "all 0" of them.)
There are cool things you can do when you use +/- 1, too -- check the product of values to see whether the colors match (+1) or mismatch (-1), or to flip the token multiply by -1.
Quick mockup of this conceptually, where we're checking the lines of options as well as to make sure we don't leave the board -- I'm using !=
for not equal, in case that's not familiar to you:
set current_player // +1 or -1
set current_space // say [3, 4]
directions = [[-1, -1], [-1, 0], ...]
for direction in directions:
spaces_away = 1
check_space = direction*spaces_away + current_space
while (check_space has values between 1 and 8 for both x and y) and (check_space != 0)
if current_player * (direction*spaces_away + current_space) = -1
spaces_away += 1 // add one so we can check the next space out
check_space = direction*spaces_away + current_space
else
for i from 1 to spaces_away
flip_space = direction*spaces_away + current_space
flip_space * -1 // this will change the color
There's some implementation to think about here, mainly the fact that I ignore how you're assigning a -1, 0, or 1 to each of the 64 spaces. Hopefully the pseudocode is clear enough without this.
If the for direction in directions
doesn't make sense, take some time to look up what an iterable is. Super useful concept, regardless of what you do here!
Best of luck!