text:
All your base palindromic belong to us
Generate the sequence number of bases in which n is a palindrome (OEIS A126071).
Specifically, the sequence is defined as follows: given a number n, express it in base a for a = 1,2, ..., n, and count how many of those expressions are palindromic. "Palindromic" is understood in terms of reversing the base-a digits of the expression as atomic units (thanks, @Martin Büttner). As an example, consider n = 5:

a=1: the expression is 11111: palindromic
a=2: the expression is 101: palindromic
a=3: the expression is 12: not palindromic
a=4: the expression is 11: palindromic
a=5: the expression is 10: not palindromic

Therefore the result for n=5 is 3. Note that OEIS uses bases 2, ..., n+1 instead of 1, ..., n (thanks, @beaker). It's equivalent, because the expressions in base 1 and n+1 are always palindromic.
The first values of the sequence are
 1, 1, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 4, 4, 4, 2, 4, 5, ...

Input is a positive integer n. Output is the first n terms of the sequence.
The program should theoretically work (given enough time and memory) for any n up to limitations caused by your default data type in any internal computations.
All functions allowed. Lowest number of bytes wins.

Related

If it's helpful to anyone, it's worth noting that a number n is also always palindromic in base n-1.

This is A126071

Pyth, 13 bytes
mlf_ITjLdSdSQ

The brevity of this is mostly due to the Invaluable "Invariant" command.
msf_ITjLdSdSQ       implicit: Q=input
m         d         map lambda d over
           SQ       Inclusive range 1 to Q
      jLdSd         Convert d to all the bases between 1 and d
  f                  filter lambda T:
   _IT                 is invariant under reverse
 l                  number that are invariant under reverse

If True is an acceptable output for 1, msm_IjdkSdSQ (12 bytes) works.
Try it here.

See FryAmTheEggman's suggestion to use _I# rather than f_IT (I'm not 100% sure it was available, but it seems to have been).

Jelly, 12 bytes
bRµ=UP€S
RÇ€

Try it online!
An old 14-byte version  (The Jelly interpreter had a bug that made converting to unary impossible)
bR‘$µ=UP€S
RÇ€

Try it online!
How it works
bR‘$µ=UP€S  Helper link. Argument: z

 R‘$        Apply range and increment, i.e., map z to [2, ..., z + 1].
            In the non-competing version R simply maps z to [1, ... z].
b           Convert z to each of the bases to the right.
    µ       Begin a new, monadic chain. Argument: base conversions
     =U     Compare the digits of each base with the reversed digits.
            = has depth 0, so [1,2,3]=[1,3,3] yields [1,0,1].
       P€   Take the product of the innermost arrays.
         S  Sum all resulting Booleans.

RÇ€         Main link. Argument: n

R           Yield [1, ..., n].
 Ç€         Apply the helper link to each.

MATL, 19 20 bytes
:"0@XK:Q"K@:YAtP=A+

Uses current release (10.1.0), which is earlier than this
challenge.
Try it online!
Explanation
:            % vector [1,2,...,N], where "N" is implicit input
"            % for each number in that vector
  0          % push 0
  @          % push number 1,2,...N corresponding to current iteration, say "n"
  XK         % copy n to clipboard
  :Q         % vector [2,3,...,n+1]
  "          % for each number "m" in that vector
    K        % push n
    @:       % vector [1,2,...,m]
    YA       % express n in base m with symbols 1,2,...,m
    tP       % duplicate and permute
    =A       % 1 if all entries are equal (palindrome), 0 otherwise
    +        % add that number
             % implicitly close the two loops and display stack contents

CJam, 20 bytes
ri{)_,f{)b_W%=}1bp}/

Test it here.

