Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative board coordinates #4

Closed
sente361 opened this issue Mar 21, 2019 · 2 comments
Closed

Alternative board coordinates #4

sente361 opened this issue Mar 21, 2019 · 2 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@sente361
Copy link

REQUESTING A VOLUNTEER!
I only have a limited understanding of coding so it would be a major undertaking for me to make what should be a relatively simple enhancement. (I have tried already and run into unexplained problems even getting Visual Studio Code to do the command "git clone"!)
This issue appears to relate to the Shudan section API Reference/Goban/Component/Coordinates Props (as described in the README Documentation relating to Shudan).
When using Sabaki I would like to be able to choose the alternative coordinate system "Simple coordinates". See Senseis Library reference at https://senseis.xmp.net/?Coordinates#toc7
Using Simple Coordinates, on the 19x19 goban the x and y axes are both labelled 1 2 3 4 5 6 7 8 9 X 9' 8' 7' 6' 5' 4' 3' 2' 1'
Examples (default coords first, simple coords second): D4=44; C16=34'; K10=XX; R17=3'3'.
It would only be appropriate to use Simple Coordinates on gobans up to 19x19. (I would be very happy if I only had the option to use Simple Coordinates on the 19x19 goban.)
If it wasn't a difficult coding task then it would be good to have the option to use Simple Coordinates on all goban sizes up to 19x19. Alternatively, it would be good to have the option on the 9x9 and 13x13 gobans. However 19x19 alone would be great!
9x9 goban: both axes are labelled 1 2 3 4 5 4' 3' 2' 1'
13x13 goban: both axes are labelled 1 2 3 4 5 6 7 6' 5' 4' 3' 2' 1'
I hope someone would like to take on this project. Many thanks in advance!

@yishn
Copy link
Member

yishn commented Mar 21, 2019

You can use the following function (adapted for x coordinates) for the coordX prop to achieve your desired effect:

function coordX(x) {
  if (x <= Math.ceil(width / 2) - 1) return x.toString();
  return `${width - x + 1}'`
}

Make sure the variable width is accessible by this function. This should work with all board sizes.

@yishn yishn added the question Further information is requested label Mar 21, 2019
@sente361
Copy link
Author

sente361 commented Mar 22, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Development

No branches or pull requests

2 participants