Comments (7)
You can find the solution here in this PDF, page number 9 and illustration in page number 10.
from algorithmic-toolbox-threerocksgame.
I had a PDF document explaining the 2-rock game, but when I tried to search for it now, I could not find it.
I basically used the same approach made in that document to solve the 3-rock one.
But could you be more specific? what exactly is not clear? How did I draw the 2D map with colors, or something else?
Doing it from the bottom up, and now is your move
Left Pile | Right Pile |
---|---|
0 | 4 |
now whatever move you make, would result in computer winning. so the max movement you can make is (0, 3) which will leave one stone on the right pile, and the computer will do the (0, 1) move and win the game
if you follow the same approach, you will mark the bad losing states. for example (0, 4), (1, 3), (2, 2), (3, 1), (4, 0)
Now if it is your move and the board is in the following state
Left Pile | Right Pile |
---|---|
0 | 5 |
Then you want to leave the computer with a losing state. so you do a (0, 1) move and leave the computer with a (0, 4) pile which is a losing state. now the computer can't do anything but do (for example) a (0, 2) move which will leave the pile as (0, 2), and now it's your move. you can see now how easily you can win the game by playing a (0, 2)
Please read the previous steps carefully and do it by hand to get a clear understanding of what is happening
from algorithmic-toolbox-threerocksgame.
I wanted to know how you drew the table, I couldn't see the pattern.
from algorithmic-toolbox-threerocksgame.
Can you please share the 2rock game document.
from algorithmic-toolbox-threerocksgame.
from algorithmic-toolbox-threerocksgame.
Unfortunately, I cannot provide any further help. As I said the PDF document explains the 2-rock game, and I tried to explain the 3-rock game. Do not overthink this. Bring paper and a pencil and try solving it by hand. It's the only way to understand it.
So I will close this issue for now.
from algorithmic-toolbox-threerocksgame.
from algorithmic-toolbox-threerocksgame.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algorithmic-toolbox-threerocksgame.