ID:157944
 
How would I use Linear Programming for a crazy eights game in DM? I need to use it for a Math Fair. :o
I'm assuming that by "Linear Programming" the goal is to produce a program which executes entirely within a single thread, in which case the only answer would involve a really, really ugly interface, as the only viable means of input would be via input(). Any verbs are executed in their own thread and so would be inherently nonlinear. Unless that's not what you mean.

Oh, and don't ask such a stupidly absurdly broad question.
In response to Garthor
I actually don't care how it is used or where, even if it's just a tiny section, I just need to, in some way, use linear programming with my crazy eights game.
In response to Speedro
In which case literally any programming whatsoever would fulfill that requirement as any nonlinear media inherently has some portion which is linear. Processing linear chunks in a nonlinear order is still processing linear chunks.
In response to Garthor
So, basically just by programming I can say I'm using Linear Programming?
In response to Speedro
Yes.

But if you're not in a philosophy class don't expect a good grade for that line of reasoning.

My suggestion would be to take what has been taught to you and apply it in a manner which demonstrates your understanding of the material.
In response to Garthor
It's a grade 11 math fair project- I'm sure it will be impressive that I can even program. :) I actually have hardley a clue what Linear is haha, as long as I use it.
In response to Speedro
Oh, if we're talking about math: http://en.wikipedia.org/wiki/Linear_programming Most of that's probably over your head though, skip down to the "Standard Form" heading, which is likely what you've learned.

It has very little to do with actual programming. I'm not sure how to relate this to Crazy Eights, though it would be in the realm of designing an AI. I'm sure it'd be possible, but it'd require some mental hoops to jump through. The axes would have to correspond to something along the lines of "get rid of my cards" and "prevent my opponent from getting rid of their cards" and the constraints would be functions that would in some way represent the state of the game at a given moment.

But really, this does not lend itself to a linear programming solution in any way whatsoever.

A better example of the concept would be a game in which you have a set of resources (IE: metal, water, energy) and a set of actions which consume those resources in differing quantities. Given the importance of each action, linear programming can be used to determine what would be optimal.

As a more concrete example, consider a simple Real Time Strategy game, where you are given 1000 metal and 1000 energy to build units, and you can build either soldiers for 50 metal / 100 energy, or tanks for 200 metal / 100 energy. Obviously, there is a balance you can strike between the two which would be ideal for a given effectiveness of tanks vs. soldiers. It would be simple to apply linear programming to solve that problem.
In response to Garthor
Sounds about right, thanks. I'll just tell my teacher that the compiler reads the code in the most efficient manner possible trying to find an "optimal balance" and hopefully that'll work. :o

Although if it doesn't, I'll think of something... Thanks Garthor. Oh- and once again I'm using your GetClick proc for this project, thanks!