ES6, 149 bytes
n=>[...Array(n)].map((_,i)=>[...Array(i)].reduce((c,_,j)=>c+(''+(a=q(i+1,j+2,[]))==''+a.reverse()),1),q=(n,b,d)=>n 36 too.

Python 2, 97 bytes
c=1;n=int(input())
for b in range(2,n):
	a=[];z=n
	while z:a+=[z%b];z//=b
	c+=a[::-1]==a
print c

My first Python post, actually my first Python code at all
probably has some golfing potential.
Try it online!

JavaScript (ES6), 105 95 bytes
f=(n,b)=>b?b<2?1:f(n,b-1)+([...s=n.toString(b)].reverse().join``==s):n<2?[1]:[...f(n-1),f(n,n)]

Explanation
Takes a number from 1 to 36 (the limitation of base conversion in JavaScript) and returns an array of the sequence.
Recursive function that checks for palindromes when a base is passed, else returns the sequence if just n is passed.
f=(n,b)=>

  // Base palindrome checking
  b?
    b<3?1:                 // return 1 for base-1, since toString(2)
    f(n,b-1)+(             // return the sum of all lower bases and check  this
      [...s=n.toString(b)] // s = n in base b
      .reverse().join``==s // add 1 if it is a palindrome
    )

  // Sequence generation
  :
    n<2?[1]:               // return 1 for the first value of the sequence
    [...f(n-1),f(n,n)]     // return the value for n after the previous values

Test

var solution = f=(n,b)=>b?b<2?1:f(n,b-1)+([...s=n.toString(b)].reverse().join``==s):n<2?[1]:[...f(n-1),f(n,n)]
<input type="number" oninput="result.textContent=solution(+this.value)" />

Is there a way to turn that into a recursive function? I feel like that could save some bytes.

@ՊՓԼՃՐՊՃՈԲՍԼ You're right. Thanks for the tip.

Haskell, 88 bytes
a!b|a0=mod a b:(div a b)!b
f n=[1+sum[1|x<-[2..y],y!x==reverse(y!x)]|y<-[1..n]]

PHP, 73+1 bytes
while(++$i<$argn)$c+=strrev($n=base_convert($argn,10,$i+1))==$n;echo$c+1;

works for bases 1 to 36. Run as pipe with -nR or try it online.

PHP, 92+1 bytes:
for($b=$c=1;$b++<$n=$argn;$c+=$a==array_reverse($a))for($a=[];~~$n;$n/=$b)$a[]=$n%$b;echo$c;

works for all bases. Run as pipe with -nR or try it online.

Jelly, 8 bytes
bRfU$Lµ€

Try it online!
Alternatively:
bRŒḂ€Sµ€

Try it online!

><>, 197+2 Bytes
+2 for -v flag
:1+0v    ;n\
1\  \$:@2(?/
:<~$/?)}:{:*}}@:{{
\   \~0${:}
>$:@1(?\::4[:&r&r]:$&@@&%:&@&$@-$,5[1+{]$~{{:@}}$@,$
~~1 \  \
?\~0>$:@2(?\$1-:@3+[}]4[}1-]=
 \  /@@r/!?/
r@+1/)0:<
  /?/$-1$~<
~$/       \-1

tio.run doesn't seem to return any output for n>1, but you can verify it on https://fishlanguage.com. Input goes in the "Initial stack" box.

Japt, 10 bytes
õ_õ!ìZ èêS

Try it

Explanation
õ              :Range [1,input]
 _             :Map each Z
  õ            :  Range [1,Z] (let's call each X)
   !ìZ         :   Convert Z to a base X digit array
       è       :  Count
        êS     :   Palindromes

õ_õ hahaha nice emoji

Python 2, 85 bytes
def f(a):b,c=2,0;exec'd,m=[],a\nwhile m:d+=[m%b];m/=b\nc+=d[::-1]==d;b+=1;'*a;print c

Try it online!
Expects an integer as an argument.
Explanation:
# named function
def f(a):
    # initialize variable to track base (b) and to track palindromes (c)
    b,c=2,0
        # construct code
        '
        # initialize variable to store remainders (m) and to track divisor (d)
        m,d=[],a
        # while d is not zero,
        # add the current remainder to the array
        # and divide d by the base and assign the result back to d
        while d:m+=[m%b];d/=b
        # False == 0 and True == 1, so add 1 to total if m == reversed(m)
        c+=m[::-1]==m;
        # increment base
        # terminate with ; so that next statement can be executed separately
        b+=1;
        '
    # execute constructed statement (a) times
    exec'....................................................'*a
    # print result
    print c

Husk, 13 bytes
mλṁoS=↔`B¹ḣ)ḣ

Try it online!
not sure if I can avoid using a lambda here.

JavaScript (Node.js), 80 bytes
n=>(h=(a,g=n=>n?[n%a,...g(n/a|0)]:[])=>--a<2||(g(n).reverse()+''==g(n))+h(a))(n)

Try it online!
Add 1 at last manually

Perl 5 -Minteger -pa, 81 bytes
map{@n=($t="@F")%$_;push@n,$t%$_ while$t/=$_;$\+="@n"eq"@{[reverse@n]}"}2..$_+1}{

Try it online!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Is it a valid consonant cluster in Lojban?
.i xu .e'o lo zunsnagri cu drani loka jboge'a

Given an input of a string consisting of two characters, output whether it is a
valid consonant cluster in Lojban.
Here is a quote from CLL 3.6 detailing the
rules for a valid consonant cluster pair (or rather, an invalid one):
1) It is forbidden for both consonants to be the same, as this would
   violate the rule against double consonants.

2) It is forbidden for one consonant to be voiced and the other unvoiced.
   The consonants “l”, “m”, “n”, and “r” are exempt from this restriction.
   As a result, “bf” is forbidden, and so is “sd”, but both “fl” and “vl”,
   and both “ls” and “lz”, are permitted.

3) It is forbidden for both consonants to be drawn from the set “c”, “j”,
   “s”, “z”.

4) The specific pairs “cx”, “kx”, “xc”, “xk”, and “mz” are forbidden.

The quote references "voiced" and "unvoiced" consonants. Here is a table of the
unvoiced consonants and their voiced counterparts (also from CLL 3.6):
UNVOICED    VOICED
   p          b
   t          d
   k          g
   f          v
   c          j
   s          z
   x          -

Note that {x} has no voiced counterpart. For completeness, the remaining
consonants that are not on this list (which can be either voiced or unvoiced
for the purposes of the quote) are lmnr. (y is a vowel, and the letters
hqw are not used.)
The input must be a single string, but you may assume that it will always
consist of exactly two consonants, with optional trailing newline if you wish.
The output may be any truthy or falsy
value.
This is code-golf, so the shortest code in bytes wins.
Test cases (these are all possible input strings placed in the proper
categories):
Valid consonant clusters:
 bd bg bj bl bm bn br bv bz cf ck cl cm cn cp cr ct db dg dj dl dm dn dr dv
 dz fc fk fl fm fn fp fr fs ft fx gb gd gj gl gm gn gr gv gz jb jd jg jl jm
 jn jr jv kc kf kl km kn kp kr ks kt lb lc ld lf lg lj lk lm ln lp lr ls lt
 lv lx lz mb mc md mf mg mj mk ml mn mp mr ms mt mv mx nb nc nd nf ng nj nk
 nl nm np nr ns nt nv nx nz pc pf pk pl pm pn pr ps pt px rb rc rd rf rg rj
 rk rl rm rn rp rs rt rv rx rz sf sk sl sm sn sp sr st sx tc tf tk tl tm tn
 tp tr ts tx vb vd vg vj vl vm vn vr vz xf xl xm xn xp xr xs xt zb zd zg zl
 zm zn zr zv

Invalid consonant clusters:
 bb bc bf bk bp bs bt bx cb cc cd cg cj cs cv cx cz dc dd df dk dp ds dt dx
 fb fd ff fg fj fv fz gc gf gg gk gp gs gt gx jc jf jj jk jp js jt jx jz kb
 kd kg kj kk kv kx kz ll mm mz nn pb pd pg pj pp pv pz rr sb sc sd sg sj ss
 sv sz tb td tg tj tt tv tz vc vf vk vp vs vt vv vx xb xc xd xg xj xk xv xx
 xz zc zf zj zk zp zs zt zx zz

Doorknob, this is very close to http://codegolf.stackexchange.com/q/66053/15599 I think about half my code might be reusable.

@steveverrill Right, I found that question, and I thought this would be sufficiently different given that you only get two characters as input and you don't have to handle vowels and such.

@steveverrill ... but now I'm reconsidering, after taking a closer look at the answers. Do you think it would be better if I just left out the initial consonant pair part, and made the challenge simply "is this a valid consonant pair"?

I think that would both increase the difference between the challenges and simplify this one, both of which would be a good thing.

@steveverrill Yeah, I agree now. Thanks!

What's "kangri"?

@ThomasKwa It's a lujvo of kansa girzu ("accompany-group"), my attempt at a rough translation of "cluster."

It looks like zunsnagri is the term used for that.

@Mauris Ah, thanks! (In fact, zunsnagri is simply zunsna kangri, the nonce-term that I made up, with the kansa bit removed.) Someone should get that added to vlasisku.

Pyth, 53 48 47 bytes
!}z+"mz"s.pMs[+VGGc"xcxkcsjz"2*"ptkfcsx""bdgvjz

This generates a list of all invalid pairs based on the rules above, then checks if the input is one of them.
! }                        A not in B
    z                      input
    +
      "mz"                  "mz"
      s                    flattened
        .pM                permutations of each:
            s [               flatten the three-element array:
                +V              Alphabet vectorized concat with itself.
                   G            That is, duplicate letters
                   G
                c"xcxkcsjz"2     That string chopped every 2
                *               outer product of
                  "ptkfcsx"      voiced letters
                  "bdgvjz        and unvoiced letters

Try it here.

Retina, 59 57 54 53 52 bytes
(.)\1|[cjsz]{2}|mz

T`fb-jz`svkv
kx|xk|^v?[kpstx]v?

The trailing linefeed is significant. For valid clusters, this outputs a non-empty string; for invalid ones the output is empty.
Try it online! This tests all clusters at once (removing all the invalid ones and leaving all the valid ones intact). To make that possible I've had to replace the ^ anchor with a \b word boundary.
Another solution for the same byte count:
(.)\1|[cjsz]{2}|mz

T`fk-dbz`scv
cx|xc|^v?[cpstx]v?

Explanation
The goal is to remove all invalid pairs completely. We can do with the valid pairs whatever we want as long as at least one character remains.
(.)\1|[cjsz]{2}|mz

This takes care of three rules: (.)\1 matches any pair violating rule 1. [cjsz]{2} matches any pair violating 3. mz matches the specifically disallowed pair from rule 4.
That leaves only rule two and the other specific pairs xk, kx, xc and cx. We can save a bunch of bytes by doing some preprocessing so we have to handle fewer cases:
T`fb-jz`svkv

The idea is to collapse all voiced consonants into one, as well k and c. I'm also turning f into s out of necessity. This is a transliteration stage which will substitute individual characters for other characters. To see the actual mapping we need to expand the range and remember that the last character of the target list is repeated indefinitely:
fbcdefghijz
svkvvvvvvvv

The initial f => s is necessary, because it overrides the later f => v which would turn f into a voiced consonant. We also see that c is turned into k. And all the voiced consontants bdgjz are turned into v. That leaves ehi... luckily these are either vowels or unused in Lojban. The same could also have been achieved with
T`fcb-jz`skv

Alternatively, check out the other solution I posted above that uses a very different transliteration (with a reverse range, and it also turns k into c instead).
Now the remaining invalid combinations can be checked much more easily:
kx|xk|^v?[kpstx]v?

cx and cx have become kx and xk so we only need to check two cases now. For rule 2, we try to match the entire pair, starting from the beginning with an optional voiced consonant (reduced to v), a mandatory unvoiced consonant (where we don't need to check for f and c separately) and another optional voiced consonant. If the pair is a mix of voiced and unvoiced one of the two optional vs will match and the entire pair is removed. Otherwise, this can only match if the pair starts with a voiced consonant (and has anything else second) - in that case only the first character will be removed, and the other one will remain, still giving a truthy result.

TypeScript Compiler,  427 417 bytes
type U="p"|"t"|"k"|"f"|"c"|"s"|"x"
type V="b"|"d"|"g"|"v"|"j"|"z"
type S="c"|"s"|"j"|"z"
type G<T,W>=T extends W?0:T extends"l"|"r"|"m"|"n"?1:T extends U?W extends V?0:1:W extends U?0:1
type H<T,W>=T extends"x"?W extends"k"|"c"?0:G<T,W>:T extends"k"|"c"?W extends"x"?0:G<T,W>:T extends"m"?W extends"z"?0:G<T,W>:G<T,W>
type L<T>=T extends`${infer A}${infer B}`?A extends S?B extends S?0:H<A,B>:H<A,B>:0
let y:L<"bd">=1

Playground link
If you replace the bd on the last line with an illegal pair of consonants, the code will not compile. I may well have missed some optimizations, but I'm just content with the fact that the `${infer A}${infer B}` works as intended. Interestingly, any single character is considered valid.

Pip, 49 bytes
$Qa|`[ptkfcsx][bdgvjz]|[ck]x`NPZa|a~=`[cjsz]+|mz`

Outputs with the truthy and falsey values switched (i.e. truthy if the consonant cluster is not valid, falsey if it is valid). If that's not considered acceptable for this challenge because it predates the linked consensus, then tack !: on the front for +2 bytes.
Verify all test cases: Try it online!
Explanation
The input a is an invalid cluster if...
$Qa |

... its two characters are string-equal; or...
`[ptkfcsx][bdgvjz]|[ck]x` N PZa |

... the input PalindromiZed (e.g. xc -> xcx) contains an unvoiced consonant [ptkfcsx] followed by a voiced consonant [bdgvjz] or one of [ck] followed by x; or...
a~=`[cjsz]+|mz`

... the input consists entirely of one or more (in this case, two) characters from the set [cjsz], or consists entirely of the sequence mz.

Lexurgy, 128 bytes
Class U {p,t,k,f,c,s,x}
Class V {b,d,g,v,j,z}
Class J {c,j,s,z}
R:
{{@U,@V,l,m,n,r}$1 $1,@V @U,@U @V,@J @J,{cx,kx,xc,xk,mz}}=>*

Replaces invalid clusters with an empty string.
Ungolfed
Class U {p,t,k,f,c,s,x}
Class V {b,d,g,v,j,z}
Class C {@U,@V,l,m,n,r}
Class J {c,j,s,z}

replace:
@C$1 $1 => * # no dups
@V @U => * # no UV/VU pairs
@U @V => *
@J @J => * # no both cjsz
{cx,kx,xc,xk,mz} => * # specific pairs

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Code (Mini) Golf
Given a side-view of a mini-golf course and the power of the swing, determine if the ball will make it into the hole.

A course will be in this format:
      ____       ____ _
   __/    \     /    U \
__/        \   /        \_
            \_/

The ball starts directly before the first piece of ground on the left and follows the contour of the course until it reaches the hole (an upper-case U below the current level of the ground). If it reaches the hole, output a truthy value. The power of the swing will be the initial speed of the ball. The ball moves to the next character on the right at each iteration, then the speed is altered depending on the character it is now on. If the speed reaches 0 or less before the hole, output a falsey value.

_ decreases the speed by 1
/ decreases the speed by 5
\ increases the speed by 4

Courses can optionally be padded with spaces. The power of the swing will always be a positive integer.
You do not need to worry about the ball going too fast to enter the hole, rolling backwards or jumping/bouncing off hills.
Test Cases
Input: 27
      ____       ____ _
   __/    \     /    U \
__/        \   /        \_
            \_/
Output: true

----------

Input: 26
      ____       ____ _
   __/    \     /    U \
__/        \   /        \_
            \_/
Output: false

----------

Input: 1

U
Output: true

----------

Input: 1
_
 U
Output: false

----------

Input: 22

     /U
    /
   /
  /
\/
Output: true

----------

Input: 999
_       _
 \     /
  \   /
   \ /
    U
Output: true

----------

Input: 5
  /
/U
Output: false

----------

Input: 9

/\/\/\/\/U
Output: false

----------

Input: 16

_/\                                         _
   \      __       /\/\/\                  /
    \    /  \     /      \                /
     \__/    \   /        \____________ _/
              \_/                      U

Output: true

This is code mini-golf, shortest answer in bytes wins!

If your language has good array built-ins, then you can turn the input into a stream of operations (\_/) with the following steps: split into array of lines, rotate, flatten, strip spaces.

This is really more of a fixed-track mechanism than a golf course :P

I like that \/\/\/\/\/ is a more efficient course than __________.

That's what I was thinking, 4 down, 5 up, then .5 must be average. Oh, flat is 1?

Will each line in a course always be the same length (with trailing spaces filling in the end of shorter lines)?

@SnoringFrog If you want it to. That's what it means by "Courses can optionally be padded with spaces".

Cool. Wasn't sure if that meant "you can if you want" or "they may or may not come like that so code for both"

Pyth, 27 bytes
.Am<sXsd"_\ /"[1_4Z5)Q._C.z

Demonstration
This code does something very clever and not at all type-safe with X. Check it out below.
Explanation:
.Am<sXsd"_\ /"[1_4Z5)Q._C.z
                               Implicit: Z = 0, Q = eval(input())
                               Q is the initial power.
                         .z    Take all input, as a list of lines.
                        C      Transpose, giving all columns.
                      ._       Form all prefixes.
  m                            Map over the prefixes.
      sd                       Concatenate the prefix.
     X  "_\ /"[1_4Z5)          Change '_' to 1, '\' to -4, ' ' to 0, and '/' to 5.
                               In particular, 'U' is left unchanged.
    s                          Reduce on addition.
                               If all elements were numbers,
                               this results in the total change in power.
                               If there was a 'U', it results in a string.
   <                 Q         If the previous result was a number, this compares
                               it with the initial input to see if the ball is
                               still rolling.
                               If the previous result was a string, this slices off
                               the first Q characters, which always has a truthy
                               result.
.A                             Test whether all of the prefixes mapped to a thruthy
                               result.

I might be missing something, but does it stop at Q? Ie the last example could cause some issues?

@flindeberg That's not how it works. The < ... Q works as a numeric comparison up until the hole, not a slice. After the hole, all that matters is that the result is truthy.

Haskell, 111 109 bytes
import Data.List
g"_"=1
g"/"=5
g _= -4
f n=all(>0).scanl(-)n.map g.fst.span(/="U").(>>=words).transpose.lines

Usage example:
*Main> f 27 "      ____       ____ _   \n   __/    \\     /    U \\  \n__/        \\   /        \\_\n            \\_/           "
True
*Main> f 26 "      ____       ____ _   \n   __/    \\     /    U \\  \n__/        \\   /        \\_\n            \\_/           "
False

How it works:
                            lines  -- split into list of lines at nl
                       transpose   -- transpose
                  (>>=words)       -- turn each line into words (i.e. remove spaces)
            fst.span(/="U")        -- take all words up to but excluding "U"
         map g                     -- turn each word into the speed modifier
    scanl(-)n                      -- build list of partial sums starting with n
                                   --   note: speed modifiers are negative so we
                                   --   use (-) with scanl to build sums
all(>0)                            -- return true if all sums are greater than 0

Edit: @user81655 found 2 bytes to save. Thanks!

Ruby, 104 87 characters
->s,t{t.lines.map(&:bytes).transpose.map{|o|(c=o.max)==85||s<0?break: s+=c*3%14-6}
s>0}

Sample run:
2.1.5 :001 > track = '      ____       ____ _
2.1.5 :002'>    __/    \     /    U \
2.1.5 :003'> __/        \   /        \_
2.1.5 :004'>             \_/
2.1.5 :005'> '
 => "      ____       ____ _   \n   __/    \\     /    U \\  \n__/        \\   /        \\_\n            \\_/           \n"

2.1.5 :006 > ->s,t{t.lines.map(&:bytes).transpose.map{|o|(c=o.max)==85||s<0?break: s+=c*3%14-6};s>0}[27, track]
 => true

2.1.5 :007 > ->s,t{t.lines.map(&:bytes).transpose.map{|o|(c=o.max)==85||s<0?break: s+=c*3%14-6};s>0}[26, track]
 => false

Japt, 38 bytes
Vz r"%s|U[^]*" ¬e@UµX¥'_?1:X¥'/?5:-4 ¬

Try it here!
Beating CJam!
Explanation
Basically takes the string input, rotates it 90deg clockwise, strips out spaces and newlines, removes the hole and everything after it, and splits along chars. Then checks if ball ever gets to zero or below using the every function.

I think \ should be positive (description looks wrong)

I don't think that works. Picture this: a series of slopes gets the ball's speed to -2, but then there are a net +4 later on. The sum would reflect +2 so the ball made it. In reality, it would never get to the positive section after reaching the negatives.

I think I fixed the problem.

That's a cool button ;)

Nice! So, golfing... The double backslash is replaceable with %, and >0 can be replaced with ¬, since the sqrt of a non-positive number is always falsy (0 -> 0, -1 -> NaN).

Lol why didn't I think of that?

BTW, how is [^] different than .?

[^] also matches line breaks.

CJam, 40 39 bytes
liqN/:.e>'U/0="\_/"[4W-5]er{1$+}/]:e<0>

Input has the power on the first line and the course starting on the second line. Output is 0 or 1.
Test it here.
Explanation
li    e# Read power and convert to integer.
qN/   e# Read course and split into lines.
:.e>  e# Flatten course by folding maximum over columns.
'U/   e# Split around the hole.
0=    e# Keep the first chunk.
"\_/"[4W-5]er
      e# Replace \, _, / with 4, -1, 5, respectively.
{     e# For each of those costs...
  1$+ e#   Copy the previous power and add the cost.
}/    e# This leaves all partial sums on the stack.
]     e# Wrap them in an array.
:e<   e# Find the minimum.
0>    e# Check whether it's positive.

Retina, 82 81 77 74 68 67 68 bytes
+`(?<=(.)*) (?=.*¶(?<-1>.)*(.))
$2
\\
>>>>
+`>_|>{5}/|>¶

^>*U

Try it online

Input is represented in unary base, as n >s - for example, 4 is >>>>\n. (is this legal?)
+`(?<=(.)*) (?=.*¶(?<-1>.)*(.)) $2 - flatten the course - replace spaces with the character below them.
After this stage the data will look like this:
>>>>>>>>>>>>>>>>>>>>>>>>>>
__/__/____\\\_///____U_\\_
__/__/    \\\_///    U \\_
__/        \\_//        \_
            \_/

We can just ignore everything after the first U, we will not reach there anyway.
> represent a step we are allowed to make, or the remaining energy.
Replace each \ with four > - a slope gives us additional energy.
Loop: contentiously remove >_ or >>>>>/ until there are none left. _s and /s consume energy.
Finally, try to match ^>*U - check if we can reach U with positive energy (or no energy).
This will output 0 or 1.

Another close option with 91 79 bytes is:
+`(?<=¶(.)*) (?=.*¶(?<-1>.)*(.))
$2
^(>)+\n(?<-1>_|/(?<-1>){4}|\\(?<1>){5})+U

Try it online
This is the same approach but with a balancing group instead of a contentious replace.
I'm sure both of these can be golfed further, so any one of them may end up shorter.

Yes, unary input is legit (unless the challenge specifies "decimal"), although I'd probably use 0 or 1 as the digit if that doesn't incur any additional bytes.

Also welcome to PPCG, I'm really glad to see you here! :) (And using Retina as well.)

Sure! It was on the hot question list and looked fun. I thought I'd give it a try :-)

Python (3.5) 169 160 bytes
A recursive solution without the transpose function (zip)
def f(c,p):c=c.splitlines();l=len(c);f=lambda x,h,v:v if'U'==c[h][x]or v<1 else f(x+(h==l-1),(h+1)%l,v+{"_":-1,"\\":4,"/":-5," ":0}[c[h][x]]);return f(0,0,p)>0

Ungolfed
c for course, p for power, v for speed, h for height
def f(c,p):
    c=c.splitlines()
    l=len(c)
    tmp = {"_":-1,"\\":4,"/":-5," ":0}
    f=lambda x,h,v:v if'U'==c[h][x]or v<1 else f(x+(h==l-1),(h+1)%l,v+tmp[c[h][x]])
    return f(0,0,p)>0

Usage
f(16,"_/\                                         _\n   \      __       /\/\/\                  / \n    \    /  \     /      \                /  \n     \__/    \   /        \____________ _/   \n              \_/                      U     ")
f(9,"/\/\/\/\/U")

ES6, 117 bytes
(c,p)=>c.split`
`.map(s=>[...s.slice(0,c.match(/^.*U/m)[0].length-1)].map(c=>p+=c=='/'?-5:'    \\'.indexOf(c)))&&p>0

Ungolfed:
function hole(course, power) {
    width = course.match(/^.*U/m)[0].length - 1; // calculate width to hole
    lines = course.split("\n");
    for (i = 0; i < lines.length; i++) {
        line = lines[i].slice(0, width); // ignore extraneous parts of the course
        for (j = 0; j < line.length; j++) {
            switch (line[j]) { // accumulate remaining power
            case '/': power -= 5; break;
            case '\\': power += 4; break;
            case ' ': break;
            default: power--; break;
            }
        }
    }
    return power > 0;
}

Edit: Saved 4 bytes thanks to ՊՓԼՃՐՊՃՈԲՍԼ.

@ՊՓԼՃՐՊՃՈԲՍԼ Thanks, I keep trying to optimise for speed...

JavaScript (ES6), 108 107 106 bytes
This is the solution I came up with when I created the challenge.
(p,c)=>[...(l=c.split`
`)[w=0]].map((_,i)=>l.map(t=>(g=t[i])-1|p<=0?0:p-=g>"]"?1:g>"U"?-4:g>"/"?w=1:5))&&w

Explanation
Takes the power as a number and the course as a string. Returns 1 for true or 0 for false. The course must be padded with spaces.
(p,c)=>
  [...(l=c.split`
`)                          // l = array of lines
  [w=0]]                    // w = true if the ball has entered the hole
.map((_,i)=>                // for each index i
  l.map(t=>                 // for each line t
    (g=t[i])                // g = the character at the current index
    -1|p<=0?0:              // do nothing if g is a space or the ball has no speed left
    p-=
      g>"]"?1               // case _: subtract 1 from p
      :g>"U"?-4             // case \: add 4 to p
      :g>"/"?w=1            // case U: set w to true (it doesn't matter what happens to p)
      :5                    // case /: subtract 5 from p
  )
)
&&w                         // return w

Test

var solution = (p,c)=>[...(l=c.split`
`)[w=0]].map((_,i)=>l.map(t=>(g=t[i])-1|p<=0?0:p-=g>"]"?1:g>"U"?-4:g>"/"?w=1:5))&&w
Power = <input type="number" id="power" value="16" />

<textarea id="course" rows="6" cols="50">_/\                                         _
   \      __       /\/\/\                  /
    \    /  \     /      \                /
     \__/    \   /        \____________ _/
              \_/                      U     </textarea>

<button onclick="result.textContent=solution(+power.value,course.value)">Go</button>

Pyth, 35 bytes
VC.z=-Q@(1_4 5)x"_\\/"JrN6IqJ\U>Q_5

Explanation
                                    - Autoassign Q = eval(input())
                                    - Autoassign .z = rest of input
VC.z                                - For N in zip(*.z)
    =-Q                             - Q -= ...
                      JrN6          - Autoassign J to N.strip() (get rid of spaces)
       @(1_4 5)x"_\\/"              - {"_":1, "\\": -4, "/": 5, "U":5}[J] ("U" isn't defined but that's what it is according to how str.index works)
                          IqJ\U     - If J == "U"
                               >Q_5 - print Q > -5 ()

JavaScript, 266 263 244 bytes
(s,a)=>{var f=(e,x)=>{for(var i=1;D=e[i][x],i<e.length;i++)if(D!=" ")return D},o=a.split(`
`),l=o.reduce((a,b)=>Math.max(a.length||a,b.length)),b="";for(i=0;i<l;i)b+=f(o,i++);for(i=0;b[i]!="U"&&s>0;i++)s-=b[i]=="_"?1:b[i]=="/"?5:-4;return s>0}

Ungolfed
(s,a)=>{
    var f=(e,x)=>{
        for(var i=1;D=e[i][x],i<e.length;i++)
            if(D!=" ")
                return D
    },
    o=a.split(`
`),
    l=o.reduce((a,b)=>Math.max(a.length||a,b.length)),
    b="";
    for(i=0;i<l;)
        b+=f(o,i++);
    for(i=0;b[i]!="U"&&s>0;i++)
        s-=b[i]=="_"?1:b[i]=="/"?5:-4;
    return s>0
}

Usage
var o = (s,a)=>{var f=(e,x)=>{for(var i=1;D=e[i][x],i<e.length;i++)if(D!=" ")return D},o=a.split(`
`),l=o.reduce((a,b)=>Math.max(a.length||a,b.length)),b="";for(i=0;i<l;)b+=f(o,i++);for(i=0;b[i]!="U"&&s>0;i++)s-=b[i]=="_"?1:b[i]=="/"?5:-4;return s>0}

o(27, `
      ____       ____ _
   __/    \\     /    U \\
__/        \\   /        \\_
            \\_/           `); // will return true

My mistake; I thought I had copied in the first example with "27" as the first argument. I corrected this. Thank you.

Octave, 111 110 bytes
function g(v,s) A([95,47,92])=[1,5,-4];all(v>cumsum(A(m=max(cat(1,strsplit(s,'\n'){:}),[],1)))(1:find(m==85)))

Explanation:

Split the input on newlines and convert that annoying cell array to a matrix
Flatten the matrix by finding the max for each column
Map the characters '_/\' to [1, 5, -4] (all other characters less than '_' are mapped to 0)
Calculate the cumulative sum of all elements of the mapped array
Output True if all cumulative sums from the beginning of the course to the cup are less than the start velocity (False otherwise).

Here is a test case that I had already developed similar to the second one proposed by @Erwan and a couple of results:
s9 =
   /\
  /  \
_/    \
       \
        \
         U

g(11,s9) %False
ans = 0
g(17,s9) %True
ans =  1

And here's the first test case:
s10 =
  _
 / U\
/    \
      \
       \
        \
         \
          \_

>> g(11,s10)
ans = 0
>> g(12,s10)
ans =  1

i think if the course is like "//_U\\\\\\\_ the result is incorrect since you don't remove character after U
same things if you have a course with local maximum like _//\\\\\U

@Erwan But I do remove the characters after the U. That's what the (1:find(m==85)) does; it takes subarray from the first index to the location of the U. I'll check your test case with a couple of starting velocities and get back to you.

I couldn't run your solution (i don't have Octave) that why i just ask
... and because i find the issu with local maxima in the other python solution :)
finally your solution work with local maxima since you use cumsum and not just sum (don't see that at the first read)

@Erwan I've added the two test cases that you suggested. Please have a look and see if the results are what you expect. If you're trying this in MATLAB, then you're not going to be able to run it because it uses some indexing that only works in Octave. You would have to assign the result of cumsum to an intermediate variable and then use that for the final comparison all(v>tmp(1:find(m==85))).

Your solution work fine miss lots of things at the first read (just test in Matlab so many intermediate variables to add)

@Erwan Cool, thanks for checking!

Ruby, 85 characters
->i,s{s.lines.map(&:bytes).transpose.any?{|o|(c=o.max)==85||i<0||!(i+=c*3%14-6)};i>0}

Adapted @manatwork's answer

Java, 219 Bytes
boolean p(int v,String c){int z=c.length(),f[]=new int[z],e,i,k;for(String r:c.split("\n"))for(i=-1;++i<r.length();)if((e=r.charAt(i))>32)f[i]=e;for(i=-1,e=0;++i<z&v>0;)v-=(k=f[i])>94?1:k>91?-4:k>84?(e=1):5;return 0<e;}

Flatten the course, because the y-coordinate doesn't matter, unfortunately Java doesn't have a vertical trim. It also doesn't have a String-transpose.
Iterate over the flattened course and keep track of the ball speed.

Python, 212 201 188 143 bytes
Much of the credit for this iteration of this script goes to @Erwan, who gave me an entirely different approach to try and some tips that saved me 55 bytes in the end.
Not recursive, so should be substantially different from the other python solution.
def g(c,p):
 o=[''.join(x).split()[0] for x in zip(*c.split('\n'))]
 t={"_":1,"/":5,"\\":-4}
 for v in o:
    if v=="U" or p<1:return p>0
    p-=t[v]

Ungolfed a bit:
def g(course,power):
  course=course.split('\n') # split into lines
  course=zip(*course)

  #transpose and flatten course, then remove spaces
  one_line_course=[''.join(x).split[0] for x in zip(*course)]

  terrain_values={"_":1,"/":5,"\\":-4}
  for char in one_line_course:
    if char=="U" or power<1:
      return power>0 # true when power remains, false otherwise
    power-=terrain_values[char]

if you want a shorter solution you can use Cyoce tip and use the transpose built-in function. somethings like that  o=[''.join(x).split()[0] for x in zip(*c.split('\n'))] that win 40 bytes i think

you can also replace break by return p>0 and remove if p...

you need to add a condition if"U"==v or p<1  if there is a local maximum like _//\\\\\U

@Erwan Your first tip does not work if the lines are not all the same length (short lines having trailing spaces to match long ones). Since the post said "Courses can optionally be padded with spaces" I'm not sure we can assume that that's true. I've asked about that in a comment.

yes I assume all line have the same length (egalized with white space) maybe i'm wrong
in this case i think my solution is bad

@Erwan The examples are all the same length, but the wording in the question makes me unsure. We'll wait and see what OP says. Your other tips were helpful though, I'll edit them in now

Rewrite the 'if' like this... if p<1or"U"==v

C, 629 Bytes
#include <string.h>
#include <stdlib.h>
#include <string.h>

bool swing(char *c, unsigned int p)
{
    char *olc = calloc(strlen(c), 1);
    int x = 0;
    char *n = c;

    while(1) {
        if(*n == '\0')  break;
        else if(*n == ' ') x += 1;
        else if(*n == '\n') x = 0;
        else {
            olc[x] = *n;
            x += 1;
        }
        n++;
    }

    int hd = 0;
    for(char *i = olc; i != strchr(olc, 'U'); i++) {
        if(*i == '_') hd += 1;
        else if(*i == '/') hd += 5;
        else hd -= 4;
    }

    free(olc);
    if(hd < p) return 1;
    return 0;
}

Ungolfed:
bool swing(char *course, unsigned int power)
{
    const size_t course_len = strlen(course);
    char *one_line_course = calloc(course_len, sizeof(char));
    assert(one_line_course);
    int x_pos = 0;
    char *next = course;

    //Convert to one line representation
    while(1) {
        if(*next == '\0') {
            break;
        }
        else if(*next == ' ') {
            x_pos += 1;
        }
        else if((*next == '\n') || (*next == '\r')) {
            x_pos = 0;
        }
        else {
            one_line_course[x_pos] = *next;
            x_pos += 1;
        }
        next++;
    }

    //Calculate power vs distance
    const char *hole_location = strchr(one_line_course, 'U');
    int hole_distance = 0;
    for(char *i = one_line_course; i != hole_location; i++) {
        if(*i == '_') {
            hole_distance += 1;
        }
        else if(*i == '/') {
            hole_distance += 5;
        }
        else {
            hole_distance -= 4;
        }
    }

    free(one_line_course);
    if(hole_distance < power) {
        return true;
    }
    else {
        return false;
    }
}

Basically I just make one pass to convert the input string to fit everything in one line, then

Welcome to
Programming Puzzles & Code Golf!  You can (and should) be able to reduce the size substantially by eliminating most whitespace; you can reduce some of your if/else e.g. x+=*n==' ')?1:*n=='\n'?-x:(olc[x]=*n,1.  Another tip: in C, unsigned int can be written unsigned, saving 4 bytes right away.

J, 47 bytes
1 e.(<:4([:+/\1 5 _4{~i.&3{.])@-.~'_/\U',@i.|:)

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Eeny, meeny, miny, moe
Introduction
The childhood song Eeny, meeny, miny, moe was often used to select who was "it" when playing tag.  Everyone would stand in a circle and point at one person selected at random.  They would sing:

Eeny, meeny, miny, moe,
  Catch a tiger by the toe.
  If he hollers, let him go,
  Eeny, meeny, miny, moe.

As they sung each word, they pointed at the next person in the circle.  The person being pointed to when the final "moe" was sung would be "it".  The children would immediately stand up and scatter.
Goal
Implement the shortest program in bytes that takes an input, the number of children, and lists the words that were sung when they were being pointed at.
The winner will be selected in one week.
Input
From STDIN, a single, positive integer, the number of children.  This may be more than the number of words in the song.
Output
Writes to STDOUT a list where each line represents a child and contains the word sung while they were being pointed at.  If there are too many children, empty lines may be omitted.
Requirements

Always start with the first child.
Display the words without punctuation.
The final "moe" should be emphasised as "MOE!" including punctuation.

Example
Input
3

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

Input
7

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

Input
1

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

Input
21

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

Will the input ever be greater than the number of words present?

@Doorknob, yes, but empty lines may be omitted.  I've now clarified that.  Thanks!

Should "catch a" and "if he" and "by his"/"by the" be treated as two words or one? In the song, they only count as one "point"

@Hand-E-Food is pythons input() method a form of STDIN? (Sorry I don't know these things)

@AshwinGupta yes, it is.

@Doᴡɴɢᴏᴀᴛ ok great thanks. Also, if I were to store each word In an array, would initializing a blank element as the first element in the array so indexing starts at 1 instead of 0 be considered an unfair loophole?

@AshwinGupta that would be fine. Loopholes are generally when you exploit  an ambiguity in a spec

@OldBunny2800, I did consider that but decided to make it one word per point.

Can you add more testcases?

Are trailing spaces acceptable?

We always ended with "My...mother...said...to...pick...the...very...best...one...and...you...are...IT!" That would be a cool bonus. Of course, the cheaters always dragged out the "you" and the "are" over several people...

@LegionMammal978, there's too many existing answers to add that restriction now, so go for it! :-)

@ThisSuitIsBlackNot NOOO (Darth Vader voice)! You stole my line. I literally logged on to PPCG just to write that since I've been thinking about it for the past two days since I saw this.

Not so fun fact: Tiger used to be the N word.

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

Decompress, chunk, transpose, join, output.
Explanation
              // 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

Try it online

Non-competing 81 byte
The α wasn't getting chained . so I had to bug fix this
D`${a="Ey Ú9y ·ny "}¶e C® a g by e e If  Ò@s ¤t m go ${a}MOE!`qKαtΣj═)j╝

Pyth, 103 89 84 chars
Saved 18 bytes with string compression, thanks to @Dennis and @FryAmTheEggman
Saved another byte thanks to @isaacg
Warning: there are many unprintables in the code; use the links below to try it.
VQjd%Q>cs[J."@y)òÎ5O¹c×Ú"."@yæ\J}ÇZH66¥ÓÀD¸¶=ðÉ §J%ÔþÖúÅ="J"MOE!")\@N

Try it online | Test suite
Could probably be golfed. Suggestions welcome!
How it works
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.

Reusing Eeny meeny miny somehow should save a few bytes. Also, Pyth has two built-ins for (de)compression (.Z and .").

@Dennis Thanks, ." saves 14 bytes!

Does Pyth use UTF-8 or something else? This is 89 chars but 123 bytes

@Doᴡɴɢᴏᴀᴛ Pyth uses ISO 8859-1 by default, so each character is exactly one byte.

FNQ == VQ, by the way.

@FryAmTheEggman How comes that MOE! is on the first line instead of the last one in your example?

@FryAmTheEggman Thanks for the suggestions! This saves 4 bytes.

@isaacg Thanks, that saves another byte!

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

Try it online!

Compressing the string by hand was... entertaining. The score would be a lot better if Jelly had a split at occurrences function.

JavaScript (ES6), 167 bytes

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`
`)

Explanation
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
);
alert(l.join`
`)                    // output the lines

Does l=Array(n).fill``  not work for some reason?

@ETHproductions It works. I just forgot to shorten it somehow haha! Thanks.

@user81655 I love JS prompt() windows. They are just so fun. (I know that sounds crazy but I mean in comparison to every other language's console.out or equivalent print type expression)

Haskell, 160 157 bytes
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 "++)))

Prepend "Eeny meeny miny " to the other parts ("moe Catch ..." and "MOE!"), concatenate both strings, split into words, take chunks of required size, transpose and concatenate again into a single string.
@Mauris found 3 bytes by factoring out the common substring "Eeny meeny miny " and making f pointfree.

Maybe s="Eeny meeny miny " saves some bytes.

@Mauris: I tried, but it was longer.

@Mauris: ... oh no, it has the same length.

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

@Mauris: Nice. Once f is completely pointfree we can omit even the name.

Ruby, 160 bytes
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*' '}

All my attempts at "compressing" the string have just made it longer. Still trying...
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

Python 3, 279 278 272 173 bytes
(thanks to Mathias Ettinger who literally saved me 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))

If anyone has tips or sugestions I'd really appreciate them. Thanks!

I think you've misunderstood what the input represents.  It's not the line number to show, it's the number of children among which to divide the words.  Every line should be displayed.  In your code, int(i) should take the place of 3, but there are other errors to fix after that.

@Hand-E-Food okay I believe it works as you specified now!

That looks better!  :-)  And if you want some golfing help, investigate the Modulo operator, usually written as %.  It's ideal for cyclic counters.

@Hand-E-Food ok thanks! I think I know what you are getting at. I am going to fix this up tomorrow. I think I can shave at least a couple bytes off.

A few points that serves both at best practices and help shorten the code: 1) .split() will split on blanks (space, newlines, tabs) 2) range(0, x) is best written as range(x) 3) have a look at slice notation: w[0::3] will return a list of every three words in w.

@MathiasEttinger wow thanks! That's a lot of tips. Sadly, I won't be able to use any of these until later after school but I'll put thoes in here. I think you might have saved me like 5+ bytes at least.

The slice notation alone, if correctly done, can save you something like 100 bytes.

Oh, and 4) a semicolon at the end of a line is completely unnecessary and bad practice in python. (even though it can be used to put several statements on the same line for golfing purposes ;))

@MathiasEttinger woops, that was just habit from java. Good catch. Ill fix that now since its quick. I'll also fix the range ones. Then I gtg but thanks for these great tips they really help! (I learned quite alot of python from you just now)

So, for the slice notation, have a look at for z in range(i): print(w[z::i]) and try to fiddle with it. And remove that space at the beginning of s it won't give you any good.

@MathiasEttinger Fixed it! Thanks so much. Now I get the slicing stuff. Also got me to learn about the .join function for list printing.

Python 2, 154 147 bytes
EDIT: Thanks Joe Willis!
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])

This uses the trick that [0::n] prints the nth element of the list.
Try it here

Ouch. Well you just totally destroyed my answer. LOL. I'm going to try your tip later today about the print("\n"). What exactly does :: operator do? Is that like for in loop?

JavaScript (ES6), 189 bytes:
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`)

Explanation:
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
    )
);alert(b.join`\n`)

