答:
Hexagony, 7 bytes, 10 numbers, by Martin Ender

Original:

```<code>1<@|!__
</code>```

Code that produces 1 - 10:

```<code>1<@|!).
2<@|!).
3<@|!).
4<@|!).
5<@|!).
6<@|!).
7<@|!).
8<@|!).
9<@|!).
9<@|!).!
</code>```

1: Try it Online!

9: Try it Online!

10: Try it Online!

Here is the hex for the first 9 programs (where # is the number that you want to print):

```<code> # <
@ | !
 ) .
</code>```

The memory edge is just set to the value you want to print, deflected to the SE and printed.

And the hex for 10:

```<code>  9 < @
 | ! ) .
! . . . .
 . . . .
  . . .
</code>```

Here, I added a character to the end which increased the hex size. First, the memory edge is set to 9, the pointer is deflected to the SE, memory is incremented, wraps around, the pointer is deflected to the SW, the value is printed and the program ends.

Here is a second solution:

```<code>1<@|!$)
2<@|!$)
3<@|!$)
...
8<@|!$)
9<@|!$)
9#@|!$)
</code>```

1: Try it Online!

9: Try it Online!

10: Try it Online!

The hex for 1 - 9 (this time * is the number to print):

```<code> * <
@ | !
 $ )
</code>```

This works the same as 1 - 9 above.

The hex for 10:

```<code> 9 #
@ | !
 $ )
</code>```

This hits 9 then # switched the instruction pointer to the lower right one, memory is incremented to 10, $ jumps over the !, the pointer is reversed back east where it jumps over ) and ends.

Title: Code ladder, Robbers

Body:
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

```<code>abc1efghi
</code>```

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

Body:
Hexagony, 7 bytes, 10 numbers, by Martin Ender

Original:

1<@|!__

Code that produces 1 - 10:

1<@|!).
2<@|!).
3<@|!).
4<@|!).
5<@|!).
6<@|!).
7<@|!).
8<@|!).
9<@|!).
9<@|!).!

1: Try it Online!

9: Try it Online!

10: Try it Online!

Here is the hex for the first 9 programs (where # is the number that you want to print):

 # <
@ | !
 ) .

The memory edge is just set to the value you want to print, deflected to the SE and printed.

And the hex for 10:

  9 < @
 | ! ) .
! . . . .
 . . . .
  . . .

Here, I added a character to the end which increased the hex size. First, the memory edge is set to 9, the pointer is deflected to the SE, memory is incremented, wraps around, the pointer is deflected to the SW, the value is printed and the program ends.

Here is a second solution:

1<@|!$)
2<@|!$)
3<@|!$)
...
8<@|!$)
9<@|!$)
9#@|!$)

1: Try it Online!

9: Try it Online!

10: Try it Online!

The hex for 1 - 9 (this time * is the number to print):

 * <
@ | !
 $ )

This works the same as 1 - 9 above.

The hex for 10:

 9 #
@ | !
 $ )

This hits 9 then # switched the instruction pointer to the lower right one, memory is incremented to 10, $ jumps over the !, the pointer is reversed back east where it jumps over ) and ends.


问:
Code ladder, Cops

Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

```<code>abc____i
</code>```

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea">

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

答:
Python 3, 19 bytes, 10 numbers, cracked

print(??bin()?????)
```

Unrevealed characters are marked with ?. Tested in Python 3.5.2.

ContentLicense: CC BY-SA 3.0

Title: Code ladder, Cops

Body:
Python 3, 19 bytes, 10 numbers, cracked

print(??bin()?????)

Unrevealed characters are marked with ?. Tested in Python 3.5.2.


问:
Score a hand of Hearts
Hearts is a trick-taking card game for 4 players. Each trick is taken by the player who played the highest card of the leading suit. At the end of each hand, the players incur a penalty score depending on the penalty cards they have taken; the task is to determine the scores under Microsoft Hearts rules.

Input

Input is 4 lists (or delimited string, array, etc.) showing the penalty cards taken by each of the 4 players. The penalty cards are

```<code>2♥, 3♥, 4♥, 5♥, 6♥, 7♥, 8♥, 9♥, 10♥, J♥, Q♥, K♥, A♥, Q♠
</code>```

which we shall represent as

```<code>2,  3,  4,   5,  6,  7,  8,  9,  10,  11, 12,  13,  1,  0
</code>```

respectively.

Output

Output is the 4 penalty points incurred by the 4 players (list, string, array etc.). Scoring is as follows:

Each heart (♥, represented by integers 1 to 13 inclusive) incurs 1 point

The queen of spades (Q♠, represented by 0) incurs 13 points

Exception: if a player has taken all of the penalty cards (called shooting the moon), then he incurs 0 points, while all other players incur 26 points.

Test cases

```<code>[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]     -->  4,  2,  0, 20
[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1]   --> 25,  0,  0,  1
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], [], [] -->  0, 26, 26, 26
</code>```

Shortest code in bytes wins.

答:
Pip, 28 bytes

27 bytes of code, +1 for -p flag.

```<code>Y{$+1+12*!*a}M Va26Ny?26-yy
</code>```

Takes input on the command-line as a string representing a nested list, like "[[2 8 7 1] [3 4] [] [9 5 6 0 10 11 12 13]]" (quotes not needed on TIO). Try it online!

Title: Score a hand of Hearts

Body:
Pip, 28 bytes

27 bytes of code, +1 for -p flag.

Y{$+1+12*!*a}M Va26Ny?26-yy

Takes input on the command-line as a string representing a nested list, like "[[2 8 7 1] [3 4] [] [9 5 6 0 10 11 12 13]]" (quotes not needed on TIO). Try it online!


问:
Tips for golfing in Python
What general tips do you have for golfing in Python? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Python (e.g. "remove comments" is not an answer).

Please post one tip per answer.

答:
Booleans are integers, too!

assert True == 1
assert False == 0
assert 2 * True == 2
assert 3 * False == 0
assert (2>1)+(1<2) == 2
```

If you have a statement like [a,a+x][c] (where c is some boolean expression), you can do a+x*c instead and save a few bytes. Doing arithmetic with booleans can save you lots of bytes!

Title: Tips for golfing in Python

Body:
Booleans are integers, too!

assert True == 1
assert False == 0
assert 2 * True == 2
assert 3 * False == 0
assert (2>1)+(1<2) == 2

If you have a statement like [a,a+x][c] (where c is some boolean expression), you can do a+x*c instead and save a few bytes. Doing arithmetic with booleans can save you lots of bytes!


问:
Prime Wednesdays

Prime Wednesdays

Your task is to count the number of Wednesdays that fall on a prime day of the month in a particular year. For instance, 7-13-16 is a prime Wednesday. For consistency use the Gregorian calendar for all dates.

Input

The input to your program/function will be a year (eg 2016) and is flexible. The year will be an integer between 1912 and 2233 inclusive.

Output

The output is also flexible and should be the number of prime Wednesdays (eg 18).

Scoring

This is code-golf so shortest code in bytes wins!

Test Cases

input     -> output

  --------------------

  1912  ->   19

  1914  ->   16

  1984  ->   17

  1996  ->   19

  2063  ->   19

  2150  ->   16

  2199  ->   18

  2233  ->   18

答:
Groovy, 126

Groovy doesn't have prime number validation, had to build that too.

```<code>{n->p={x->x<3||(2..Math.sqrt(x)).every{x%it}};(new Date("1/1/$n")..new Date("12/31/$n")).collect{it[7]==4&&p(it[5])?it:0}-[0]}
</code>```

Title: Prime Wednesdays

Body:
Groovy, 126

Groovy doesn't have prime number validation, had to build that too.

{n->p={x->x<3||(2..Math.sqrt(x)).every{x%it}};(new Date("1/1/$n")..new Date("12/31/$n")).collect{it[7]==4&&p(it[5])?it:0}-[0]}


Title: Code ladder, Cops

Body:
Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

```<code>abc____i
</code>```

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea">

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Body:
Javascript 19 bytes 10 numbers Cracked

alert((_1*1_10__1_)

Unrevealed characters are marked with _

Cracked! Guess i should have blotted better

alert((11*1+10)%10)
alert((11*2+10)%10)
alert((11*3+10)%10)
alert((11*4+10)%10)
alert((11*5+10)%10)
alert((11*6+10)%10)
alert((11*7+10)%10)
alert((11*8+10)%10)
alert((11*9+10)%10)
alert((11*9+10)%11)


问:
Do n and n^3 have the same set of digits?
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.

For example, let's check the number 100.

1003 is 1000000.

The set of digits in 100 is {0, 1}.

The set of digits in 1000000 is {0, 1}.

Therefore, 100 should give a truthy value.

Test cases

```<code>0 -> True
1 -> True
10 -> True
107624 -> True
251894 -> True
251895 -> False
102343 -> False
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

OEIS A029795

答:
05AB1E, 6 bytes

05AB1E uses CP-1252 encoding.

```<code>3mê¹êQ
</code>```

Try it online!

Explanation

```<code>3m       # input^3
  ê      # sorted with duplicates removed
     Q   # is equal to
   ¹ê    # input sorted with duplicates removed
</code>```

Body:
05AB1E, 6 bytes

05AB1E uses CP-1252 encoding.

3mê¹êQ

Try it online!

Explanation

3m       # input^3
  ê      # sorted with duplicates removed
     Q   # is equal to
   ¹ê    # input sorted with duplicates removed


答:
Python 3, <s>36</s> 32 bytes

```<code>lambda x:{*str(x)}=={*str(x**3)}
</code>```

I think this only works in Python 3.5 and later.
Four bytes have gone, thanks to Copper.

Title: Do n and n^3 have the same set of digits?

Body:
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.

For example, let's check the number 100.

1003 is 1000000.

The set of digits in 100 is {0, 1}.

The set of digits in 1000000 is {0, 1}.

Therefore, 100 should give a truthy value.

Test cases

```<code>0 -> True
1 -> True
10 -> True
107624 -> True
251894 -> True
251895 -> False
102343 -> False
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

OEIS A029795

Body:
Python 3, <s>36</s> 32 bytes

lambda x:{*str(x)}=={*str(x**3)}

I think this only works in Python 3.5 and later.
Four bytes have gone, thanks to Copper.


问:
The Art of Word Shaping

The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

答:
Common Lisp, 152 bytes

```<code>(defun m(g w)(let((a 0))(loop for r in g do(loop for e in r do(format t"~[ ~;~c~]"e(char w a))(if(= e 1)(setf a(mod(1+ a)(length w)))))(format t"~%"))))
</code>```

Usage:

```<code>* (m (list (list 1 0 1)
           (list 0 1 0)
           (list 1 0 1)) "ppcg")
p p
 c
g p
</code>```

This function loops through each element of each row of the grid. The format control string either prints a space if the element is a 0 or consumes the character argument if the element is 1. A newline gets printed after every row of the grid. If the string is too short, it repeats from the beginning; if it's too long, only the appropriate part gets outputted.

ContentLicense: CC BY-SA 4.0

Title: The Art of Word Shaping

Body:
Common Lisp, 152 bytes

(defun m(g w)(let((a 0))(loop for r in g do(loop for e in r do(format t"~[ ~;~c~]"e(char w a))(if(= e 1)(setf a(mod(1+ a)(length w)))))(format t"~%"))))

Usage:

* (m (list (list 1 0 1)
           (list 0 1 0)
           (list 1 0 1)) "ppcg")
p p
 c
g p

This function loops through each element of each row of the grid. The format control string either prints a space if the element is a 0 or consumes the character argument if the element is 1. A newline gets printed after every row of the grid. If the string is too short, it repeats from the beginning; if it's too long, only the appropriate part gets outputted.


答:
QBasic, 13 bytes, 10 numbers, cracked

```<code>__I_T__O_(3))
</code>```

Works for 1-10. _ is the hidden character.

Title: Code ladder, Cops

Body:
QBasic, 13 bytes, 10 numbers, cracked

__I_T__O_(3))

