Derive a algorithm to match best position
- by Farooq Arshed
I have pieces in my game which have stats and cost assigned to them and they can only be placed at a certain location.
Lets say I have 50 pieces.
e.g.
Piece1 = 100 stats, 10 cost, Position A.
Piece2 = 120 stats, 5 cost, Position B.
Piece3 = 500 stats, 50 cost, Position C.
Piece4 = 200 stats, 25 cost, Position A.
and so on..
I have a board on which 12 pieces have to be allocated and have to remain inside the board cost.
e.g. A board has A,B,C ... J,K,L positions and X Cost assigned to it.
I have to figure out a way to place best possible piece in the correct position and should remain within the cost specified by the board.
Any help would be appreciated.