Your input method is correct, but the output method is not accepted. You can, however, wrap it all in a function, receiving the input as an argument. You can try the following: I=>(b=Array(I--).fill``,c=0,"Eeny meeny miny moe Catch a tiger by the toe If he hollers let him go Eeny meeny miny MOE!".split` `.forEach(v=>(b[c]+=v+' ',c+=c>I-1?-c:1)),b), which is 172 bytes long. It returns each line as an element in the array. I think this is acceptable.

By the way, if you use .map() instead of .forEach(), you can save 3 bytes, reducing to 169 bytes. With a bit more of fiddling, this might actually be tweetable!

@IsmaelMiguel The question asks for input and output to be specifically through STDIN and STDOUT so I think it limits JavaScript answers to prompt and alert unfortunately.

Oh, I see. I will update the code when I get a chance. Thanks for informing me :-)

@user81655 You are correct. It should have an alert(b.join`<newline>`) at the end. But the damage can still be reduced with .map(), instead of .forEach().

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

Lots of unprintables. Try it online!
How it works
              // 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.

I've tried compressing the string with different delimiters. The only thing more efficient than spaces would be a lowercase letter, but most of these  are already used, and thus, can't be used to split the string. Here's how much compression is achieved with the remaining ones:
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

Currently I'm using d. It may be possible to save a byte with s, substituting some other letter in hollers.

