Nick Wolff wrote on Tue, Aug 22, 2017 01:29 AM UTC:
Fergus,
I told Carlos some time ago that I'd get his Sissa coded so he could have some rule enforcing presets - afterall, Cetran Chess 2 is one of the most played games on the site. I know how to code it, but I'm not sure if there is a more efficient way to do so.
How I KNOW how to do it is to do it similar to the Rose, where I use the map function to create directions (ex. n, s, nw, se, etc...), and logride to create the movement scheme. The problem with this is that for the Sissa's movement on an empty 8x8 board, it would have a total of 288 different possible movements (with different placement on the board, of course), and if someone would want to impliment a Sissa on a larger board, they would have to adjust the code and add an extra 36 movements/paths per step up (from 8x8 to 9x9, etc.).
Do you have any ideas on simplification? I'm thinking variables might be the easiest way, but is there a way to impliment variables into the pathing? A Sissa moves any amount of spaces orthogonally then the same amount of squares diagonally and vice versa, so instead of doing a path for EVERY possible amount of squares moved each direction, is there a way to say he moved x spaces in this direction, now must move x spaces that direction? If you can logride with variables, that would cut 288 paths down to 36 AND you can use the same code for any board size. Even better, if we can say x squares orthogonally (instead of x squares north or south or east or west) then x squares diagonally, that would reduce the paths further down to 8. Is it possible?
I know its a loaded question, but thank you for the help!
Fergus,
I told Carlos some time ago that I'd get his Sissa coded so he could have some rule enforcing presets - afterall, Cetran Chess 2 is one of the most played games on the site. I know how to code it, but I'm not sure if there is a more efficient way to do so.
How I KNOW how to do it is to do it similar to the Rose, where I use the map function to create directions (ex. n, s, nw, se, etc...), and logride to create the movement scheme. The problem with this is that for the Sissa's movement on an empty 8x8 board, it would have a total of 288 different possible movements (with different placement on the board, of course), and if someone would want to impliment a Sissa on a larger board, they would have to adjust the code and add an extra 36 movements/paths per step up (from 8x8 to 9x9, etc.).
Do you have any ideas on simplification? I'm thinking variables might be the easiest way, but is there a way to impliment variables into the pathing? A Sissa moves any amount of spaces orthogonally then the same amount of squares diagonally and vice versa, so instead of doing a path for EVERY possible amount of squares moved each direction, is there a way to say he moved x spaces in this direction, now must move x spaces that direction? If you can logride with variables, that would cut 288 paths down to 36 AND you can use the same code for any board size. Even better, if we can say x squares orthogonally (instead of x squares north or south or east or west) then x squares diagonally, that would reduce the paths further down to 8. Is it possible?
I know its a loaded question, but thank you for the help!