There is a Sioux village. It has a totem:
__
___| |___
\/ \ / \/
/\ ``| |`` /\
/^^\ | | /^^\
/ /\ \ | | / /\ \
''''''''''''''''''''''''''''
The totem lets the Sioux mastering the weather for helping in their different tasks. Help the villagers properly decorating the totem for invoking the adequate weather. The totem has several parts:
__
___|AA|___
\/ \BBBBBBBB/ \/
/\ ``|CC|`` /\
/^^\ |DD| /^^\
/ /\ \ 13 |EE| 42 / /\ \
''''''''''''''''''''''''''''
A
is for sun()
or cloudsww
B
is for rain""""""""
or snow::::::::
C
is for thunderstormzz
D
is for wind~~
E
is for fog==
But that's not all. The totem needs weather dancers. The more elements are invoked, the higher the number of required dancers is. If there is one element invoked, a dancer is needed. Two elements, two dancers. Beyond four elements, there will always be at most four dancers. If there is no element invoked, no dancers are needed. The totem needs to rest.
The weather dancers must appear in the order 1234
. For instance if there are two dancers, the slots 1
and 2
must be occupied. Moreover, each dancer performs a different figure:
1
isT
2
isY
3
isK
4
isX
Now, the villagers will express their weather wishes. They will pronounce a sentence containing the weather element(s) they would like to have. Setup the totem and the dancers for fulfilling their wishes.
Challenge
Write a program which takes a string as input, matches the elements in the sentence (sun, rain, …), and outputs the full village with the totem properly set and its dancers. Your program does not have to check the correctness of the input string (e.g. it won't contain both sun and clouds). It must matches words (in the literal sense):
- The input string
X says: "I like the wind, it blows the worries away"
matches wind, because the comma is not part of the word - The input string
Y says: "I hope the weather won't get too windy"
does not match wind, because windy and wind are two different words
The word(s) to match are guaranteed to be in the quoted part of the input string (the first part designating who is talking will never contain a word that could be matched).
Examples
The squaw says: "I want sun and wind for drying the clothes"
__
___|()|___
\/ \ / \/
/\ ``| |`` /\
/^^\ |~~| /^^\
/ /\ \ T | | Y / /\ \
''''''''''''''''''''''''''''
The warrior thinks: "A good thunderstorm will afraid the invaders. Or a snow storm. Or an impenetrable fog. Or an oppressive sun."
__
___|()|___
\/ \::::::::/ \/
/\ ``|zz|`` /\
/^^\ | | /^^\
/ /\ \ TK |==| XY / /\ \
''''''''''''''''''''''''''''
The papoose shouts: "I WANNA GO OUTSIDE PLAY UNDER THE SUN!"
__
___|()|___
\/ \ / \/
/\ ``| |`` /\
/^^\ | | /^^\
/ /\ \ T | | / /\ \
''''''''''''''''''''''''''''
The wise grandma whispers: "The totem is an illusion"
__
___| |___
\/ \ / \/
/\ ``| |`` /\
/^^\ | | /^^\
/ /\ \ | | / /\ \
''''''''''''''''''''''''''''
The shaman confides: "I perform my magic hidden in the fog, under the rain or at least under heavy clouds"
__
___|ww|___
\/ \""""""""/ \/
/\ ``| |`` /\
/^^\ | | /^^\
/ /\ \ TK |==| Y / /\ \
''''''''''''''''''''''''''''
The village chief claims: "The meat of bison is better preserved in the snow, or dried under a burning sun. My Pa' used to say that heavy wind and a thunderstorm could help too, but I have no clue how. And despite everyone contradicting me, I am persuaded a good fog will do as well"
__
___|()|___
\/ \::::::::/ \/
/\ ``|zz|`` /\
/^^\ |~~| /^^\
/ /\ \ TK |==| XY / /\ \
''''''''''''''''''''''''''''
This is code-golf so the shortest answer in bytes win. Explanations are encouraged.
sun
andclouds
, or bothrain
andsnow
? \$\endgroup\$The papoose shouts: "I WANNA GO OUTSIDE PLAY UNDER THE SUN!"
. Also this challenge was a lot less painful and a lot more fun than I thought it would be so thanks for the challenge :P :) \$\endgroup\$