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

How to set stone before game start? #43

Open
winston0410 opened this issue Apr 9, 2020 · 2 comments
Open

How to set stone before game start? #43

winston0410 opened this issue Apr 9, 2020 · 2 comments

Comments

@winston0410
Copy link

HI,

How can I set stone on board before game start? I have read the doc and load the board successfully, but how can I set stones on the board when I render a flash new game?

@aprescott
Copy link
Owner

Hi! There's currently no first-class way to define starting state. The simplest way is to play moves through the gameplay functions until you reach the starting state you'd like.

I realize that's not ideal for all use cases, but properly supporting arbitrary starting states is, I think, in line with exposing a board interface that isn't so closely tied to a board. (For example: place black stones on points A, B, C, ..., without worrying about whether black or white is the current player.) I had/have plans to support that type of thing.

Is explicitly playing moves (and passing where necessary) good enough for your use case?

@winston0410
Copy link
Author

I would say using the gameplay functions for setting stone before game start is usable but not ideal, especially when you try to create a go problem when the number of Black and White stones are not equal. It is tricky and error-prone.

Also having the function of only play Black or White stone make user lay one kind of stone only on their own possible, thus making Tenuki a better board editor.

Btw I tried many Go library and I have to say the responsiveness of Tenuki is awesome! I also love the part where you use vanilla js and there is no dependency for this library. I think adding that functions into Tenuki would make it the best JS Goban library!(I wish I can help writing it but it is way too difficult for me right now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@aprescott @winston0410 and others