Skip to content

Commit

Permalink
Merge pull request #795 from aaronsnoswell:fix-794-windows-build-errors
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 431146476
Change-Id: Ic1ce0497c67007f2c2ff7adbbac4c006f349fdb3
  • Loading branch information
lanctot committed Feb 27, 2022
2 parents f126e99 + 4a98717 commit 5efd5a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
5 changes: 3 additions & 2 deletions docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ rest) from any location, you will need to add to your PYTHONPATH the root
directory and the `open_spiel` directory. Open
[Windows environment variables and add to the PYTHONPATH](https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-so-it-finds-my-modules-packages).
Add the directories `C:\Users\MyUser\open_spiel\open_spiel\out\build\x64-Debug`
and `C:\Users\MyUser\open_spiel\open_spiel\out\build\x64-Debug` to PYTHONPATH.
To check that python is working, you can run the example in
and `C:\Users\MyUser\open_spiel\open_spiel\out\build\x64-Debug\python` to
PYTHONPATH. If your PYTHONPATH does not exist, then create a new environment
variable for it. To check that python is working, you can run the example in
`open_spiel\python\examples`.

OpenSpiel has various Python dependencies which may require installing. At a
Expand Down
47 changes: 21 additions & 26 deletions open_spiel/games/morpion_solitaire.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,36 +62,31 @@ Line::Line(Action action) {
int base;
Point point1;
Point point2;
switch (action) {
if (action >= 0 && action <= 129) {
// [0, 1]
case 0 ... 129:
row = action / 10;
point1 = Point(row, action - row * 10);
point2 = Point(row, (action - row * 10) + 3);
break;
row = action / 10;
point1 = Point(row, action - row * 10);
point2 = Point(row, (action - row * 10) + 3);
} else if (action >= 130 && action <= 259) {
// [1, 0]
case 130 ... 259:
base = action - 130;
row = (base) / 13;
point1 = Point(row, base - row * 13);
point2 = Point(row + 3, (base - row * 13));
break;
base = action - 130;
row = (base) / 13;
point1 = Point(row, base - row * 13);
point2 = Point(row + 3, (base - row * 13));
} else if (action >= 260 && action <= 359) {
// [1, -1]
case 260 ... 359:
base = action - 260;
row = (base) / 10;
point1 = Point(row, base - row * 10);
point2 = Point(row + 3, (base - row * 10) + 3);
break;
base = action - 260;
row = (base) / 10;
point1 = Point(row, base - row * 10);
point2 = Point(row + 3, (base - row * 10) + 3);
} else if (action >= 360 && action <= 459) {
// [1, 1]
case 360 ... 459:
base = action - 360;
row = (base) / 10;
point1 = Point(row + 3, base - row * 10);
point2 = Point(row, (base - row * 10) + 3);
break;
default:
SpielFatalError("action provided does not correspond with a move");
base = action - 360;
row = (base) / 10;
point1 = Point(row + 3, base - row * 10);
point2 = Point(row, (base - row * 10) + 3);
} else {
SpielFatalError("action provided does not correspond with a move");
}
Init(point1, point2);
}
Expand Down

0 comments on commit 5efd5a8

Please sign in to comment.