Thread:Sylvandyr/@comment-5619126-20121014124324/@comment-5619126-20121028142307

Well, getting the possible offspring of two parents seems easier than finding out what parent combos lead to a specific offspring.

I think I have coded it right on the test page for breeding single colours. It would be good if you could check on it.

http://dragon.sjau.ch/test.php?id=XXXXX

Use following ID numbers:

2 - Air Dragon

10 - Diamond Dragon

15 - Fire Dragon

17 - Forest Dragon

27 - Infinity Dragon

32 - Light Dragon

35 - Magic Dragon

53 - Water Dragon

What I basically do is the following:

(1) Check if the offspring is a one color dragon

(2) Get all dragons that only has this one color

(3) Get all diamond dragons and make any combination of them (e.g. Diamond and Infinity, Diamond and Diamond)

(4a) Check if the color us purple. If so, get all dragons that contain blue and/or red. Then make all possible combinations of those dragons containing blue and/or red and then filter out the combinations that do not have both in the combined pool.

(4b) Check if the color is diamond. If so, get all dragons with at least two colors and directly omit a dragon if one of the two colors is also diamond. For the rest get all possbile combinations and filter out those that will not result in 4 colors (red, green, yellow, blue, purple and white)

I think that's all fine for the single-color dragons.