Skip to content

Commit

Permalink
Revert unintended changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
alreadydone committed Jul 5, 2018
1 parent 0970d83 commit 2539cd7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 36 deletions.
45 changes: 21 additions & 24 deletions src/FastState.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
This file is part of Leela Zero.
Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
This file is part of Leela Zero.
Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
Leela Zero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leela Zero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leela Zero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Leela Zero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Leela Zero. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with Leela Zero. If not, see <http://www.gnu.org/licenses/>.
*/

#include "config.h"
Expand Down Expand Up @@ -64,10 +64,10 @@ void FastState::reset_board(void) {

bool FastState::is_move_legal(int color, int vertex) {
return vertex == FastBoard::PASS ||
vertex == FastBoard::RESIGN ||
(vertex != m_komove &&
board.get_square(vertex) == FastBoard::EMPTY &&
!board.is_suicide(vertex, color));
vertex == FastBoard::RESIGN ||
(vertex != m_komove &&
board.get_square(vertex) == FastBoard::EMPTY &&
!board.is_suicide(vertex, color));
}

void FastState::play_move(int vertex) {
Expand All @@ -79,8 +79,7 @@ void FastState::play_move(int color, int vertex) {
if (vertex == FastBoard::PASS) {
// No Ko move
m_komove = FastBoard::NO_VERTEX;
}
else {
} else {
m_komove = board.update_board(color, vertex);
}
board.m_hash ^= Zobrist::zobrist_ko[m_komove];
Expand All @@ -96,8 +95,7 @@ void FastState::play_move(int color, int vertex) {
board.m_hash ^= Zobrist::zobrist_pass[get_passes()];
if (vertex == FastBoard::PASS) {
increment_passes();
}
else {
} else {
set_passes(0);
}
board.m_hash ^= Zobrist::zobrist_pass[get_passes()];
Expand Down Expand Up @@ -135,15 +133,14 @@ void FastState::set_to_move(int tom) {

void FastState::display_state() {
myprintf("\nPasses: %d Black (X) Prisoners: %d\n",
m_passes, board.get_prisoners(FastBoard::BLACK));
m_passes, board.get_prisoners(FastBoard::BLACK));
if (board.black_to_move()) {
myprintf("Black (X) to move");
}
else {
} else {
myprintf("White (O) to move");
}
myprintf(" White (O) Prisoners: %d\n",
board.get_prisoners(FastBoard::WHITE));
board.get_prisoners(FastBoard::WHITE));

board.display_board(get_last_move());
}
Expand Down
24 changes: 12 additions & 12 deletions src/FastState.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
This file is part of Leela Zero.
Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
This file is part of Leela Zero.
Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
Leela Zero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leela Zero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leela Zero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Leela Zero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Leela Zero. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with Leela Zero. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef FASTSTATE_H_INCLUDED
Expand Down

0 comments on commit 2539cd7

Please sign in to comment.