Mathematica, 154 bytes
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,""],"
"," "]&

Uses the split-chunk-transpose-join-output method of most of the other answers.

MATLAB, 167 bytes/characters:
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

Explanation:
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

Won't be winning any awards for the length of this one, but it was fun. :-)


text:
What is the frequency of this note?
Quick musical refresher:
The piano keyboard consists of 88 notes. On each octave, there are 12 notes, C, C♯/D♭, D, D♯/E♭, E, F, F♯/G♭, G, G♯/A♭, A, A♯/B♭ and B. Each time you hit a 'C', the pattern repeats an octave higher.

A note is uniquely identified by 1) the letter, including any sharps or flats, and 2) the octave, which is a number from 0 to 8. The first three notes of the keyboard, are A0, A♯/B♭ and B0. After this comes the full chromatic scale on octave 1. C1, C♯1/D♭1, D1, D♯1/E♭1, E1, F1, F♯1/G♭1, G1, G♯1/A♭1, A1, A♯1/B♭1 and B1. After this comes a full chromatic scale on octaves 2, 3, 4, 5, 6, and 7. Then, the last note is a C8.
Each note corresponds to a frequency in the 20-4100 Hz range. With A0 starting at exactly 27.500 hertz, each corresponding note is the previous note times the twelfth root of two, or roughly 1.059463. A more general formula is:

