11

# 介绍

Eeny，meeny，miny，moe，

# 要求

• 始终从第一个孩子开始。
• 显示的单词不带标点。
• 最后的“萌”应该强调为“萌！”。包括标点符号。

# 例

## 输入值

``````3
``````

## 输出量

``````Eeny moe tiger toe hollers go miny
meeny Catch by If let Eeny MOE!
miny a the he him meeny
``````

## 输入值

``````7
``````

## 输出量

``````Eeny by him
meeny the go
miny toe Eeny
moe If meeny
Catch he miny
a hollers MOE!
tiger let
``````

## 输入值

``````1
``````

## 输出量

``````Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!
``````

## 输入值

``````21
``````

## 输出量

``````Eeny
meeny
miny
moe
Catch
a
tiger
by
the
toe
If
he
hollers
let
him
go
Eeny
meeny
miny
MOE!
``````

1

7

OldBunny2800'1

4

1
Ashwin Gupta

1

DanTheMan

5

# TeaScript，82个字节

``````D`\${a="Ey Ú9y ·ny "}¶e C® a g by e e If  Ò@s ¤t m go \${a}MOE!`q.KαtΣj═)j╝
``````

## 说明

``````              // Implicit: x = input
D`...blah...` // Decompress "Eeny miny moe..."
q             // Split
Kα            // chunk into x-size blocks (α == x)
t             // Transpose
Σ             // Loop through lines
j═)             // Join with spaces
j╝            // Join with newline
``````

`α`没有得到链接`.`，所以我不得不bug修复这个

``````D`\${a="Ey Ú9y ·ny "}¶e C® a g by e e If  Ò@s ¤t m go \${a}MOE!`qKαtΣj═)j╝
``````

6

# Pyth，103 89 84个字符

``````VQjd%Q>cs[J."@y)òÎ5O¹c×Ú"."@yæ\J}ÇZH66¥ÓÀD¸¶=ðÉ §J%ÔþÖúÅ="J"MOE!")\@N
``````

### 这个怎么运作

``````VQjd%Q>cs[J."..."."..."J"MOE!")\@N    Implicit: Q = eval(input)
VQ                                    For each item N in range 0...int(Q):
[                    )        Create an array out of the following:
J."..."                       Set J to this string, decompressed. ("Eeny@meeny@miny@")
."..."                 This string, decompressed. ("moe@Catch@...let@him@go@")
J                J.
"MOE!"          "MOE!".
s                              Join the array with the empty string.
c                       \@      Split the result on "@".
>                          N     Cut off the first N items.
%Q                                 Take every Qth item.
jd                                   Join with spaces.
``````

@Dennis谢谢，`."`节省了14个字节！
ETHproductions 2016年

Pyth是否使用UTF-8或其他？这是89个字符，但123个字节

@DoᴡɴɢᴏᴀᴛPyth默认情况下使用ISO 8859-1，因此每个字符正好是一个字节。

`FNQ`== `VQ`，顺便说一句。
isaacg

5

# 果冻，84个字节

``````“£Dṡ“Ṙ©“Ė“¡Ḳ⁵“=U“¡Ẹ⁵“¡Ṇm“ȯf“ŀQ“ÞṖċ¥“ṅ_“Ẉ1“¡æḷ“¡ƒmxĠ“¡ṇƭEỤr“¡Þ¦»ṫ-2;;“MOE!”W¤sƓZj€⁶j⁷
``````

4

5

# JavaScript（ES6），167字节

``````l=Array(n=+prompt()).fill``;`\${s=`Eeny meeny miny `}moe Catch a tiger by the toe If he hollers let him go \${s}MOE!`.split` `.map((w,i)=>l[i%n]+=w+` `);alert(l.join`
`)``````

## 说明

``````l=Array(              // l = array of lines
n=+prompt()         // n = input number
).fill``;             // initialise l as empty strings

`\${s=`Eeny meeny miny `}moe Catch a tiger by the toe If he hollers let him go \${s}MOE!`