Works for 1-10. _ is the hidden character.


问:
Encode the column cipher
Given a string to encode, and a number of columns (the key), encode the string as follows:

I will be using the example Hello, world! and the key 3

First, write out the number of columns:

```<code>1 2 3
</code>```

Next, write the text starting from the upper left, one character per column, and when you run out of columns, go to the next line.

```<code>1 2 3
H e l
l o ,
  w o
r l d
!
</code>```

Now, to get your encoded text, read the text starting from the top left corner, but this time, first read one column, and then the next, and so on. If there is not a character in the slot, put a space.

```<code>Hl r!eowl l,od
</code>```

Note that here, there is a trailing space.

This is your encoded text.

Another test case is Programming Puzzles and Code Golf SE with key 5:

```<code>1 2 3 4 5
P r o g r
a m m i n
g   P u z
z l e s
a n d   C
o d e   G
o l f   S
E
</code>```

The encoded text is PagzaooErm lndl omPedef gius    rnz CGS.

More test cases

```<code>"abcdefghijklmnopqrstuvwxyz", 2 -> "acegikmoqsuwybdfhjlnprtvxz"
"codegolf.stackexchange.com", 4 -> "cg.ccgoooskhemdltea. efaxnc "
"Pen Pineapple Apple Pen!!!", 7 -> "PeAeeapnnpp! pl!Ple!ie  n P "
"1,1,2,3,5,8,13,21,34,55,89", 10 -> "18,,,5115,3,2,8,2931 ,, 53 ,4 "
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

答:
Python 3, 48 bytes

```<code>lambda c,k:''.join([c[i:-1:k]for i in range(k)])
</code>```

Title: Encode the column cipher

Body:
Python 3, 48 bytes

lambda c,k:''.join([c[i:-1:k]for i in range(k)])


问:
Code ladder, Robbers
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

```<code>abc1efghi
</code>```

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

Title: Code ladder, Robbers

Body:
Javascript 19 bytes 10 numbers, by Shaun H

Original:

alert((_1*1_10__1_)

Code that produces 1 - 10:

alert(( 1*1%10)/1 )
alert(( 2*1%10)/1 )
alert(( 3*1%10)/1 )
alert(( 4*1%10)/1 )
alert(( 5*1%10)/1 )
alert(( 6*1%10)/1 )
alert(( 7*1%10)/1 )
alert(( 8*1%10)/1 )
alert(( 9*1%10)/1 )
alert(( 9*1%10)+1 )


答:
Haskell, <s>54</s> 52 bytes

Thanks @Laikoni for saving two bytes.

```<code>(%)=all.flip elem
k n|[a,b]<-show<$>[n,n^3]=b%a&&a%b
</code>```

Body:
Haskell, <s>54</s> 52 bytes

Thanks @Laikoni for saving two bytes.

(%)=all.flip elem
k n|[a,b]<-show<$>[n,n^3]=b%a&&a%b


答:
Ruby, 48 bytes

```<code>->n{(f=->x{x.to_s.chars.uniq.sort})[n]==f[n**3]}
</code>```

Body:
Ruby, 48 bytes

->n{(f=->x{x.to_s.chars.uniq.sort})[n]==f[n**3]}


答:
Mathematica, 34 bytes

```<code>f=Union@*IntegerDigits;f@#==f[#^3]&
</code>```

Direct implementation (unnamed function of one integer argument).

Body:
Mathematica, 34 bytes

f=Union@*IntegerDigits;f@#==f[#^3]&

Direct implementation (unnamed function of one integer argument).


Body:
Perl, 31 + 2 (-pl flag) = <s>25</s> <s>21</s> <s>18</s> <s>34</s> 33 bytes

$_=($==$_**3)!~/[^$_]/*!/[^$=]/

Using:

perl -ple '$_=($==$_**3)!~/[^$_]/*!/[^$=]/' <<< 251894

Output: 1\n or 0\n.

Thanx to @Dada for 3 bytes, Gabriel Benamy for 1 byte, & @Zaid for bug reports.


答:
JavaScript ES6, <s>55</s> 51 bytes

Thanks to Downgoat for 3 bytes! You can save a byte by converting to ES7 and using n**3 instead of n*n*n.

```<code>n=>(f=s=>[...new Set(s+[])].sort()+[])(n)==f(n*n*n)
</code>```

Simple enough.

Body:
JavaScript ES6, <s>55</s> 51 bytes

Thanks to Downgoat for 3 bytes! You can save a byte by converting to ES7 and using n**3 instead of n*n*n.

n=>(f=s=>[...new Set(s+[])].sort()+[])(n)==f(n*n*n)

Simple enough.


答:
Jelly, 8 bytes

```<code>*3ṢQ⁼ṢQ$
</code>```

Try it online!

Explanation:

```<code>       $    # As a monadic (single argument) link:
    ⁼       # Return true if the following are equal
     ṢQ     # The unique sorted elements of 'n'
  ṢQ        # and The unique sorted elements
*3          # of 'n^3'
</code>```

Body:
Jelly, 8 bytes

*3ṢQ⁼ṢQ$

Try it online!

Explanation:

       $    # As a monadic (single argument) link:
    ⁼       # Return true if the following are equal
     ṢQ     # The unique sorted elements of 'n'
  ṢQ        # and The unique sorted elements
*3          # of 'n^3'


答:
PowerShell v2+, <s>94</s> 93 bytes

```<code>filter f($n){-join("$n"[0..99]|sort|select -u)}
(f($x=$args[0]))-eq(f("[bigint]$x*$x*$x"|iex))
</code>```

(Newline for clarity, not included in bytecount)

The first line defines f as a filter (similar-ish enough to a function for our purposes here to not go into specifics) that takes input $n and does the following:

```<code>filter f($n){-join("$n"[0..99]|sort|select -u)}
       f($n)                                    # Input
                   "$n"                         # Cast as string
                       [0..99]                  # Index as char-array
                              |sort             # Sorted alphabetically
                                   |select -u   # Only select the -Unique elements
             -join(                          )  # Join those back together into a string
                                                 # Implicit return
</code>```

The second line takes the input $args, performs f on it, and checks whether it's -equal to f performed on $x cubed. Note the explicit [bigint] cast, required else we'll get the result back in scientific notation, which will obviously not work.

The Boolean result is left on the pipeline, and output is implicit.

```<code>PS C:\Tools\Scripts\golfing> 0,1,10,107624,251894,251895,102343,106239,2103869|%{"$_ --> "+(.\do-n-n3-same-digits.ps1 $_)}
0 --> True
1 --> True
10 --> True
107624 --> True
251894 --> True
251895 --> False
102343 --> False
106239 --> False
2103869 --> True
</code>```

Saved a byte thanks to @ConnorLSW

Body:
PowerShell v2+, <s>94</s> 93 bytes

filter f($n){-join("$n"[0..99]|sort|select -u)}
(f($x=$args[0]))-eq(f("[bigint]$x*$x*$x"|iex))

(Newline for clarity, not included in bytecount)

The first line defines f as a filter (similar-ish enough to a function for our purposes here to not go into specifics) that takes input $n and does the following:

filter f($n){-join("$n"[0..99]|sort|select -u)}
       f($n)                                    # Input
                   "$n"                         # Cast as string
                       [0..99]                  # Index as char-array
                              |sort             # Sorted alphabetically
                                   |select -u   # Only select the -Unique elements
             -join(                          )  # Join those back together into a string
                                                 # Implicit return

The second line takes the input $args, performs f on it, and checks whether it's -equal to f performed on $x cubed. Note the explicit [bigint] cast, required else we'll get the result back in scientific notation, which will obviously not work.

The Boolean result is left on the pipeline, and output is implicit.

PS C:\Tools\Scripts\golfing> 0,1,10,107624,251894,251895,102343,106239,2103869|%{"$_ --> "+(.\do-n-n3-same-digits.ps1 $_)}
0 --> True
1 --> True
10 --> True
107624 --> True
251894 --> True
251895 --> False
102343 --> False
106239 --> False
2103869 --> True

Saved a byte thanks to @ConnorLSW


答:
CJam, 8 bytes

```<code>l_~3#s^!
</code>```

Test suite.

Explanation

```<code>l   e# Read input.
_~  e# Duplicate and evaluate.
3#  e# Raise to third power.
s   e# Convert back to string.
^   e# Symmetric set difference. Gives an empty list iff the two sets
    e# are equal.
