M
Mike P
This should be fairly straightforward, but I can't figure out how to
approach this.... I'd appreciate any ideas you have.
Goal:
Make recommendations on what a Monopoly player should do with the
houses/hotels, cards and cash they have. (i.e., what should they
mortgage/unmortage, where should they build, etc.)
What I have:
I have created a calculator to figure out the relative value of any
board setup... so any setup I give the script, I can figure out how good it
is. (http://www.psmonopoly.com/calc/propstats.htm). If you try it, the page
will show you the relative value of your setup under RESULTS at the top.
The user has given me their current setup (what they own, what's
mortgaged, what has houses, etc.), how much money they have on-hand, how
much money they want to keep on-hand after the recommendations.
What I'd like to do:
Cycle through every conceivable thing they could do (mortgage a property
here, unmortage one there, build a house here, sell a house there, etc.),
compare the relative values of all the setups, and tell them which would be
their best choice. These options are limited by monopoly rules and what
they have to play with. For example, they have to build evenly, so a user
can't have four houses on one property and the other mortgaged in the same
monopoly. They can't build more houses than they have cash to buy, and they
can only change what they have (i.e., they can't build on a property unless
they own the whole block).
Where I'm stuck:
I haven't the foggiest notion of how to use javascript to loop through all
the configurations.
I assume, once I figure out how to loop through all the user's options, I
can create a two dimensional array, containing specifics of the monopoly
config, and the relative value I calculate for it, then find the highest
relative value, and show them the delta between how the board is set up now,
and how it should (optimally) be set up.
Any thoughts?
approach this.... I'd appreciate any ideas you have.
Goal:
Make recommendations on what a Monopoly player should do with the
houses/hotels, cards and cash they have. (i.e., what should they
mortgage/unmortage, where should they build, etc.)
What I have:
I have created a calculator to figure out the relative value of any
board setup... so any setup I give the script, I can figure out how good it
is. (http://www.psmonopoly.com/calc/propstats.htm). If you try it, the page
will show you the relative value of your setup under RESULTS at the top.
The user has given me their current setup (what they own, what's
mortgaged, what has houses, etc.), how much money they have on-hand, how
much money they want to keep on-hand after the recommendations.
What I'd like to do:
Cycle through every conceivable thing they could do (mortgage a property
here, unmortage one there, build a house here, sell a house there, etc.),
compare the relative values of all the setups, and tell them which would be
their best choice. These options are limited by monopoly rules and what
they have to play with. For example, they have to build evenly, so a user
can't have four houses on one property and the other mortgaged in the same
monopoly. They can't build more houses than they have cash to buy, and they
can only change what they have (i.e., they can't build on a property unless
they own the whole block).
Where I'm stuck:
I haven't the foggiest notion of how to use javascript to loop through all
the configurations.
I assume, once I figure out how to loop through all the user's options, I
can create a two dimensional array, containing specifics of the monopoly
config, and the relative value I calculate for it, then find the highest
relative value, and show them the delta between how the board is set up now,
and how it should (optimally) be set up.
Any thoughts?