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

Question about castRadiance function #4

Closed
tdkr opened this issue Dec 12, 2019 · 3 comments
Closed

Question about castRadiance function #4

tdkr opened this issue Dec 12, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@tdkr
Copy link

tdkr commented Dec 12, 2019

if (d >= p1 || data[n[1]] && data[n[1]][n[0]] == null && data[n[1]][n[0]] === -sign || n in visited)
    continue

A question about above code, isn't 'data[n[1]] && data[n[1]][n[0]] == null && data[n[1]][n[0]] === -sign' always return false?

@yishn
Copy link
Member

yishn commented Dec 12, 2019

Nice catch! Looking at the commit history, it's probably supposed to be instead:

if (d >= p1 || data[n[1]] && data[n[1]][n[0]] != null && data[n[1]][n[0]] === -sign || n in visited)

or equivalently just:

if (d >= p1 || data[n[1]] && data[n[1]][n[0]] === -sign || n in visited)

The middle condition is supposed to block radiance if encountering an enemy stone. Do you mind creating a PR for this?

@yishn yishn added the bug Something isn't working label Dec 12, 2019
@tdkr tdkr changed the title question about castRadiance function Question about castRadiance function Dec 13, 2019
@tdkr
Copy link
Author

tdkr commented Dec 13, 2019

Nice catch! Looking at the commit history, it's probably supposed to be instead:

if (d >= p1 || data[n[1]] && data[n[1]][n[0]] != null && data[n[1]][n[0]] === -sign || n in visited)

or equivalently just:

if (d >= p1 || data[n[1]] && data[n[1]][n[0]] === -sign || n in visited)

The middle condition is supposed to block radiance if encountering an enemy stone. Do you mind creating a PR for this?

Sure, thanks for your reply

@yishn
Copy link
Member

yishn commented Dec 13, 2019

Closed with #5.

@yishn yishn closed this as completed Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants