diff --git a/docs/windows.md b/docs/windows.md index 4c4d3fa877..d99ba21a14 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -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 diff --git a/open_spiel/games/morpion_solitaire.cc b/open_spiel/games/morpion_solitaire.cc index 37ab101223..ba91e30b0a 100644 --- a/open_spiel/games/morpion_solitaire.cc +++ b/open_spiel/games/morpion_solitaire.cc @@ -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); }