where n is the number of the note, with A0 being 1. (More information here)
The Challenge
Write a program or function that takes in a string representing a note, and prints or returns the frequency of that note. We will use a pound sign # for the sharp symbol (or hashtag for you youngins) and a lowercase b for the flat symbol. All inputs will look like (uppercase letter) + (optional sharp or flat) + (number) with no whitespace. If the input is outside of the range of the keyboard (lower than A0, or higher than C8), or there are invalid, missing or extra characters, this is an invalid input, and you do not have to handle it. You can also safely assume you will not get any weird inputs such as E#, or Cb.
Precision
Since infinite precision isn't really possible, we'll say that anything within one cent of the true value is acceptable. Without going into excess detail, a cent is the 1200th root of two, or 1.0005777895. Let's use a concrete example to make it more clear. Let's say your input was A4. The exact value of this note is 440 Hz. Once cent flat is 440 / 1.0005777895 = 439.7459. Once cent sharp is 440 * 1.0005777895 = 440.2542 Therefore, any number greater than 439.7459 but smaller than 440.2542 is precise enough to count.
Test cases
A0  --> 27.500
C4  --> 261.626
F#3 --> 184.997
Bb6 --> 1864.66
A#6 --> 1864.66
A4  --> 440
D9  --> Too high, invalid input.
G0  --> Too low, invalid input.
Fb5 --> Invalid input.
E   --> Missing octave, invalid input
b2  --> Lowercase, invalid input
H#4 --> H is not a real note, invalid input.