!   e# Logical NOT.
</code>```

Body:
CJam, 8 bytes

l_~3#s^!

Test suite.

Explanation

l   e# Read input.
_~  e# Duplicate and evaluate.
3#  e# Raise to third power.
s   e# Convert back to string.
^   e# Symmetric set difference. Gives an empty list iff the two sets
    e# are equal.
!   e# Logical NOT.


问:
Smallest number of contiguous monotonic subsequences
A monotonic subsequence is a sequence of numbers \$a_1, a_2, ..., a_n\$ such that

$$a_1 \le a_2 \le ... \le a_n \\
\text{or} \\
a_1 \ge a_2 \ge ... \ge a_n$$

[1, 3, 3, 7, 9, 13, 13, 100] is a monotonic (non-decreasing) subsequence, as well as [9, 4, 4, 3, 0, -10, -12] (this one is non-increasing), but [1, 3, 6, 9, 8] is not. Given a list of integers (in any reasonable format), output the smallest number N such that the sequence of these integers can be split into N monotonic sequences.

Examples

```<code>[1, 3, 7, 5, 4, 2] -> [[1, 3, 7], [5, 4, 2]] -> 2
[1, 2, 3, 4, 5, 6] -> [1, 2, 3, 4, 5, 6]     -> 1
[3, 1, 5, 5, 6]    -> [[3, 1], [5, 5, 6]]    -> 2
[4, 6, 8, 9, 1, 6] -> [[4, 6, 8, 9], [1, 6]] -> 2
[3, 3, 3, 3]       -> [[3, 3, 3, 3]]         -> 1
[7]                -> [[7]]                  -> 1
[]                 -> []                     -> anything (you don't actually have to handle an empty list case)
[1, 3, 2, -1, 6, 9, 10, 2, 1, -12] -> [[1, 3], [2, -1], [6, 9, 10], [2, 1, -12]] -> 4
</code>```

答:
Perl, <s>98</s> <s>97</s> <s>96</s> 79 bytes

```<code>($a,$b)=($a<=>$b)*($b<=>$c)<0?($c,shift,$d++):($b,$c)while$c=shift;say$d+1 if$a
</code>```

Input is provided as a list of numbers, separated by spaces, provided at runtime, e.g.

```<code>perl -M5.010 monotonic.pl 1 3 2 -1 6 9 10 2 1 -12
4
</code>```

(the 4 is the output)

Readable:

```<code>($a,$b)=($a<=>$b)*($b<=>$c)<0
    ?($c,shift,$d++)
    :($b,$c)
  while$c=shift;
say$d+1
  if$a
</code>```

The 'spaceship operator' <=> returns -1 if LHS < RHS, 0 if LHS = RHS, and +1 if LHS > RHS.  When comparing three sequential elements $a,$b,$c to determine if they're monotonic, it's only necessary to determine that it's not the case that exactly one of $a<=>$b,$b<=>$c is 1 and the other is -1 -- which only happens when their product is -1.  If either $a==$b or $b==$c, then the sequence is monotonic, and the product is 0.  If $a < $b < $c, then both result in -1, and -1 * -1 = 1.  If $a > $b > $c, then they both result in 1, and 1 * 1 = 1.  In either case, the sequence is monotonic, and we wish to continue.

If the product is less than 0, we know that the sequence is not monotonic, and we discard the values of $a,$b we're currently holding, and increment our subsequence counter.  Otherwise, we move forward one number.

Returns nothing if the input is empty, otherwise returns the smallest number of contiguous monotonic subsequences

Body:
Perl, <s>98</s> <s>97</s> <s>96</s> 79 bytes

($a,$b)=($a<=>$b)*($b<=>$c)<0?($c,shift,$d++):($b,$c)while$c=shift;say$d+1 if$a

Input is provided as a list of numbers, separated by spaces, provided at runtime, e.g.

perl -M5.010 monotonic.pl 1 3 2 -1 6 9 10 2 1 -12
4

(the 4 is the output)

Readable:

($a,$b)=($a<=>$b)*($b<=>$c)<0
    ?($c,shift,$d++)
    :($b,$c)
  while$c=shift;
say$d+1
  if$a

The 'spaceship operator' <=> returns -1 if LHS < RHS, 0 if LHS = RHS, and +1 if LHS > RHS.  When comparing three sequential elements $a,$b,$c to determine if they're monotonic, it's only necessary to determine that it's not the case that exactly one of $a<=>$b,$b<=>$c is 1 and the other is -1 -- which only happens when their product is -1.  If either $a==$b or $b==$c, then the sequence is monotonic, and the product is 0.  If $a < $b < $c, then both result in -1, and -1 * -1 = 1.  If $a > $b > $c, then they both result in 1, and 1 * 1 = 1.  In either case, the sequence is monotonic, and we wish to continue.

If the product is less than 0, we know that the sequence is not monotonic, and we discard the values of $a,$b we're currently holding, and increment our subsequence counter.  Otherwise, we move forward one number.

Returns nothing if the input is empty, otherwise returns the smallest number of contiguous monotonic subsequences


问:
Huffman golfing
Write a filter that converts text from standard input to a representation of its Huffman tree on standard output.  In as few characters as possible.

you're free to consider newlines or not

output format is free, as long as it's some human-readable encoding of a tree.  s-exps, ascii-art and .png, all good.  RPN, .dot, I'll smile or frown, but that ought to be ok.  Program cores and/or raw pointers , no way.

no canonicalization needed; if the characters are at the right depth, that's good enough.

Sample possible output for "this is an example of a huffman tree" (from wikipedia):

```<code>(((e . (n . (o . u))) . (a . (t . m))) .
 (((i . (x . p)) . (h . s)) . (((r . l) . f) . #\space)))
</code>```

I can't reproduce all possible valid outputs with human-readable representation combinations in here (the margin is a bit too thin), but what should check is which characters end up at which number of bits:

3 bits: a e [space]

4 bits: f h i m n s t

5 bits: l o p r u x

If [newline] is kept in, it appears appears in the "5 bits" level, but (any) two characters have to drop from there to 6 bits.

答:
Haskell (<s>233</s> <s>228</s> 223)

Not completely shure whether it is valid.

```<code>import List
data T=Char:=Int|N T T Int
s(x:=_)=show x
s(N a b _)='(':s a++s b++")"
g(_:=a)=a
g(N _ _ a)=a
i[a]=a
i(a:b:x)=t$N a b(g a+g b):x
t=i.sortBy((.g).(compare.g))
main=interact$s.t.map(\x->x!!0:=length x).group.sort
</code>```

Outputs:

The quick, brown fox jumps over the lazy dog.

   ```((((('k''l')('i''j'))(('p''q')('m''n')))((('a''b')('.''T'))(('f''g')('c''d'))))(((('z'('x''y'))'e')((('v''w')('s''t'))'o'))((('r''u')(('\n'',')'h'))' ')))```

this is an example of a huffman tree

   ```((('a''e')(('h''i')(('o''p')('\n''l'))))((('s''t')('m''n'))((('x'('r''u'))'f')' ')))```

Output format is like in the question, but whithout whitespace and whithout , between the two arms. I assume it's human readable.

ContentLicense: CC BY-SA 2.5

Title: Huffman golfing

Body:
Haskell (<s>233</s> <s>228</s> 223)

Not completely shure whether it is valid.

import List
data T=Char:=Int|N T T Int
s(x:=_)=show x
s(N a b _)='(':s a++s b++")"
g(_:=a)=a
g(N _ _ a)=a
i[a]=a
i(a:b:x)=t$N a b(g a+g b):x
t=i.sortBy((.g).(compare.g))
main=interact$s.t.map(\x->x!!0:=length x).group.sort

Outputs:

The quick, brown fox jumps over the lazy dog.

((((('k''l')('i''j'))(('p''q')('m''n')))((('a''b')('.''T'))(('f''g')('c''d'))))(((('z'('x''y'))'e')((('v''w')('s''t'))'o'))((('r''u')(('\n'',')'h'))' ')))

this is an example of a huffman tree

((('a''e')(('h''i')(('o''p')('\n''l'))))((('s''t')('m''n'))((('x'('r''u'))'f')' ')))

Output format is like in the question, but whithout whitespace and whithout , between the two arms. I assume it's human readable.


答:
JavaScript 21 Bytes, 10 Numbers Cracked

```<code>alert(b_oa_"3____1"))
</code>```

Unrevealed characters are marked with _

Cracked

My Version:

```<code>alert(btoa|"3"&("1"))
alert(btoa|"3"^("1"))
alert(btoa|"3"^("0"))
alert(btoa|"3"^("7"))
alert(btoa|"2"^("7"))
alert(btoa|"1"^("7"))
alert(btoa|"0"^("7"))
alert(btoa|"0"^("8"))
alert(btoa|"0"^("8"))
alert(btoa|"2"^("8"))
</code>```

Title: Code ladder, Cops

Body:
Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

```<code>abc____i
</code>```

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea">

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Body:
JavaScript 21 Bytes, 10 Numbers Cracked

alert(b_oa_"3____1"))

Unrevealed characters are marked with _

Cracked

My Version:

alert(btoa|"3"&("1"))
alert(btoa|"3"^("1"))
alert(btoa|"3"^("0"))
alert(btoa|"3"^("7"))
alert(btoa|"2"^("7"))
alert(btoa|"1"^("7"))
alert(btoa|"0"^("7"))
alert(btoa|"0"^("8"))
alert(btoa|"0"^("8"))
alert(btoa|"2"^("8"))


问:
Draw diagonal lines of text
Given an input of a list of words, output the words with their letters arranged
diagonally:

```<code>p
 r
  o
p  g
 u  r
  z  a
a  z  m
 n  l  m
  d  e  i
c     s  n
 o        g
  d
g  e
 o
  l
   f
</code>```

(The above should be the output for the input programming puzzles and code golf.)

To be precise, each word starts on the first column and three rows below the
previous word, and each successive letter moves one column to the right and one
row down.

The input may be provided as either a single string of words, separated by
exactly one space, or a list/array of words. The words will only be composed of
lowercase letters, a-z, and will always be at least one character long.

The output may be a single string, an array of lines, or an array of arrays of
characters. Leading or trailing whitespace is not allowed, except for a single
trailing newline.

Further test cases:

a bcd efgh i j

```<code>a

b
 c
  d
e
 f
  g
i  h

j
</code>```

x

```<code>x
</code>```

verylongword short

```<code>v
 e
  r
s  y
 h  l
  o  o
   r  n
    t  g
        w
         o
          r
           d
</code>```

Since this is code-golf, the shortest code in bytes will win!

答:
C#, 336 Bytes:

Golfed:

```<code>string D(string[]s){int x=0,y=0,r=0,q=2*(s.Max().Length+s.Length)+1;var a=new char[q, q];for(int i=0;i<s.Length;i++){y=r;for(int j=0;j<s[i].Length;j++){a[y,x]=s[i][j];x+=1;y+=1;}x=0;r+=3;}var o="";for(x=0;x<q;x++){var t="";for(y=0;y<q;y++)t+=a[x,y];o+=t==string.Join("",Enumerable.Repeat('\0',q))?"":(t.TrimEnd('\0')+"\r\n");}return o;}
</code>```

Ungolfed:

```<code>public string D(string[] s)
{
  int x = 0, y = 0, r = 0, q = 2 * (s.Max().Length + s.Length) + 1;
  var a = new char[q, q];
  for (int i = 0; i < s.Length; i++)
  {
    y = r;
    for (int j = 0; j < s[i].Length; j++)
    {
      a[y, x] = s[i][j];
      x += 1;
      y += 1;
    }
    x = 0;
    r +=3;
  }
  var o = "";
  for (x = 0; x < q; x++)
  {
    var t = "";
    for (y = 0; y < q; y++)
      t += a[x, y];
    o += t == string.Join("", Enumerable.Repeat('\0', q)) ? "" : (t.TrimEnd('\0') + "\r\n");
  }
  return o;
}
</code>```

Testing:

```<code>  var codeGolf = new DrawDiagonalLinesOfText();
  Console.WriteLine(codeGolf.E(new string[] { "programming", "puzzles", "and", "code", "golf" }));
  Console.WriteLine(codeGolf.E(new string[] { "a", "bcd", "efgh", "i", "j" }));
  Console.WriteLine(codeGolf.E(new string[] { "verylongword", "short" }));

p
 r
  o
p  g
 u  r
  z  a
a  z  m
 n  l  m
  d  e  i
c     s  n
 o        g
  d
g  e
 o
  l
   f

a
b
 c
  d
e
 f
  g
i  h
j

v
 e
  r
s  y
 h  l
  o  o
   r  n
    t  g
        w
         o
          r
           d
</code>```

Title: Draw diagonal lines of text

Body:
C#, 336 Bytes:

Golfed:

string D(string[]s){int x=0,y=0,r=0,q=2*(s.Max().Length+s.Length)+1;var a=new char[q, q];for(int i=0;i<s.Length;i++){y=r;for(int j=0;j<s[i].Length;j++){a[y,x]=s[i][j];x+=1;y+=1;}x=0;r+=3;}var o="";for(x=0;x<q;x++){var t="";for(y=0;y<q;y++)t+=a[x,y];o+=t==string.Join("",Enumerable.Repeat('\0',q))?"":(t.TrimEnd('\0')+"\r\n");}return o;}

Ungolfed:

public string D(string[] s)
{
  int x = 0, y = 0, r = 0, q = 2 * (s.Max().Length + s.Length) + 1;
  var a = new char[q, q];
  for (int i = 0; i < s.Length; i++)
  {
    y = r;
    for (int j = 0; j < s[i].Length; j++)
    {
      a[y, x] = s[i][j];
      x += 1;
      y += 1;
    }
    x = 0;
    r +=3;
  }
  var o = "";
  for (x = 0; x < q; x++)
  {
    var t = "";
    for (y = 0; y < q; y++)
      t += a[x, y];
    o += t == string.Join("", Enumerable.Repeat('\0', q)) ? "" : (t.TrimEnd('\0') + "\r\n");
  }
  return o;
}

Testing:

  var codeGolf = new DrawDiagonalLinesOfText();
  Console.WriteLine(codeGolf.E(new string[] { "programming", "puzzles", "and", "code", "golf" }));
  Console.WriteLine(codeGolf.E(new string[] { "a", "bcd", "efgh", "i", "j" }));
  Console.WriteLine(codeGolf.E(new string[] { "verylongword", "short" }));

p
 r
  o
p  g
 u  r
  z  a
a  z  m
 n  l  m
  d  e  i
c     s  n
 o        g
  d
g  e
 o
  l
   f

a
b
 c
  d
e
 f
  g
i  h
j

v
 e
  r
s  y
 h  l
  o  o
   r  n
    t  g
        w
         o
          r
           d


答:
Pyke, 10 bytes

```<code>3^`}SR`}Sq
</code>```

Try it here!

Body:
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.

For example, let's check the number 100.

1003 is 1000000.

The set of digits in 100 is {0, 1}.

The set of digits in 1000000 is {0, 1}.

Therefore, 100 should give a truthy value.

Test cases

```<code>0 -> True
1 -> True
10 -> True
107624 -> True
251894 -> True
251895 -> False
102343 -> False
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

OEIS A029795

Body:
Pyke, 10 bytes

3^`}SR`}Sq

Try it here!


Title: The Art of Word Shaping

Body:
The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

Body:
ES6, 78 bytes

  (a,b,x=0)=>(b.map(r=>r.map(i=>i?a[x++%a.length]:' ')+'\n')+'').replace(/,/g,'')

I tried


答:
C#, <s>241</s> <s>208</s> <s>205</s> <s>201</s> <s>193</s> <s>233</s> <s>222</s> <s>220</s> <s>212</s> <s>203</s> <s>177</s> 159 bytes (109 alternate)

```<code>I=>{x=s=>{var a=new int[10];foreach(var h in s+"")a[h-'0']++;return a;};var i=x(I);var j=x(I*I*I);for(var k=0;k<10;)if(i[k]>0^j[k++]>0)return 0>1;return 1>0;};
</code>```

The lambda's must specifically use the ulong type:

```<code>System.Func<ulong, bool> b; // = I=>{...};
System.Func<ulong, int[]> x; // inner lambda
</code>```

Thanks to @Corak and @Dennis_E for saving some bytes, and @TimmyD for finding a problem with my original solution.  Thanks to @SaxxonPike for pointing out the ulong/long/decimal/etc problem (which actually also saved me some bytes).

There is also a 109 byte solution using HashSets, similar to the Java answers here, but I'm going to stick to my original solution for my score.

```<code>using System.Collections.Generic;I=>{return new HashSet<char>(I+"").SetEquals(new HashSet<char>(I*I*I+""));};
</code>```

Body:
C#, <s>241</s> <s>208</s> <s>205</s> <s>201</s> <s>193</s> <s>233</s> <s>222</s> <s>220</s> <s>212</s> <s>203</s> <s>177</s> 159 bytes (109 alternate)

I=>{x=s=>{var a=new int[10];foreach(var h in s+"")a[h-'0']++;return a;};var i=x(I);var j=x(I*I*I);for(var k=0;k<10;)if(i[k]>0^j[k++]>0)return 0>1;return 1>0;};

The lambda's must specifically use the ulong type:

System.Func<ulong, bool> b; // = I=>{...};
System.Func<ulong, int[]> x; // inner lambda

Thanks to @Corak and @Dennis_E for saving some bytes, and @TimmyD for finding a problem with my original solution.  Thanks to @SaxxonPike for pointing out the ulong/long/decimal/etc problem (which actually also saved me some bytes).

There is also a 109 byte solution using HashSets, similar to the Java answers here, but I'm going to stick to my original solution for my score.

using System.Collections.Generic;I=>{return new HashSet<char>(I+"").SetEquals(new HashSet<char>(I*I*I+""));};


答:
Java 8, 154 characters

```<code>a->java.util.Arrays.equals((a+"").chars().distinct().sorted().toArray(),(new java.math.BigInteger(a+"").pow(3)+"").chars().distinct().sorted().toArray());
</code>```

Called like this:

```<code>interface Y {
    boolean n(int x);
}

static Y y = a->java.util.Arrays.equals((a+"").chars().distinct().sorted().toArray(),(new java.math.BigInteger(a+"").pow(3)+"").chars().distinct().sorted().toArray());

public static void main(String[] args) {
    System.out.println(y.n(0));
    System.out.println(y.n(1));
    System.out.println(y.n(10));
    System.out.println(y.n(107624));
    System.out.println(y.n(251894));
    System.out.println(y.n(251895));
    System.out.println(y.n(102343));
}
</code>```

Outputs:

```<code>true
true
true
true
true
false
false
</code>```

A very Java 8-y answer, using a lambda as well as streams including some fancy number-to-string conversions.

Unfortunately we need to use BigInteger.pow(3) instead of Math.pow(a,3) due to Math.pow using non-precise doubles, which return incorrect values with large numbers (starting with 2103869).

Body:
Java 8, 154 characters

a->java.util.Arrays.equals((a+"").chars().distinct().sorted().toArray(),(new java.math.BigInteger(a+"").pow(3)+"").chars().distinct().sorted().toArray());

Called like this:

interface Y {
    boolean n(int x);
}

static Y y = a->java.util.Arrays.equals((a+"").chars().distinct().sorted().toArray(),(new java.math.BigInteger(a+"").pow(3)+"").chars().distinct().sorted().toArray());

public static void main(String[] args) {
    System.out.println(y.n(0));
    System.out.println(y.n(1));
    System.out.println(y.n(10));
    System.out.println(y.n(107624));
    System.out.println(y.n(251894));
    System.out.println(y.n(251895));
    System.out.println(y.n(102343));
}

Outputs:

true
true
true
true
true
false
false

A very Java 8-y answer, using a lambda as well as streams including some fancy number-to-string conversions.

Unfortunately we need to use BigInteger.pow(3) instead of Math.pow(a,3) due to Math.pow using non-precise doubles, which return incorrect values with large numbers (starting with 2103869).


答:
Pyth, <s>11</s> 10 bytes

It was difficult for me to find a function to convert to a string while searching the online tutorial. I just guessed ` and was right. I suppose this site is better for searching.

```<code>q.{`^Q3.{`
</code>```

Try it online

Explanation

```<code>     Q          evaluated input (implicit Q at the end as well)
    ^  3        cubed
   `      `     str() - it's actually repr, but doesn't have an 'L' at the end of longs
 .{     .{      convert each string to set()
q               check if equal
                implicit print
</code>```

Body:
Pyth, <s>11</s> 10 bytes

It was difficult for me to find a function to convert to a string while searching the online tutorial. I just guessed ` and was right. I suppose this site is better for searching.

q.{`^Q3.{`

Try it online

Explanation

     Q          evaluated input (implicit Q at the end as well)
    ^  3        cubed
   `      `     str() - it's actually repr, but doesn't have an 'L' at the end of longs
 .{     .{      convert each string to set()
q               check if equal
                implicit print


答:
PowerShell v2+, 70 bytes

```<code>param($a,$b)$b|%{-join($_|%{if($_){$a[$n++];$n%=$a.length}else{' '}})}
</code>```

Takes input word as $a and the matrix as an array-of-arrays as $b (see examples below). Loops through $b, then loops through the elements of each row $_|%{...}. Inner loop is an if/else condition, where we either output $a[$n++] and take mod-equal to the length of the string, or output a space ' '. Those are -joined together back into a string. Each of the strings is left on the pipeline, and implicit output with newlines between happens via Write-Output at program completion.

```<code>PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'PPCGPPCG' @(@(0,0,1,0,0),@(0,1,0,1,0),@(1,0,0,0,1),@(0,1,0,1,0),@(0,0,1,0,0))
  P
 P C
G   P
 P C
  G

PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'lambda' @(@(1,0,0),@(0,1,0),@(1,0,1))
l
 a
m b

PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'PPCG' @(@(1,1,1),@(1,0,1),@(1,1,1))
PPC
G P
PCG
</code>```

Title: The Art of Word Shaping

Body:
PowerShell v2+, 70 bytes

param($a,$b)$b|%{-join($_|%{if($_){$a[$n++];$n%=$a.length}else{' '}})}

Takes input word as $a and the matrix as an array-of-arrays as $b (see examples below). Loops through $b, then loops through the elements of each row $_|%{...}. Inner loop is an if/else condition, where we either output $a[$n++] and take mod-equal to the length of the string, or output a space ' '. Those are -joined together back into a string. Each of the strings is left on the pipeline, and implicit output with newlines between happens via Write-Output at program completion.

PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'PPCGPPCG' @(@(0,0,1,0,0),@(0,1,0,1,0),@(1,0,0,0,1),@(0,1,0,1,0),@(0,0,1,0,0))
  P
 P C
G   P
 P C
  G

PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'lambda' @(@(1,0,0),@(0,1,0),@(1,0,1))
l
 a
m b

PS C:\Tools\Scripts\golfing> .\the-art-of-word-shaping.ps1 'PPCG' @(@(1,1,1),@(1,0,1),@(1,1,1))
PPC
G P
PCG


答:
Java, 126 bytes, 10 numbers, masterX244

Yes we have seen Unicode escapes many times here at PPCG.

```<code>cl\u0061ss Z\u007bpublic st\u0061tic void main(String[]a){System. out.print(/*_"___42*/0+1/*_00____00____".*/)/*______0)_*/;}}
</code>```

s/0+1/1+1/ ... 9+1.

Title: Code ladder, Robbers

Body:
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

```<code>abc1efghi
</code>```

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

Body:
Java, 126 bytes, 10 numbers, masterX244

Yes we have seen Unicode escapes many times here at PPCG.

cl\u0061ss Z\u007bpublic st\u0061tic void main(String[]a){System. out.print(/*_"___42*/0+1/*_00____00____".*/)/*______0)_*/;}}

s/0+1/1+1/ ... 9+1.


答:
Python 3, 19 bytes, 10 numbers, Sp3000

Newlines are a real bummer.

```<code>print(##bin()

0+1)
</code>```

0+1 ... 9+1.

Title: Code ladder, Robbers

Body:
Python 3, 19 bytes, 10 numbers, Sp3000

Newlines are a real bummer.

print(##bin()

0+1)

0+1 ... 9+1.


答:
Python 2, <s>114</s> 71 bytes

Turns out I was re-inventing the wheel, a simple double replace on a multiline string works quite well.  The string has the additional benefit of being able to count zeros directly rather than having to do the really ugly s*len(L)*len(L[0]) for a nested list

```<code>lambda S,s:S.replace("0"," ").replace("1","{}").format(*s*S.count('0'))
</code>```

Old solution:

```<code>lambda s,L:"\n".join(["".join(map(lambda n:chr(n+32),l)).replace("!","{}")for l in L]).format(*s*len(L)*len(L[0]))
</code>```

First we convert everything + 32 with chr (all zeros become spaces), then we replace all of the ! with {} to allow using the format function.

<s>If NULL can be counted as a space</s> If I decide to cheat and use NULL instead of space, I can skip the addition of 32 to save 12 bytes. (print displays '\x00' as a space)

```<code>lambda s,L:"\n".join(["".join(map(chr,l)).replace('\x01','{}')for l in L]).format(*s*len(L)*len(L[0]))
</code>```

Title: The Art of Word Shaping

Body:
Python 2, <s>114</s> 71 bytes

Turns out I was re-inventing the wheel, a simple double replace on a multiline string works quite well.  The string has the additional benefit of being able to count zeros directly rather than having to do the really ugly s*len(L)*len(L[0]) for a nested list

lambda S,s:S.replace("0"," ").replace("1","{}").format(*s*S.count('0'))

Old solution:

lambda s,L:"\n".join(["".join(map(lambda n:chr(n+32),l)).replace("!","{}")for l in L]).format(*s*len(L)*len(L[0]))

First we convert everything + 32 with chr (all zeros become spaces), then we replace all of the ! with {} to allow using the format function.

<s>If NULL can be counted as a space</s> If I decide to cheat and use NULL instead of space, I can skip the addition of 32 to save 12 bytes. (print displays '\x00' as a space)

lambda s,L:"\n".join(["".join(map(chr,l)).replace('\x01','{}')for l in L]).format(*s*len(L)*len(L[0]))


答:
C++, 82 bytes

```<code>t(int a){int b=a*a*a,c,d;while(a|b)c|=1<<a%10,a/=10,d|=1<<b%10,b/=10;return c==d;}
</code>```

The function t(a) returns the answer. Uses an int as a set. Printed nicely:

```<code>t(int a)
{
    int b = a*a*a, c, d;
    while(a|b) c|=1 << a%10, a/=10, d|=1 << b%10, b/=10;
    return c==d;
}
</code>```

Body:
C++, 82 bytes

t(int a){int b=a*a*a,c,d;while(a|b)c|=1<<a%10,a/=10,d|=1<<b%10,b/=10;return c==d;}

The function t(a) returns the answer. Uses an int as a set. Printed nicely:

t(int a)
{
    int b = a*a*a, c, d;
    while(a|b) c|=1 << a%10, a/=10, d|=1 << b%10, b/=10;
    return c==d;
}


问:
Walk the words!
It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!

Walking words

Walking words are words which will respond to certain characters. For the purpose of this challenge the trigger characters are [u, d, r, l] from up down right left.

Whenever you encounter such a character when printing text, you will move the direction of the text.

For example, the text abcdef will result in:

```<code>abcd
   e
   f
</code>```

Rules

Both uppercase UDRL and lowercase udrl should change the direction, but case should be preserved in the output

Input will only contain printable characters (0-9, A-Z, a-z, !@#%^&*() etc...), no newlines!

Whenever the text will collide, it will overwrite the old character at that position

Output should be presented to the user in any fashionable matter, but it should be a single output (no array of lines)

Trailing and leading newlines are allowed

Trailing spaces are allowed

Standard loopholes apply

Test cases

```<code>empty input => empty output or a newline

u =>
u

abc =>
abc

abcd =>
abcd

abcde =>
abcd
   e

abcdde =>
abcd
   d
   e

codegolf and programming puzzles =>
   cod
     e
     g
     o
dna fl    sel
            z
p           z
rogramming pu

ABCDELFUGHI =>
 I
AHCD
 G E
 UFL

It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>
dnats taht noinipo el
a                   b
rd                  m
       It is in my hu
 t
 e
 x
 t

 i
 s

 b
 o
 ring. Therefore I propose a new writing stand
                                             a
                                             rd
                                              ,

                                              w
                                              a
                                      rdw gnikl
                                       s
                                       !
</code>```

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

答:
Swift 3, 283 bytes

```<code>func w(a:String){var t=a.characters,d=t.count,c=Array(repeating:Array(repeating:" ",count:d*2),count:d*2),i=d,j=d,l=["d":(1,0),"u":(-1,0),"l":(0,-1),"r":(0,1)],e=(0,1)
t.map{c[i][j]="\($0)"
e=l["\($0)".lowercased()] ?? e
i+=e.0
j+=e.1}
c.map{$0.map{print($0,terminator:"")};print()}}
</code>```

Ungolfed

```<code>func w(a:String){
    var t=a.characters,d=t.count,c=Array(repeating:Array(repeating:" ",count:d*2),count:d*2),i=d,j=d,l=["d":(1,0),"u":(-1,0),"l":(0,-1),"r":(0,1)],e=(0,1)
    t.map{
        c[i][j]="\($0)"
        e=l["\($0)".lowercased()] ?? e
        i+=e.0
        j+=e.1
    }
    c.map{
        $0.map{
            print($0,terminator:"")
        };
        print()
    }
}
</code>```

Warning

Longer input will requires bigger screen. Output has no treatment for "empty" row/columns as I understood that is acceptable by the rules of the challenge.

Rant

Newline being the default terminator for print sux

No simple way of creating an array of known length destroyed the score.

Title: Walk the words!

Body:
Swift 3, 283 bytes

func w(a:String){var t=a.characters,d=t.count,c=Array(repeating:Array(repeating:" ",count:d*2),count:d*2),i=d,j=d,l=["d":(1,0),"u":(-1,0),"l":(0,-1),"r":(0,1)],e=(0,1)
t.map{c[i][j]="\($0)"
e=l["\($0)".lowercased()] ?? e
i+=e.0
j+=e.1}
c.map{$0.map{print($0,terminator:"")};print()}}

Ungolfed

func w(a:String){
    var t=a.characters,d=t.count,c=Array(repeating:Array(repeating:" ",count:d*2),count:d*2),i=d,j=d,l=["d":(1,0),"u":(-1,0),"l":(0,-1),"r":(0,1)],e=(0,1)
    t.map{
        c[i][j]="\($0)"
        e=l["\($0)".lowercased()] ?? e
        i+=e.0
        j+=e.1
    }
    c.map{
        $0.map{
            print($0,terminator:"")
        };
        print()
    }
}

Warning

Longer input will requires bigger screen. Output has no treatment for "empty" row/columns as I understood that is acceptable by the rules of the challenge.

Rant

Newline being the default terminator for print sux

No simple way of creating an array of known length destroyed the score.


Title: The Art of Word Shaping

Body:
Groovy, 63

{a,b->i=0;a.replaceAll("1",{b[i++%b.size()]}).replace("0"," ")}


问:
Shortest code to determine if a string is a palindrome
A palindrome is some string that is spelled the same way both backwards and forwards.  For instance, 'Eva, can I stab bats in a cave?' is a palindrome (EVACANISTAB | BATSINACAVE)

For this code golf, using the language of your choice, determine if a given string is a palindrome or not.

Edge Cases:

Punctuation is not counted towards palindrominess.

Control characters are not counted towards palindrominess.

Whitespace is not counted towards palindrominess.

Numbers are counted towards palindrominess.

Case in this challenge is not counted towards palindrominess.

There is no limit to the length of strings to evaluate, except for what is imposed by your language of choice.

For this challenge, limit yourself to the ASCII character set.

Technical Requirements:

Only method bodies are needed; additional things like method signatures, data structure declarations, etc. do not count towards the victory requirement.

Code must compile or interpret without compile-time errors or exceptions.

Code must not throw any unhandled exceptions or crash.  (Almost needless to say.  Almost.)

Code must return some value indicating palindrominess.  The data type depends on the language you use (e.g. a C# user might use a bool, whereas a JavaScript user could use a var.)

You may not write your own interpreter that performs this task as a 'native' capability so you can 'golf' a near-winning score.  (Hopefully needless to say.)

Victory Condition:

The shortest code in characters wins.

Current Leader: tmartin (k, 25 characters)

...Want the magic green check mark by your answer?  Beat this guy's answer!

答:
C++, 74 bytes

This code is actually really elegant, and easy to understand (when formatted correctly). I don't believe it's possible to get any shorter in C++, and it doesn't use any standard library functions.

```<code>p(auto c){auto e=c;while(*e)++e;--e;while(*e==*c&e>c)--e,++c;return e<=c;}
</code>```

Example usage:

```<code>p("Hello"); //Outputs 0
p(""); //Outputs 1
p("a"); //Outputs 1
p("HellolleH"); //Outputs 1
</code>```

Nicely formatted version:

```<code>p(auto c)
{
    auto e=c;
    while(*e) ++e;
    --e;
    while(*e==*c & e>c)--e,++c;
    return e<=c;
}
</code>```

Body:
C++, 74 bytes

This code is actually really elegant, and easy to understand (when formatted correctly). I don't believe it's possible to get any shorter in C++, and it doesn't use any standard library functions.

p(auto c){auto e=c;while(*e)++e;--e;while(*e==*c&e>c)--e,++c;return e<=c;}

Example usage:

p("Hello"); //Outputs 0
p(""); //Outputs 1
p("a"); //Outputs 1
p("HellolleH"); //Outputs 1

Nicely formatted version:

p(auto c)
{
    auto e=c;
    while(*e) ++e;
    --e;
    while(*e==*c & e>c)--e,++c;
    return e<=c;
}


答:
JavaScript, 21 Bytes, 10 Numbers, Shaun H

Original:

alert(b_oa_"3____1"))
```
<p>First:</p>
<pre class="lang-js prettyprint-override"><code>alert(btoa|"3"&("1"))
</code>```

Then:

alert(btoa|"3"-("1"))
alert(btoa|"3"-("0"))
alert(btoa|"4"-("0"))
alert(btoa|"5"-("0"))
alert(btoa|"6"-("0"))
alert(btoa|"7"-("0"))
alert(btoa|"8"-("0"))
alert(btoa|"9"-("0"))
alert(btoa|"9"-(~"0"))
```
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>//Using console.log instead of alert

console.log(btoa|"3"&("1"))
console.log(btoa|"3"-("1"))
console.log(btoa|"3"-("0"))
console.log(btoa|"4"-("0"))
console.log(btoa|"5"-("0"))
console.log(btoa|"6"-("0"))
console.log(btoa|"7"-("0"))
console.log(btoa|"8"-("0"))
console.log(btoa|"9"-("0"))
console.log(btoa|"9"-(~"0"))</code>```

Title: Code ladder, Robbers

Body:
JavaScript, 21 Bytes, 10 Numbers, Shaun H

Original:

alert(b_oa_"3____1"))

First:

alert(btoa|"3"&("1"))

Then:

alert(btoa|"3"-("1"))
alert(btoa|"3"-("0"))
alert(btoa|"4"-("0"))
alert(btoa|"5"-("0"))
alert(btoa|"6"-("0"))
alert(btoa|"7"-("0"))
alert(btoa|"8"-("0"))
alert(btoa|"9"-("0"))
alert(btoa|"9"-(~"0"))

//Using console.log instead of alert

console.log(btoa|"3"&("1"))
console.log(btoa|"3"-("1"))
console.log(btoa|"3"-("0"))
console.log(btoa|"4"-("0"))
console.log(btoa|"5"-("0"))
console.log(btoa|"6"-("0"))
console.log(btoa|"7"-("0"))
console.log(btoa|"8"-("0"))
console.log(btoa|"9"-("0"))
console.log(btoa|"9"-(~"0"))


答:
Haskell, 47 bytes

n%p=[c|c<-['0'..],elem c$show$n^p]
f n=n%1==n%3
```

Very slow. Test with c<-['0'..'9'].

Tests every character for inclusion in the string representation of n, and makes a list of those included. Does likewise for n^3 and checks if the lists are equal.

Body:
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.

For example, let's check the number 100.

1003 is 1000000.

The set of digits in 100 is {0, 1}.

The set of digits in 1000000 is {0, 1}.

Therefore, 100 should give a truthy value.

Test cases

```<code>0 -> True
1 -> True
10 -> True
107624 -> True
251894 -> True
251895 -> False
102343 -> False
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

OEIS A029795

Body:
Haskell, 47 bytes

n%p=[c|c<-['0'..],elem c$show$n^p]
f n=n%1==n%3

Very slow. Test with c<-['0'..'9'].

Tests every character for inclusion in the string representation of n, and makes a list of those included. Does likewise for n^3 and checks if the lists are equal.


答:
Java, 237 233 Bytes

Edit: saved 4 Bytes thanks to Mukul Kumar

Golfed:

```<code>String T(int[][]m,String b){int l=m.length,a=0;String o="";for(int i=0;i<l;i++){for(int j=0;j<l;j++){if(m[i][j]==1&&a<b.length()){o+=Character.toString(b.toCharArray()[a]);a++;if(a== b.length()-1)a=0;}else o+=" ";}o+="\n";}return o;}
</code>```

Ungolfed:

```<code>public String T(int[][] m, String b) {
    int l = m.length,a=0;
    String o = "";
    for(int i = 0; i < l; i++)
    {
        for(int j = 0; j < l; j++)
        {
            if(m[i][j] == 1 && a < b.length())
            {
                o += Character.toString(b.toCharArray()[a]);
                a++;

                if(a == b.length() - 1)
                    a = 0;
            }
            else
             o += " ";
        }
        o += "\n";
    }
    return o;
}
</code>```

Testing:

```<code>  int[][] matrix = new int[][]
  {{ 0, 0, 1, 0, 0 }, { 0, 1, 0, 1, 0 },
  { 1, 0, 0, 0, 1 },{ 0, 1, 0, 1, 0 },
  { 0, 0, 1, 0, 0 },};
  TheArtOfWordShaping taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "PPCGPPCG"));

  matrix = new int[][] {{1,0,0}, {0,1,0}, {1,0, 1}};
  taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "lamda"));

  matrix = new int[][] {{1,1,1},{1,0,1},{1,1, 1}};
  taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "PPCG"));

  P
 P C
G   P
 P C
  P

l
 a
m d

PPC
P P
CPP
</code>```

Title: The Art of Word Shaping

Body:
The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

Body:
Java, 237 233 Bytes

Edit: saved 4 Bytes thanks to Mukul Kumar

Golfed:

String T(int[][]m,String b){int l=m.length,a=0;String o="";for(int i=0;i<l;i++){for(int j=0;j<l;j++){if(m[i][j]==1&&a<b.length()){o+=Character.toString(b.toCharArray()[a]);a++;if(a== b.length()-1)a=0;}else o+=" ";}o+="\n";}return o;}

Ungolfed:

public String T(int[][] m, String b) {
    int l = m.length,a=0;
    String o = "";
    for(int i = 0; i < l; i++)
    {
        for(int j = 0; j < l; j++)
        {
            if(m[i][j] == 1 && a < b.length())
            {
                o += Character.toString(b.toCharArray()[a]);
                a++;

                if(a == b.length() - 1)
                    a = 0;
            }
            else
             o += " ";
        }
        o += "\n";
    }
    return o;
}

Testing:

  int[][] matrix = new int[][]
  {{ 0, 0, 1, 0, 0 }, { 0, 1, 0, 1, 0 },
  { 1, 0, 0, 0, 1 },{ 0, 1, 0, 1, 0 },
  { 0, 0, 1, 0, 0 },};
  TheArtOfWordShaping taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "PPCGPPCG"));

  matrix = new int[][] {{1,0,0}, {0,1,0}, {1,0, 1}};
  taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "lamda"));

  matrix = new int[][] {{1,1,1},{1,0,1},{1,1, 1}};
  taows = new TheArtOfWordShaping();
  System.out.println(taows.T(matrix, "PPCG"));

  P
 P C
G   P
 P C
  P

l
 a
m d

PPC
P P
CPP


问:
Smile! Just smile
It's well known that Brainf*ck is very bad at Kolmogorov-complexity problems, for example, it requires around 100 characters just to print "Hello world".

However, there might be texts where Brainf*ck is just very good at.

Your task is now to write a program that takes no input, and it displays the following:

```<code>☺
</code>```

That is, a smiley face (ASCII 1, if you browser does not render it).

Brainf*ck can do it in 2 characters.

```<code>+.
</code>```

Try to find a language that beats it!

We assume your console can actually display that character (or your font has it, etc.).

Shortest code wins. If there are more of the same length, the first wins, but I'll upvote the others as well.

EDIT: I'm very sorry, I did not think the first post arrives this soon. A quick edit: the language has to be Turing-complete!

答:
JavaScript, 10 Bytes

```<code>alert("☺")
</code>```

Title: Smile! Just smile

Body:
JavaScript, 10 Bytes

alert("☺")


答:
Pyth - 9 bytes

Hopefully can take another char off.

```<code>@I.{`^Q3`
</code>```

Test Suite.

```<code>!          Negation, tells if set is empty
 -         Setwise subtraction
  `^Q3     String repr of input^3
  `        String repr of implicit input
</code>```

Body:
Pyth - 9 bytes

Hopefully can take another char off.

@I.{`^Q3`

Test Suite.

!          Negation, tells if set is empty
 -         Setwise subtraction
  `^Q3     String repr of input^3
  `        String repr of implicit input


答:
Perl, 31 bytes - 10 numbers - Cracked by ais523

```<code>__e_$a__<__$_;1 while_$__;say$_
</code>```

_ is the hidden character.

I am not posting my solution here, because the crack is in a completely different direction from what I did, so I'll be creating a new challenge for that one.  The cracked solution is below:

```<code> $e=$a+q<1_$>;1 while!$e ;say$e  #Prints 1 (note the leading space)
 $e=$a+q<1_$>+1 while!$e ;say$e  #Prints 2
 $e=$a+q<1_$>+2 while!$e ;say$e  #Prints 3
 $e=$a+q<1_$>+3 while!$e ;say$e  #Prints 4
 $e=$a+q<1_$>+4 while!$e ;say$e  #Prints 5
 $e=$a+q<1_$>+5 while!$e ;say$e  #Prints 6
 $e=$a+q<1_$>+6 while!$e ;say$e  #Prints 7
 $e=$a+q<1_$>+7 while!$e ;say$e  #Prints 8
 $e=$a+q<1_$>+8 while!$e ;say$e  #Prints 9
 $e=$a+q<1_$>+9 while!$e ;say$e  #Prints 10
</code>```

Title: Code ladder, Cops

Body:
Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

```<code>abc____i
</code>```

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea">

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Body:
Perl, 31 bytes - 10 numbers - Cracked by ais523

__e_$a__<__$_;1 while_$__;say$_

_ is the hidden character.

I am not posting my solution here, because the crack is in a completely different direction from what I did, so I'll be creating a new challenge for that one.  The cracked solution is below:

 $e=$a+q<1_$>;1 while!$e ;say$e  #Prints 1 (note the leading space)
 $e=$a+q<1_$>+1 while!$e ;say$e  #Prints 2
 $e=$a+q<1_$>+2 while!$e ;say$e  #Prints 3
 $e=$a+q<1_$>+3 while!$e ;say$e  #Prints 4
 $e=$a+q<1_$>+4 while!$e ;say$e  #Prints 5
 $e=$a+q<1_$>+5 while!$e ;say$e  #Prints 6
 $e=$a+q<1_$>+6 while!$e ;say$e  #Prints 7
 $e=$a+q<1_$>+7 while!$e ;say$e  #Prints 8
 $e=$a+q<1_$>+8 while!$e ;say$e  #Prints 9
 $e=$a+q<1_$>+9 while!$e ;say$e  #Prints 10


问:
Print numbers from 1 to 10
This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet:

Print all Integers from 1 to 10 inclusive in ascending order to standard output.

Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than 1 through 10. Your program may not take any input. Standard loopholes are disallowed.

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

Leaderboard

var QUESTION_ID=86075,OVERRIDE_USER=42570;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
TrumpScript, 45 bytes

```<code>Say "1 2 3 4 5 6 7 8 9 10"!
America is great.
</code>```

Don't even try using a loop... it's much much longer.

Edit: to clarify, TrumpScript uses only numbers greater than 1,000,000, so counting from 1 to 10 would require a lot of variables.

Title: Print numbers from 1 to 10

Body:
TrumpScript, 45 bytes

Say "1 2 3 4 5 6 7 8 9 10"!
America is great.

Don't even try using a loop... it's much much longer.

Edit: to clarify, TrumpScript uses only numbers greater than 1,000,000, so counting from 1 to 10 would require a lot of variables.


答:
R, 21 bytes, 10 numbers Cracked

```<code>__i___________i______
</code>```

Works for 10 numbers. _ is hidden character.

Original solution:

 which(letters%in%"a")

 which(letters%in%"b")

 etc.

Title: Code ladder, Cops

Body:
R, 21 bytes, 10 numbers Cracked

__i___________i______

Works for 10 numbers. _ is hidden character.

Original solution:

 which(letters%in%"a")

 which(letters%in%"b")

 etc.


答:
Lua, 55 bytes

Takes input on the command line.
Makes n into a character class and tests the string n ^ 3 against it.

```<code>a=arg[1]print(not("%u"):format(a^3):find("[^"..a.."]"))
</code>```

Body:
Lua, 55 bytes

Takes input on the command line.
Makes n into a character class and tests the string n ^ 3 against it.

a=arg[1]print(not("%u"):format(a^3):find("[^"..a.."]"))


答:
Lithp, 64 bytes

```<code>((import "lists")(def f #::((each (seq 1 10) #N::((print N))))))
</code>```

Fairly simple, but unfortunately fairly verbose. I'm counting the import because modules don't automatically load (ie, each and seq are from the lists module, and need to be imported manually.)

To use:

```<code>(
    (import "lists")(def f #::((each (seq 1 10) #N::((print N)))))
    (f)
)
</code>```

Alternate Answer, 68 bytes, recursive and no modules

```<code>(def x #::((def y #N::((print N)(if (< N 10) ((y (+ N 1))))))(y 1)))
</code>```

Defines a recursive function y which calls itself until N is 10.

I've made this a little more readable here:

```<code>(
    (def x #::(
        (def y #N::(
            (print N)
            (if (< N 10) (
                (y (+ N 1))
            ))
        ))
        (y 1)
    ))
    (x)
)
</code>```

Sadly my language is a bit verbose, but Lisp-like language tend to do that. I'm more interested in ensuring the language can handle everything I'd want to throw at it.

Title: Print numbers from 1 to 10

Body:
This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet:

Print all Integers from 1 to 10 inclusive in ascending order to standard output.

Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than 1 through 10. Your program may not take any input. Standard loopholes are disallowed.

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

Leaderboard

var QUESTION_ID=86075,OVERRIDE_USER=42570;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Lithp, 64 bytes

((import "lists")(def f #::((each (seq 1 10) #N::((print N))))))

Fairly simple, but unfortunately fairly verbose. I'm counting the import because modules don't automatically load (ie, each and seq are from the lists module, and need to be imported manually.)

To use:

(
    (import "lists")(def f #::((each (seq 1 10) #N::((print N)))))
    (f)
)

Alternate Answer, 68 bytes, recursive and no modules

(def x #::((def y #N::((print N)(if (< N 10) ((y (+ N 1))))))(y 1)))

Defines a recursive function y which calls itself until N is 10.

I've made this a little more readable here:

(
    (def x #::(
        (def y #N::(
            (print N)
            (if (< N 10) (
                (y (+ N 1))
            ))
        ))
        (y 1)
    ))
    (x)
)

Sadly my language is a bit verbose, but Lisp-like language tend to do that. I'm more interested in ensuring the language can handle everything I'd want to throw at it.


答:
Factor, 37 bytes

```<code>[ dup 3 ^ [ 10 >base unique ] bi@ = ]
</code>```

(passing) Tests:

```<code>: func ( x -- ? ) dup 3 ^ [ number>string unique ] bi@ = ;
{ t } [ 0 func ] unit-test
{ t } [ 1 func ] unit-test
{ t } [ 10 func ] unit-test
{ t } [ 107624 func ] unit-test
{ t } [ 251894 func ] unit-test
{ f } [ 251895 func ] unit-test
{ f } [ 102343 func ] unit-test
</code>```

Body:
Factor, 37 bytes

[ dup 3 ^ [ 10 >base unique ] bi@ = ]

(passing) Tests:

: func ( x -- ? ) dup 3 ^ [ number>string unique ] bi@ = ;
{ t } [ 0 func ] unit-test
{ t } [ 1 func ] unit-test
{ t } [ 10 func ] unit-test
{ t } [ 107624 func ] unit-test
{ t } [ 251894 func ] unit-test
{ f } [ 251895 func ] unit-test
{ f } [ 102343 func ] unit-test


答:
R, 22 bytes, 10 numbers, Cracked

```<code>_et_______)____is_____
</code>```

_ is a hidden character.

See the redux version.

Title: Code ladder, Cops

Body:
R, 22 bytes, 10 numbers, Cracked

_et_______)____is_____

_ is a hidden character.

See the redux version.


问:
The shortest code to invert bit-wise a binary string
Me thinks there aren't enough easy questions on here that beginners can attempt!

The challenge: Given a random input string of 1's and 0's such as:

```<code>10101110101010010100010001010110101001010
</code>```

Write the shortest code that outputs the bit-wise inverse like so:

```<code>01010001010101101011101110101001010110101
</code>```

答:
Lithp, 61 bytes + 3 for -v1 flag

```<code>#S::((replace S (regex "\\d" "g") (js-bridge #X::((^ X 1)))))
</code>```

Requires the -v1 flag to run.js, as js-bridge is not part of the standard library yet.

Exploits the JavaScript's String.replace function by passing a bridge function, allowing Lithp code to handle the replacement.

Usage:

```<code>(
    (def i #S::((replace S (regex "\\d" "g") (js-bridge #N::((^ N 1))))))
    (print (i "01010101111000"))
)
</code>```

Body:
Lithp, 61 bytes + 3 for -v1 flag

#S::((replace S (regex "\\d" "g") (js-bridge #X::((^ X 1)))))

Requires the -v1 flag to run.js, as js-bridge is not part of the standard library yet.

Exploits the JavaScript's String.replace function by passing a bridge function, allowing Lithp code to handle the replacement.

Usage:

(
    (def i #S::((replace S (regex "\\d" "g") (js-bridge #N::((^ N 1))))))
    (print (i "01010101111000"))
)


问:
Fibonacci function or sequence
The Fibonacci sequence is a sequence of numbers, where every number in the sequence is the sum of the two numbers preceding it.  The first two numbers in the sequence are both 1. Here are the first few terms:

```<code>1 1 2 3 5 8 13 21 34 55 89 ...
</code>```

Write the shortest code that either:

Generates the Fibonacci sequence without end.

Given n calculates the nth term of the sequence. (Either 1 or zero indexed)

You may use standard forms of input and output.

(I gave both options in case one is easier to do in your chosen language than the other.)

For the function that takes an n, a reasonably large return value (the largest Fibonacci number that fits your computer's normal word size, at a minimum) has to be supported.

Leaderboard

/* Configuration */

var QUESTION_ID = 85; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 3; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Prismatic, 113 bytes (can be smaller)

```<code>right wideness wideness left forward up vertex longness backward right vertex tallness forward down vertex vertex
</code>```

Inspired by Brainfuck, Cubix and Hexagony.

Title: Fibonacci function or sequence

Body:
Prismatic, 113 bytes (can be smaller)

right wideness wideness left forward up vertex longness backward right vertex tallness forward down vertex vertex

Inspired by Brainfuck, Cubix and Hexagony.


答:
Perl, 65 bytes

62 bytes of code + 3 bytes for -n flag.

monot_seq.pl :

```<code>#!perl -n
s/\S+ /($_<=>$&)*($&<=>$')-$g>=0?$g=1:$.++;$g--;$_=$&/ge,$_=$.
</code>```

Give the input without final newline, with the numbers separated by spaces :

```<code>$ echo -n "1 3 2 -1 6 9 10 2 1 -12" | perl -M5.010 monot_seq.pl
4
</code>```

-5 bytes thanks to @Gabriel Benamy.

Title: Smallest number of contiguous monotonic subsequences

Body:
A monotonic subsequence is a sequence of numbers \$a_1, a_2, ..., a_n\$ such that

$$a_1 \le a_2 \le ... \le a_n \\
\text{or} \\
a_1 \ge a_2 \ge ... \ge a_n$$

[1, 3, 3, 7, 9, 13, 13, 100] is a monotonic (non-decreasing) subsequence, as well as [9, 4, 4, 3, 0, -10, -12] (this one is non-increasing), but [1, 3, 6, 9, 8] is not. Given a list of integers (in any reasonable format), output the smallest number N such that the sequence of these integers can be split into N monotonic sequences.

Examples

```<code>[1, 3, 7, 5, 4, 2] -> [[1, 3, 7], [5, 4, 2]] -> 2
[1, 2, 3, 4, 5, 6] -> [1, 2, 3, 4, 5, 6]     -> 1
[3, 1, 5, 5, 6]    -> [[3, 1], [5, 5, 6]]    -> 2
[4, 6, 8, 9, 1, 6] -> [[4, 6, 8, 9], [1, 6]] -> 2
[3, 3, 3, 3]       -> [[3, 3, 3, 3]]         -> 1
[7]                -> [[7]]                  -> 1
[]                 -> []                     -> anything (you don't actually have to handle an empty list case)
[1, 3, 2, -1, 6, 9, 10, 2, 1, -12] -> [[1, 3], [2, -1], [6, 9, 10], [2, 1, -12]] -> 4
</code>```

Body:
Perl, 65 bytes

62 bytes of code + 3 bytes for -n flag.

monot_seq.pl :

#!perl -n
s/\S+ /($_<=>$&)*($&<=>$')-$g>=0?$g=1:$.++;$g--;$_=$&/ge,$_=$.

Give the input without final newline, with the numbers separated by spaces :

$ echo -n "1 3 2 -1 6 9 10 2 1 -12" | perl -M5.010 monot_seq.pl
4

-5 bytes thanks to @Gabriel Benamy.


答:
Octave, 55 bytes, 10 numbers, flawr

```<code>(o=@(O,o)(@(O,o)o{2-O} ) (0<O,{ (yo=O-1)+1,@()1}))(1,o)
</code>```

The final 1 can be cycled up to 9, and then change the +1 to +2.

Title: Code ladder, Robbers

Body:
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

```<code>abc1efghi
</code>```

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

Body:
Octave, 55 bytes, 10 numbers, flawr

(o=@(O,o)(@(O,o)o{2-O} ) (0<O,{ (yo=O-1)+1,@()1}))(1,o)

The final 1 can be cycled up to 9, and then change the +1 to +2.


答:
Dyalog APL, 10 bytes

⍕≡⍕∪(⍕*∘3)
```

⍕≡ is the argument's text representation identical to

⍕∪ the union of the argument's text representation and

(⍕*∘3) the text representation of the cubed argument?

TryAPL online!

Note: For large numbers, set ⎕PP←34 ⋄ ⎕FR←1287 (34 significant digits, 128 bit floats)

Body:
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.

For example, let's check the number 100.

1003 is 1000000.

The set of digits in 100 is {0, 1}.

The set of digits in 1000000 is {0, 1}.

Therefore, 100 should give a truthy value.

Test cases

```<code>0 -> True
1 -> True
10 -> True
107624 -> True
251894 -> True
251895 -> False
102343 -> False
</code>```

Remember, this is code-golf, so the code with the fewest bytes wins.

OEIS A029795

Body:
Dyalog APL, 10 bytes

⍕≡⍕∪(⍕*∘3)

⍕≡ is the argument's text representation identical to

⍕∪ the union of the argument's text representation and

(⍕*∘3) the text representation of the cubed argument?

TryAPL online!

Note: For large numbers, set ⎕PP←34 ⋄ ⎕FR←1287 (34 significant digits, 128 bit floats)


答:
C, 73 bytes

k;b(i){k=0;while(i)k|=1<<i%10,i/=10;return k;}f(n){return b(n)-b(n*n*n);}
```
<p>Creates the set via bits. Returns <code>0</code> for same set, anything else for different sets.</p>
<p>Ungolfed:</p>
<pre class="lang-c prettyprint-override"><code>k;
b(i){
  k=0;
  while(i)
    k|=1<<i%10,
    i/=10;
  return k;
}

f(n){
  return b(n)-b(n*n*n);
}
</code>```

Body:
C, 73 bytes

k;b(i){k=0;while(i)k|=1<<i%10,i/=10;return k;}f(n){return b(n)-b(n*n*n);}

Creates the set via bits. Returns 0 for same set, anything else for different sets.

Ungolfed:

k;
b(i){
  k=0;
  while(i)
    k|=1<<i%10,
    i/=10;
  return k;
}

f(n){
  return b(n)-b(n*n*n);
}


问:
GO OUT AND VOTE
Today is November 8th, 2016, Election Day in the United States of America.

If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.

If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.

Challenge

Write a program that indicates that you voted, like a digital "I Voted" sticker.

It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).

For example:

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".

To be valid, an answer must:

Use the colors specified in the arrangement specified.

Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

Drawing the text to an image that is then displayed, saved, or output raw.

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

Displaying the text on a WPF/Windows form.

Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.

The shortest answer in bytes wins.

答:
IRC - 19 bytes

```<code>4I 2V4o2t4e2d
</code>```

Here it is with the nonprintables escaped, UNIX style:

```<code>^C4I ^C2V^C4o^C2t^C4e^C2d
</code>```

xxd output:

```<code>00000000: 0334 4920 0332 5603 346f 0332 7403 3465  .4I .2V.4o.2t.4e
00000010: 0332 64                                  .2d
</code>```

This makes use of IRC coloring, which uses ASCII character 03 and a colour palette.

Title: GO OUT AND VOTE

Body:
IRC - 19 bytes

4I 2V4o2t4e2d

Here it is with the nonprintables escaped, UNIX style:

^C4I ^C2V^C4o^C2t^C4e^C2d

xxd output:

00000000: 0334 4920 0332 5603 346f 0332 7403 3465  .4I .2V.4o.2t.4e
00000010: 0332 64                                  .2d

This makes use of IRC coloring, which uses ASCII character 03 and a colour palette.