19
4
Picture of me drafting this challenge with my advanced drawing skills.
Background
The Stickman wars happened long ago, when Earth's dominant species was made of nothing but sticks. Historians regret the fact that there were no painters or cameras back then, we could use some pictures of that war in today's history books. That's where your coding powers become useful. Stickmen are very easily drawed and Historians managed to find some data about how many stickmen fought the wars¹. Now it's up to you to recreate an image of the moment right before the war began!
Here are the brave stickmen involved in the war:
O / |/|\/ | | / \ Swordsman O A /|\| | | / \| Spearman . .' *. ' O * ' \|/ . . | * './ \*. Mage O /|\ | / \ Villager O /|\ / \ Infant
Input
Receive via stdin or equivalent a representation of every stickman who appeared on each side of the battlefield. For example, if two Swordmen fought on the right side and two spearmen on the left side, your input can be {Sword: 2}, {Spear: 2}
, [2,0,0,0,0], [0,2,0,0,0]
or a "WW", "SS"
.
Output
A representation of every brave stickmen in a battle field, according to the rules below. It can be shown on stdout or saved to a file, whatever rocks your boat.
Rules
- On the left side will be every stickmen of the first array/string/object your program received.
- Those stickmen must look exactly like the ones shown before on this question.
- The order of the left side army must be
Infants Villagers Mages Swordsmen Spearmen
. - The right side army will behave just the same, but with the characters and the order mirrored.
- Each stickman will be separated by 1 space.
- Each class will be separated by 3 spaces.
- The armies will be separated by 8 spaces.
- Since stickmen don't fly, you must draw the ground using hyphen-minuses
-
. - The ground must end on the same column the last stickman of the right army ends.
Example
Let's assume my program expects two arrays with length 5 and each value in the array represents, in order, Infants Villagers Mages Swordsmen Spearmen
.
Input: [1,1,2,3,1] [0,0,1,1,1]
. . . .' *. .' *. .* '. O ' O * ' O * O / O / O / O A A O \ O * O ' O /|\ ' \|/ . ' \|/ . |/|\/ |/|\/ |/|\/ /|\| |/|\ \/|\| . \|/ ' /|\ | . | * . | * | | | | | | | | | | | | * | . / \ / \ './ \*. './ \*. / \ / \ / \ / \| |/ \ / \ .*/ \'. ---------------------------------------------------------------------------------------
Final Considerations
Please note that standard loopholes apply and that the mage is completely asymmetrical just because.
The result of most upvoted answer will be the "cover image" of this challenge. The shortest answer by the end of the month (08/31/2014) will be selected as the winner.
This is code-golf, so the shortest code, in bytes, wins.
¹Citation needed
7"the mage is completely asymmetrical just because" ... twitch... you just had to, didn't you? :P – Doorknob – 2014-08-09T12:15:41.900
4@Doorknob ¯\ (ツ)/¯ – William Barbosa – 2014-08-09T12:26:25.423
Is ok a function with 2 array arguments or you require input parsing from a string? – edc65 – 2014-08-09T15:58:22.147
TIL about overscores. Can unicode-challenged languages use dashes instead, please? – John Dvorak – 2014-08-09T16:07:49.727
@edc65 You can receive two arrays, no problem – William Barbosa – 2014-08-09T16:40:12.843
@JanDvorak Didn't think about that. Thanks for noting. I updated the question. – William Barbosa – 2014-08-09T16:43:12.253
1There's a column missing between the villager and the mage. Also would a representation like
IVMMWWWS SWM
be within the limit of "anything that helps you"? – Martin Ender – 2014-08-09T17:33:05.523@MartinBüttner Sure thing. I think I should reword that, though. – William Barbosa – 2014-08-09T17:52:56.213
Any restrictions on the ground length? I think you forgot to add one hyphen there. But can it be longer than the last column containing stickmen characters? – Martin Ender – 2014-08-09T18:33:38.037