有一个苏城村。它有一个图腾:
__
___| |___
\/ \ / \/
/\ ``| |`` /\
/^^\ | | /^^\
/ /\ \ | | / /\ \
''''''''''''''''''''''''''''
图腾让苏族人可以掌握天气情况,以帮助他们完成不同的任务。帮助村民适当地装饰图腾,以获取充足的天气。图腾包含以下几个部分:
__
___|AA|___
\/ \BBBBBBBB/ \/
/\ ``|CC|`` /\
/^^\ |DD| /^^\
/ /\ \ 13 |EE| 42 / /\ \
''''''''''''''''''''''''''''
A
适用于太阳()
或云ww
B
用于下雨""""""""
或下雪::::::::
C
是雷雨zz
D
为风~~
E
用于雾==
但这还不是全部。图腾需要气象舞蹈演员。调用的元素越多,所需的舞者数量越多。如果调用了一个元素,则需要一个舞者。两个元素,两个舞者。除了四个元素之外,最多还会有四个舞者。如果没有调用任何元素,则不需要舞者。图腾需要休息。
天气舞者必须按顺序出现1234
。例如,如果有两个舞者,槽1
和2
必须被占用。而且,每个舞者都表现出不同的身材:
1
是T
2
是Y
3
是K
4
是X
现在,村民们将表达他们的天气愿望。他们将说出一个句子,其中包含他们想要的天气元素。设置图腾和舞者以实现他们的愿望。
挑战
编写一个程序,该程序将字符串作为输入,匹配句子中的元素(sun,rain,…),并输出图腾及其设置正确的舞者的整个村庄。您的程序不必检查输入字符串的正确性(例如,它不会同时包含sun和cloud)。它必须与单词匹配(按字面意义):
- 输入字符串
X says: "I like the wind, it blows the worries away"
匹配wind,因为逗号不是单词的一部分 - 输入的字符串
Y says: "I hope the weather won't get too windy"
与wind不匹配,因为windy和wind是两个不同的词
确保匹配的单词在输入字符串的带引号的部分中(第一部分指定正在讲话的人永远不会包含可以匹配的单词)。
例子
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 / /\ \
''''''''''''''''''''''''''''
这是代码高尔夫球,因此最短的答案以字节为单位。鼓励解释。
@HyperNeutrino这已在挑战中指定。
—
吉姆(Jim)
啊。我已经做了很多次了(错过了部分挑战)。抱歉:P
—
HyperNeutrino
大声笑+1
—
HyperNeutrino
The papoose shouts: "I WANNA GO OUTSIDE PLAY UNDER THE SUN!"
。同样,这个挑战比我想象的要少很多痛苦,也很多乐趣,所以非常感谢挑战:P :)
我想念像这样的挑战。不太难,也不是FGITW,也不是打高尔夫球的语言,实际上要求您编码而不是找一个小的4乘
—
Uriel
sun
和clouds
,或两者rain
并snow
?