.split` `.map((w,i)=> // for each word w
l[i%n]+=w+` `       // add it to the lines
);
`)                    // output the lines``````

`l=Array(n).fill`` `由于某种原因不起作用？
ETHproductions 2016年

@ETHproductions有效。我只是忘了缩短它哈哈！谢谢。
user81655 '16

@ user81655我爱JS hint（）窗口。他们真有趣。（我知道这听起来很疯狂，但与其他每种语言的console.out或等效的打印类型表达相比，我的意思是）
Ashwin Gupta，

4

``````import Data.Lists
unlines.map unwords.transpose.(`chunksOf`(["moe Catch a tiger by the toe If he hollers let him go","MOE!"]>>=words.("Eeny meeny miny "++)))
``````

@Mauris通过剔除公共子字符串“ Eeny meeny miny”并使其`f`无指向，发现了3个字节。

@毛里斯：我尝试过，但是时间更长。
nimi

@毛里斯：...哦，不，它的长度是一样的。
nimi

Lynn

@毛里斯：很好。一旦`f`完全没有意义，我们甚至可以省略名称。
nimi

4

# Python 2中，154个 147字节

``````i=input()
s='Eeny meeny miny '
for j in range(i):print' '.join((s+'moe Catch a tiger by the toe If he hollers let him go '+s+'MOE!').split()[j::i])
``````

Ashwin Gupta，

3

## Ruby，160个字节

``puts (a=[*%w[Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!].each_slice(gets.to_i)])[0].zip(*a[1..-1]).map{|x|x*' '}``

``````puts                      # output to STDOUT...
(a=                       # assign this stuff to the variable a
[*                       # convert to array...
%w[blah blah]           # %w splits on spaces
.each_slice(gets.to_i)  # split into slices of input number
]
)[0]                      # take the first element of a
.zip(*a[1..-1])           # zip it with the remaining elements
#   because transpose complains about ragged 2D arrays
.map{|x|x*' '}            # join all sub-arrays on space
#   puts automatically inserts newlines for us``````

3

# JavaScript（ES6），189字节：

``````a=prompt(),b=Array(a--).fill``,c=0;"Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!".split` `.map(v=>(b[c]+=v+' ',c+=c>a-1?-c:1));alert(b.join`\n`)
``````

# 说明：

``````a=prompt(), //Get the STDIN
b=Array(a--).fill``, //Make an array based on how many kids there are
c=0; //Start the iteration variable
"Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!"
.split` `.map(
v=>(
b[c] += v + ' ',
c += c > a - 1 ? -c : 1
)
``````

Ismael Miguel

Ismael Miguel

@IsmaelMiguel的问题问的输入和输出，通过进行具体`STDIN``STDOUT`，所以我认为它限制了JavaScript的答案`prompt``alert`不幸。
user81655 2016年

@ user81655您是正确的。它应该`alert(b.join`<newline>`)`在结尾。但是仍然可以用`.map()`代替减少伤害`.forEach()`
Ismael Miguel

3

## Python 3中，279个278 272 173字节

（感谢Mathias Ettinger确实为我节省了100多个BYTES！

``````s=" Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny moe!";w=s.split();i=input();i=int(i)
for z in range(i):W=w[z::i];print(" ".join(W))
``````

Hand-E-Food

@ Hand-E-Food好的，我相信它现在可以按照您指定的方式运行！
Ashwin Gupta

Hand-E-Food

@ Hand-E-Food好的，谢谢！我想我知道你在做什么。我明天要解决这个问题。我想我可以至少剃掉几个字节。
Ashwin Gupta

301_Moved_Permanently

2

# Mathematica，154个字节

``````StringRiffle[Thread@Partition[StringSplit@"Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!",#,#,1,""],"
"," "]&
``````

2

# MATLAB，167个字节/字符：

``````n=input('');s='Eeny meeny miny ';s=strsplit([s 'moe Catch a tiger by the toe If he hollers let him go ' s 'MOE!']);f=@fprintf;for i=1:n f('%s ',s{i:n:end});f('\n');end
``````

# 说明：

``````n=input('');             % Grab the input (number of children)
s='Eeny meeny miny ';    % Common string portion
% Build the full string and split into cell array at spaces
s=strsplit([s 'moe Catch a tiger by the toe If he hollers let him go ' s 'MOE!']);
f=@fprintf;              % Just a shorthand for later (only saves 1 char here)
for i=1:n                % Loop to the number of children
f('%s ',s{i:n:end}); % Print each nth word, shifted by child
f('\n');             % Start each child's words on a new line
end
``````

2

# Japt，90 87 86字节

``````Uo mW{V=`EydÚ9yd·nyd` +`¶C®»dgdbydÈIfddÒ@sd¤tdmdgod{V}MOE!` qd f@Y%U¥W} m¸·
``````

### 这个怎么运作

``````              // Implicit: U = input
Uo mW{     }  // Create the range 0...U and map each item W to:
V=`...`       //  Set V to this string, decompressed. "Eenydmeenydmined"
+`...{V}MOE!` //  Concatenate it with this string, decompressed, with V inserted.
qd            //  Split at "d"s.
f@Y%U¥W       //  Filter to only the items where (index % U == W).
m¸            // Map each item by joining with spaces.
·             // Join the result with newlines.
``````

``````space -> 69 bytes
c -> 66 (including a null byte)
d -> 65
j -> 69
k -> 69
p -> 68
q -> 69
s -> 61 (but there's an s in "hollers")
u -> 65
w -> 67
x -> 69
y -> 69
``````