Method to order mana symbols in the mana cost
Posted: 29 Jun 2012, 06:02
I added automatic ordering of mana symbols in Magarena recently. It took me a while to figure out a clean way to do it and I was wondering if there is an even simpler method.
The official ruling for mana symbol ordering from https://www.wizards.com/magic/magazine/ ... zards/0604
Hence, the ordering is , following by colorless mana, followed by hybrid mana, followed by mono color. Within the mono colors, the above "pretty simple" system needs to be followed.
The way I do it is as follows. Find the first color in the order, then follow the WUBRG cycle to add the other colors. WUBRG is the ordering when all five mono colors are present. Let prev(color) be the previous color according to WUBRG and prev(W) = G.
let C the casting cost limited to just the mono color mana symbols. To find the first color, let F be the colors in C where the previous color is NOT in C, i.e F = {c in C, where prev(c) not in C}, i.e.
F has either 0, 1, or 2 colors.
If |F| = 0, the only case is when all five colors are present, hence the first color is W.
If |F| = 1, this happens when the colors form a "chain", then the first color is the color in F.
If |F| = 2, let the two colors in F be p and q. This is the wedge/enemy color case.
If prev(prev(p)) = q, the first color is q,
else the first color is p
Question: Is there a simpler method for this "pretty simple" system?
The official ruling for mana symbol ordering from https://www.wizards.com/magic/magazine/ ... zards/0604
However it doesn't mention the hybrid mana and other oddities. Turns out that in existing cards, only the 2 color hybrid mana interacts with the mono color and they are always drawn first. The image below shows the order of mana symbols in the current cards, there is an arrow from A to B if A can appear immediately before B.Del Laugel, Magic technical editor wrote:Our current (and final!) system for ordering mana symbols is pretty simple. If you look at the back of a Magic card, you'll see the pentagon of colors. Going clockwise, the colors are white, blue, black, red, green, white, blue, black . . . . To order a pair of mana symbols, find them in that list, and then put them in whichever order puts the fewest colors between them. For example, white/red has two colors in the middle (blue and black), but red/white has only one (green). That's why Goblin Legionnaire's mana cost is .
Then came the Apocalypse 'wedge' cards. Our system breaks down when you're trying to order two friendly colors and their common enemy, and Apocalypse has five rares with mana costs that fall into that category. For Lightning Angel's mana cost, and are equally valid options. In the end, I decided to put the enemy color pair first.
Hence, the ordering is , following by colorless mana, followed by hybrid mana, followed by mono color. Within the mono colors, the above "pretty simple" system needs to be followed.
The way I do it is as follows. Find the first color in the order, then follow the WUBRG cycle to add the other colors. WUBRG is the ordering when all five mono colors are present. Let prev(color) be the previous color according to WUBRG and prev(W) = G.
let C the casting cost limited to just the mono color mana symbols. To find the first color, let F be the colors in C where the previous color is NOT in C, i.e F = {c in C, where prev(c) not in C}, i.e.
F has either 0, 1, or 2 colors.
If |F| = 0, the only case is when all five colors are present, hence the first color is W.
If |F| = 1, this happens when the colors form a "chain", then the first color is the color in F.
If |F| = 2, let the two colors in F be p and q. This is the wedge/enemy color case.
If prev(prev(p)) = q, the first color is q,
else the first color is p
Question: Is there a simpler method for this "pretty simple" system?