Keep in mind that you don't have to handle the invalid inputs. If your program pretends they are real inputs and prints out a value, that is acceptable. If your program crashes, that it also acceptable. Anything can happen when you get one. For the full list of inputs and outputs, see this page
As usual, this is code-golf, so standard loopholes apply, and shortest answer in bytes wins.

"H#4 --> H is not a real note, invalid input." Except in Europe.

@Lui what's this thing about Europe as if the whole of Europe uses H? H meaning B is AFAIK only used in German speaking countries. (where B means Bb by the way.) What the British and Irish call B is called Si or Ti in Spain and Italy, as in Do Re Mi Fa Sol La Si.

@steveverrill My mistake, I thought it was more widespread than that.

I've played a B♯2 on a viola before, it's a perfectly reasonable note and not weird at all.

@Neil fair enough. On piano it's a pretty weird note. Although I have played it also, along with E#, Cb and Fb. I thought I'd leave it out since it tends to confuse a lot of people.

@steveverrill H is used in Germany, Czech Republic, Slovakia, Poland, Hungary, Serbia, Denmark, Norway, Finland, Estonia and Austria, according to Wikipedia. (I can also confirm it for Finland myself.)

@Neil It was probably just accidental. ;)

How about Ex of Gbb? (Double sharp/flat)

@AlexL. While double sharps/flats are still entirely valid as far as music in general is concerned, I don't want the challenge to be too complicated. You can handle them if you want, but they are not mandatory.

Japt, 41 37 35 34 bytes
I finally have a chance to put ¾ to good use! :-)
55*2pU¬®-1¾ª"C#D EF G A B"bZ /C} x

Try it online!
How it works
          // Implicit: U = input string, C = 12
U¬®    }  // Take U, split into chars, and map each item Z by this function:
-1¾       //  Subtract 1.75 from Z. This produces NaN for non-digits.
ª"..."bZ  //  If the result is falsy (NaN), instead return the index of Z in this string.
          //  C produces 0, D -> 2, E -> 4, F -> 5, G -> 7, A -> 9, B -> 11.
          //  # -> 1, and b -> -1, so we don't need to calculate them separately.
/C        //  Divide the index by 12.
x         // Sum.
2p        // Take 2 to the power of the result.
55*       // Multiply by 55.

Test cases
All the valid test cases come through fine. It's the invalid ones where it gets weird...
input --> output       (program's reasoning)
A0  --> 27.5           (Yep, I can do that for you!)
C4  --> 261.625565...  (Yep, I can do that for you!)
F#3 --> 184.997211...  (Yep, I can do that for you!)
Bb6 --> 1864.6550...   (Yep, I can do that for you!)
A#6 --> 1864.6550...   (Yep, I can do that for you!)
A4  --> 440            (Yep, I can do that for you!)
D9  --> 9397.27257...  (Who says that's too high?)
G0  --> 24.49971...    (I've heard that note before.)
Fb5 --> 659.25511...   (Wait, Fb isn't supposed to be a note?)
E   --> 69.295657...   (I'm gonna guess that the missing octave is 1¾.)
b2  --> 61.735412...   (I assume that b means Cb...)
H#4 --> 261.625565...  (H# is C!)

+¾ for using ¾ :)

Isn't this actually 38 bytes?

@PatrickRoberts This is 38 bytes in UTF-8, but Japt uses the ISO-8859-1 encoding, in which each character is exactly one byte.

F flat is E tho. NOT weird! (I know music)

Pyth, 46 44 43 42 39 35 bytes
*55^2tsm.xsdc-x"C D EF GbA#B"d9 12z

Try it online. Test suite.
The code now uses a similar algorithm to ETHproductions's Japt answer, so credit to him for that.
Explanation
                                            implicit: z = input
       m                          z         for each character in input:
          sd                                  try parsing as number
        .x                                    if that fails:
               "C D EF GbA#B"                   string "C D EF GbA#B"
              x              d                  find index of character in that
             -                9                 subtract 9
            c                   12              divide by 12
      s                                     sum results
     t                                      decrement
   ^2                                       get the correct power of 2
*55                                         multiply by 55 (frequency of A1)

Old version (42 bytes, 39 w/ packed string)
*55^2+tsezc+-x"C D EF G A B"hz9-}\#z}\bz12

Explanation

<pre>
                                         implicit: z = input
                                     GET OFFSET BY NOTE:
              ."…"                       string "C@D@EF@G@A@B" packed
             x    hz                     get index of first char in input
            -       9                    subtract 9
                                     PARSE #/b:
           +          }\#z               add 1 if input contains "#"
                     -    }\bz           subtract 1 if input contains "b"
                                     CONVERT OFFSET TO OCTAVES:
          c                   12         divide by 12
                                     FIND OCTAVE IN INPUT:
        ez                               last char of input
       s                                 convert to number
                                     GET FINAL RESULT:
      t                                  decrement the octave
     +                                   add the octave and the note offset
   ^2                                    get the correct power of 2
*55                                      multiply by 55 (frequency of A1)
</pre>

This is interesting. How does Pyth pack strings?

@LuisMendo You can find information on that in the docs. Basically, it finds the smallest base to convert the data to and then encodes the result in base 256.

Mathematica, 77 bytes
2^((Import[".mid"~Export~Sound@SoundNote@#,"RawData"][[1,3,3,1]]-69)/12)440.&

Explanation:
The main idea of this function is to convert the string of note to its relative pitch, and then calculate its frequency.
The method I use is export the sound to midi and import the raw data, but I suspect that there is a more elegant way.

Test cases:
f=%; (* assign the function above to f *)
f["A4"]    (* 440.    *)
f["A5"]    (* 880.    *)
f["C#-1"]  (* 8.66196 *)
f["Fb4"]   (* 329.628 *)
f["E4"]    (* 329.628 *)
f["E"]     (* 329.628 *)

Usually I'm sad to see Mathematica builtins that trivially solve problems, but this is actually a pretty inspired way to do it.

MATL, 56 53 50 49 48 bytes
Hj1)'C D EF G A B'=f22-'#b'"G@m]-s+ 12/G0)U+^55*

Uses current release (10.1.0), which is earlier than this challenge.
Try it online!
Explanation
H                   % push 2
j1)                 % get input string. Take first character (note)
'C D EF G A B'=f    % find index of note: 1 for C, 3 for D...
22-                 % subtract 22. This number comes from three parts:
                    % 9; 1 for 0-based indexing; 12 to subtract 1 octave
'#b'"G@m]-s         % For loop. Gives 1 if input contains '#', -1 if 'b', 0 otherwise
+                   % add to previous number. Space needed to separate from next literal
12/                 % divide by 12
G0)                 % push input and get last character (octave)
U+                  % convert to number and add to previous number
^                   % raise 2 (that was initially pushed) to accumulated number
55*                 % multiply by 55 (=27.5*2). Implicitly display

JavaScript ES7, 73 70 69 bytes
x=>[...x].map(c=>t+=c-1.75||"C#D EF G A B".search(c)/12,t=0)&&2**t*55

Uses the same technique as my Japt answer.

Ruby, 69 65
->n{2**((n.ord*13/8%12-n.size+(n=~/#/?7:5))/12.0+n[-1].to_i)*55/4}

Ungolfed in test program
f=->n{
  2**(                    #raise 2 to the power of the following expression:
   (
     n.ord*13/8%12-       #note name C..B maps to number 0..11 calculated from the ascii code of n[0]
     n.size+(n=~/#/?7:5)  #Correction for flat: length of n is 1 more for flat (or sharp) than for natural. Then apply correction for sharp
                          #now we have a number 3..14 for C..B (so 12 for A, will be a whole number when divided)
   )/12.0+                #divide by 12 to convert into a fraction of an octave

  n[-1].to_i              #add the octave number, last character in n
  )*                      #end of power expression, now we have A0=2,A1=4,A2=4 etc

  55/4                    #multiply to get correct frequency, this is shorter than 13.75 or 440/32
}

#complete octave test case
puts %w{A0 A#0 Bb0 B0 C1 C#1 Db1 D1 D#1 Eb1 E1 F1 F#1 Gb1 G1 G#1 Ab1 A1 A#1}.map{|e|[e,f[e]]}

#test case per OP
puts %w{A0 C4 F#3 Bb6 A#6}.map{|e|[e,f[e]]}

Output
A0
27.5
A#0
29.13523509488062
Bb0
29.13523509488062
B0
30.867706328507758
C1
32.70319566257483
C#1
34.64782887210901
Db1
34.64782887210901
D1
36.70809598967595
D#1
38.890872965260115
Eb1
38.890872965260115
E1
41.20344461410875
F1
43.653528929125486
F#1
46.2493028389543
Gb1
46.2493028389543
G1
48.999429497718666
G#1
51.91308719749314
Ab1
51.91308719749314
A1
55.0
A#1
58.27047018976123
A0
27.5
C4
261.6255653005986
F#3
184.9972113558172
Bb6
1864.6550460723593
A#6
1864.6550460723593

ES7, 82 bytes
s=>55*2**(+s.slice(-1)+("C D EF G A B".search(s[0])+(s[1]<'0')-(s[1]>'9')-21)/12)

Returns 130.8127826502993 on input of "B#2" as expected.
Edit: Saved 3 bytes thanks to @user81655.

@user81655 2*3**3*2 is 108 in Firefox's browser console, which agrees with 2*(3**3)*2. Also note that that page also says that ?: has higher precedence than = but they actually have equal precedence (consider a=b?c=d:e=f).

Ah, ok. My Firefox doesn't have ** so I've never been able to test it. I think ?: does have a higher precedence than = though because in your example a is set to the result of the ternary, rather than b, then executing the ternary. The other two assignments are enclosed in the ternary so they're a special case.

@user81655 How is e=f inside the ternary?

Consider a=b?c=d:e=f?g:h. If they were the same precedence and the first ternary ended at the = after e, it would cause an invalid left-hand assignment error.

@user81655 But that would also be a problem if ?: had higher precedence than = anyway. The expression needs to group as if it was a=(b?c=d:(e=(f?g:h))). You can't do that if they don't have the same precedence.

C, 123 bytes
float d(char*s){int n=*s++,m=(n*12+(n<67?90:6))/7,o=*s++,a=o^35?o^98?0:-1:1;return exp((m+(a?*s++:o)*12+a)/17.3123-37.12);}

Usage:
#include <stdio.h>
#include <math.h>

float d(char*s){int n=*s++,m=(n*12+(n<67?90:6))/7,o=*s++,a=o^35?o^98?0:-1:1;return exp((m+(a?*s++:o)*12+a)/17.3123-37.12);}

int main()
{
    printf("%f\n", d("A4"));
}

The calculated value is always about 0.8 cents less than the exact value, because I cut as many digits as possible from the floating-point numbers.
Overview of the code:
float d(char*s){
    int n=*s++,        // read the letter
        m=(n*12+       // multiply by 12/7 to convert from A...G to 0...11
        (n<67?90:6)    // if A or B, add 1 octave; also add some fix-up rounding value
        )/7,

        o=*s++,        // read next char: the octave digit or accidental

        a=o^35?o^98?0:-1:1; // if accidental, convert it into +1 or -1; else 0

        return exp((m+ // I adjusted the factors to use exp instead of pow
            (a?*s++:o) // if was accidental, now read the octave digit
            *12+a)/
            17.3123-   // a more exact value is 17.3123404447
            37.12);    // a more exact value is 37.1193996632
}

R, 157 150 141 136 bytes
f=function(x){y=strsplit(x,"")[[1]];55*2^(as.double(y[nchar(x)])-1+(c(10,12,1,3,5,6,8)[LETTERS==y[1]]-switch(y[2],"#"=9,"b"=11,10))/12)}

With indent and newlines:
f=function(x){
     y=strsplit(x,"")[[1]]
     55 * 2^(as.double(y[nchar(x)]) - 1 +
         (c(10,12,1,3,5,6,8)[LETTERS==y[1]] -
         switch(y[2],"#"=9,"b"=11,10))/12)
     }

Usage:
> f("A0")
[1] 27.5
> f("C8")
[1] 4186.009
> sapply(c("C4","Bb6","A#6","A4"),f)
       C4       Bb6       A#6        A4
 261.6256 1864.6550 1864.6550  440.0000

Python, 97 95 bytes
def f(n):a,*b,c=n;return 2**(int(c)+('C@D@EF@G@A@B'.find(a)-(21,(22,20)['#'in b])[b>[]])/12)*55

Based on Pietu1998's (and others') old approach of looking for the index of the note in the string 'C@D@EF@G@A@B' for some blank char or another. I use iterable unpacking to parse the note string without conditionals. I did a little bit of algebra at the end to simplify the conversion expression. Don't know if I can get it shorter without changing my approach.

I think b==['#'] could be shortened to '#'in b, and not b to b>[].

Nice points! Works for my test suite, thanks. I think I can improve on golfing down conditionals in Python a fair bit, thanks.

Wolfram Language (Mathematica), 69 bytes
ToExpression@("Music`"<>StringReplace[#,{"b"->"flat","#"->"sharp"}])&

Using the music package, with which simply entering a note as an expression evaluates to its frequency, like this:
 In[1]:= Eflat3
Out[1]:= 155.563

To save bytes by avoiding to import the package with <<Music, I'm using the fully qualified names: Music`Eflat3. However, I still have to replace b with flat and # with sharp to match the input format of the question, which I do with a simple StringReplace.


text:
PNZ (Guess 3 unique digits in order)
From a challenge in a programming book long ago, PNZ is a game where the user must guess three unique digits in the correct order.
Rules:

A random 3 digit number with no repeating digits is generated. (This is what the user is trying to guess)
The user inputs a guess of 3 digits, which is to be evaluated by the program.
Output a "P" for every correct digit in a correct place.
Output a "N" for every correct digit in an incorrect place.
Output a "Z" only if no digits are correct.
Continue accepting inputs until all digits are correct and in the
correct place, then output "PPP" followed by the number of guesses
it took on a new line.

Note:

A "Correct digit" means that one of the digits in the guess is also
one of the digits in the random 3 digit number.
A "Correct place" means it is a "Correct digit" AND is in the same place as the 3 digit random number.
The order of outputting should be all "P"'s first, then "N"'s, or only "Z" if nothing is correct.
If an input contains repeating digits, "P" takes priority over "N" (Example: Number: 123 Input: 111 Output: P)
(OPTIONAL) Inputs that are not exactly 3 digits in length should not be evaluated, nor count towards the running total of guesses

Example if the generated digits were 123
> 147
P
> 152
PN
> 126
PP
> 123
PPP
4

Example if the generated digits were 047
> 123
Z
> 456
N
> 478
NN
> 947
PP
> 047
PPP
5

This is CodeGolf, so the shortest program wins!

Welcome to PPCG! This is a great first challenge, but I'm afraid we've done this before. The game is otherwise known as Mastermind. Here is the existing challenge but I can't make up my mind whether to close the old one or the new. I'm slightly leaning towards closing this, but I'll let the community decide.

@MartinBüttner Ah, that's my bad. It does seem like a pretty similar problem. I'll agree with you and let the community decide.

@MartinBüttner What's the criterion here? To what extend should the old one have precedence?

@MartinBüttner I think between requiring the digits to be unique and the interactive nature, this challenge is distinct enough to be worthwhile.

@LuisMendo There is no official criterion I think, because closing old challenges is a fairly recent thing. My personal criterion is "which challenge is better and/or more barebones".

@TimmyD I disagree with the interactivity thing, because I think it's negligible in comparison with figuring out the Ps and Ns and I think that a challenge asking only for the latter part is more interesting. However, you may be right that limiting it to unique digits might allow for some different approaches.

@MrPublic Suppose the secret number is 123. If the user input is composed of non-distinct digits, e.g., 111, how should the program respond?

Number 123, gues 111: why nothing? There is a digit in the right position

@edc65 I agree with your statement and retract my last one. By the challenge specifications, the correct output would indeed be "P".

if the secret number is 123, should 411 return N or NN?

JavaScript (ES6), 195 187 184 bytes
Edit Saved 8 bytes thx @Neil
Edit Saved 3 bytes thx @user81655
(newlines counted as 1 byte)
d=[...'0123456789']
x=[10,9,8].map(l=>d.splice(Math.random()*l,1))
for(c=p=a='';!p[2];++c)g=prompt(a),n=p='',x.map((d,i)=>d-g[i]?~g.search(d)?n+='N':0:p+='P'),a=p+n||'Z'
alert(a+' '+c)

Test

d=[...'0123456789']
x=[10,9,8].map(l=>d.splice(Math.random()*l,1))
for(c=p=a='';!p[2];++c)
  g=prompt(a),
  n=p='',
  x.map((d,i)=>
        d-g[i]?~g.search(d)?n+='N':0:p+='P'
       ),
  a=p+n||'Z'
alert(a+' '+c)

I think d.splice(v=Math.random()*-~l,1) saves you 5 or maybe even 8 bytes (at the cost of some performance).

@Neil I rejected splice when I started to find a solution, it seemed lengthy. Now I'll try again

@user81655 right, thanks. Really a weird cast

PowerShell v2+, 177 231 168 bytes
$g=-join(0..9|Random -c 3);for($c=0;$o-ne"PPP";$c++){$n=$p='';$i=read-host;$o=-join(0..2|%{((("","N")[$i.IndexOf($g[$_])-ge0]),"P")[$g[$_]-eq$i[$_]]}|sort -des);($o,"Z")[!$o]}$c

Oddly, I was able to golf the fixed version to be a shorter length than the unfixed version ... o.O
Many thanks to @edc65 for his assistance and inspiration!
Explanation:
$g=-join(0..9|Random -c 3)   # Create an array @(0,1,2,...9) and choose 3 distinct elements
for($c=0;$o-ne"PPP";$c++){   # Loop until output = "PPP", incrementing $count each time
  $i=read-host               # Read input from the user

  $o=-join(0..2|%{((("","N")[$i.IndexOf($g[$_])-ge0]),"P")[$g[$_]-eq$i[$_]]}|sort -des)
       # OK, this is the convoluted part. We're constructing an array of "N", "P", or "",
       # sorting them by descending order (so the P's are first), and then joining them
       # together into a string. The array is constructed by essentially an if/elseif/else
       # statement that is evaluated three times thanks to the 0..2|%{} loop.
       # Starting from the innermost, we choose between "" and "N" based on whether the
       # input number has the current-digit of the secret number somewhere within it. We
       # then choose between that or "P" based on whether it's the _current_ digit of the
       # user input number.

  ($o,"Z")[!$o]
       # Here we output either $o from above or "Z" based on whether $o is empty
}
$c                           # The loop finished (meaning the user guessed), output $count

Example run:
PS C:\Tools\Scripts\golfing> .\pnz.ps1
123
N
111
Z
222
P
452
PN
562
NN
275
PN
258
PPP
7

How do you check that digits are not repeated?

@edc65 Corrected output. That was expensive. Still working to golf further, but I'm not hopeful ...

I'm sure you can do better. Leverage the fact that the guess can have repetitions, but the number to guess have not. For instance, in my answer I start from each digit to be guessed and check the input, the contrary would not work

@edc65 Thanks for the inspiration and assistance - golfed the fixed version to be shorter than the non-fixed version! :D

Now I am bound to upvote

R,178 166 bytes
y=!(s<-sample(48:57,3))
while(any(y!=s)){F=F+1
y<-utf8ToInt(readline())
cat(rep("P",p<-sum(y==s)),rep("N",n<-sum(y%in%s)-p
),if(!(n+p))"Z","
",if(all(y==s))F,sep="")}

Try it online!
TIO link is just for byte count - try this in your R console! (or let me know if there is an alternate option).
See history for less-golfed, more readable version.