问:
Showcase of Languages

Notes

This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions.

This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

How this works

All answers should include the name of the programming language at the top of the post, prefixed by a #.

Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

The snippets do not need to be related. In fact, snippets that are too related may be redundant.

Since this is not a contest, all programming languages are welcome, whenever they were created.

Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

Answers that predate these guidelines should be edited. Please help updating them as needed.

Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('
' + temp.innerText || temp.textContent + '');}}})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul></code>```

答:
D2

Factoid

D2 is a Brainfuck-like turing tarpit with a 2D memory model

Length 1

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

This prints 0. Why?

. is, like in Brainfuck, the print command. But since cells are limited to 36 values, D2 use a shift-state system to print most ASCII characters. In shift state 0, the alphabet is 0123456789abcdefghijklmnopqrstuvwxyz, and since the cell is initialized to 0, this print 0.

Length 2

```<code>;.
</code>```

Now this print !.

The ; instruction increment the shift state. In shift state 1, the alphabet is !@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ, so this print ! because the current cell is 0.

Length 3

```<code>>}+
</code>```

Explanation:

```<code>>   Turn the cursor 90° to the right
 }  Advance in the tape
  + Increment the pointed cell
</code>```

So the memory after this is:

```<code>0
1
</code>```

This demonstrate D2's 2D tape

Length 4

```<code>+$}^
</code>```

This set the first cell of the tape to 1, put the value in the register, advance one cell and put the value of the register in the cell.

Title: Showcase of Languages

Body:
D2

Factoid

D2 is a Brainfuck-like turing tarpit with a 2D memory model

Length 1

.

This prints 0. Why?

. is, like in Brainfuck, the print command. But since cells are limited to 36 values, D2 use a shift-state system to print most ASCII characters. In shift state 0, the alphabet is 0123456789abcdefghijklmnopqrstuvwxyz, and since the cell is initialized to 0, this print 0.

Length 2

;.

Now this print !.

The ; instruction increment the shift state. In shift state 1, the alphabet is !@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ, so this print ! because the current cell is 0.

Length 3

>}+

Explanation:

>   Turn the cursor 90° to the right
 }  Advance in the tape
  + Increment the pointed cell

So the memory after this is:

0
1

This demonstrate D2's 2D tape

Length 4

+$}^

This set the first cell of the tape to 1, put the value in the register, advance one cell and put the value of the register in the cell.


问:
Output the Hebrew alphabet
Your task is to print this exact text:

```<code>אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

(You are allowed to print a trailing newline)

SHA256 hash of the UTF-8 encoding of the text:

```<code>0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085
</code>```

Base64 encoding:

```<code>15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq
</code>```

Rules

You can't use a builtin outputting this text.

Standard loopholes are disallowed.

This is code-golf, so the shortest answer wins.

Good luck!

答:
05AB1E, 28*2-1=55 bytes

```<code>"אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

Try it online!

-1 byte thanks to Emigna + 28 bytes thanks to DJMCMayhem ;).

ContentLicense: CC BY-SA 3.0

Title: Output the Hebrew alphabet

Body:
05AB1E, 28*2-1=55 bytes

"אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!

-1 byte thanks to Emigna + 28 bytes thanks to DJMCMayhem ;).


问:
Summation from a to b
The program has an input of a and b, and outputs the sum of numbers from a to b, inclusive. Score is in bytes. As always, standard loopholes are disallowed.

If your input is in the format [a,b], +3 bytes

答:
05AB1E, 2 bytes

```<code>ŸO
</code>```

Explanation:

```<code>      # Implicit input
      # Implicit input
  Ÿ   # Push [a...b]
   O  # Sum list
      # Implicit print
</code>```

Try it online!

Title: Summation from a to b

Body:
05AB1E, 2 bytes

ŸO

Explanation:

      # Implicit input
      # Implicit input
  Ÿ   # Push [a...b]
   O  # Sum list
      # Implicit print

Try it online!


答:
MATLAB, <s>52</s> 51 bytes

```<code>[cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']
</code>```

Example use:

```<code>>> [cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']
ans =
אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

Explanation

'CCCCCCCCCDADDAEADCDAEADCCC'-66 produces the array [1 1 ... -1 2 1 1 1], which contains the consecutive differences between the codepoints of the desired characters.

[1488 ...] prepends 1488, so the array is now [1488 1 1 ... -1 2 1 1 1].

cumsum(...) computes the cumulative sum: [1488 1489 ... 1514].

[... ''] concatenates with the empty string. This has the effect of converting to char (and is one byte shorter than char(...))

Title: Output the Hebrew alphabet

Body:
Your task is to print this exact text:

```<code>אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

(You are allowed to print a trailing newline)

SHA256 hash of the UTF-8 encoding of the text:

```<code>0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085
</code>```

Base64 encoding:

```<code>15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq
</code>```

Rules

You can't use a builtin outputting this text.

Standard loopholes are disallowed.

This is code-golf, so the shortest answer wins.

Good luck!

Body:
MATLAB, <s>52</s> 51 bytes

[cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']

Example use:

>> [cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']
ans =
אבגדהוזחטיכךלמםנןסעפףצץקרשת

Explanation

'CCCCCCCCCDADDAEADCDAEADCCC'-66 produces the array [1 1 ... -1 2 1 1 1], which contains the consecutive differences between the codepoints of the desired characters.

[1488 ...] prepends 1488, so the array is now [1488 1 1 ... -1 2 1 1 1].

cumsum(...) computes the cumulative sum: [1488 1489 ... 1514].

[... ''] concatenates with the empty string. This has the effect of converting to char (and is one byte shorter than char(...))


答:
05AB1E, <s>36</s> <s>29</s> <s>26</s> <s>25</s> 23 bytes

Saved 2 bytes thanks to Adnan

Uses CP-1252 encoding.

```<code>1488•’ÉÇW–moû•5Bvy<+Dç?
</code>```

Try it online!

Explanation

```<code>1488            # push 1488 (accumulator)
•’ÉÇW–moû•      # push 2235174277545950437
5B              # convert from base-5 to base-10 (122222222230330403230403222)
  v             # for each digit in above number
   y<           # decrease it by 1
     +          # add to accumulator
      Dç?       # print a copy of accumulator converted from code point
</code>```

Title: Output the Hebrew alphabet

Body:
05AB1E, <s>36</s> <s>29</s> <s>26</s> <s>25</s> 23 bytes

Saved 2 bytes thanks to Adnan

Uses CP-1252 encoding.

1488•’ÉÇW–moû•5Bvy<+Dç?

Try it online!

Explanation

1488            # push 1488 (accumulator)
•’ÉÇW–moû•      # push 2235174277545950437
5B              # convert from base-5 to base-10 (122222222230330403230403222)
  v             # for each digit in above number
   y<           # decrease it by 1
     +          # add to accumulator
      Dç?       # print a copy of accumulator converted from code point


问:
Make an ASCII bat fly around an ASCII moon
Background

Here is a Halloween related challenge.

As you may have seen from my last challenge I quite like what I term as ascii art animations, that is not just draw a pattern but draw a pattern that progresses. This idea came to me after I was asked a couple of years ago to liven up a (rather dull) presentation by making random ascii bats fly across the screen on Halloween. Needless to say I duly obliged (I was being paid for it) but it made me think that there is more to life than random bats. Inspired by this I would like to propose this challenge.

Challenge

Make a bat fly around the moon.

Here is a bat:

```<code>^o^
</code>```

Here is the moon:

```<code>     mmm
   mmmmmmm
  mmmmmmmmm
   mmmmmmm
     mmm
</code>```

You must show every stage of the bats flight (see output).

Input

None

Output

```<code>      ^o^
      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm^o^
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm
    mmmmmmm^o^
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm^o^
    mmmmmmm
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm^o^
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm^o^

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm
      ^o^

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
   ^o^mmm

      mmm
    mmmmmmm
   mmmmmmmmm
 ^o^mmmmmmm
      mmm

      mmm
    mmmmmmm
^o^mmmmmmmmm
    mmmmmmm
      mmm

      mmm
 ^o^mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

   ^o^mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      ^o^
      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm
</code>```

Rules

No reading from external files or websites

You may submit a full program or a function

Extra spaces and/or newlines are fine by me

Standard loopholes banned as usual

The bat must finish back at the top of the moon

Please feel free to clear the screen between frames if you wish however this is not a requirement. Output as shown above is fine

As this is code golf, the winner will be the answer with the lowest byte count although any answer is welcome

Sample

Reference implementation in totally ungolfed Python 2 (620 bytes but just to prove that it can be done. May golf it later).

```<code>b='^o^'
m=['                     ',
'         mmm         ',
'       mmmmmmm       ',
'      mmmmmmmmm      ',
'       mmmmmmm       ',
'         mmm         ',
'                     ']
p=[(9,12),(12,15),(14,17),(15,18),(14,17),(12,15),(9,12),(6,9),(4,7),(3,6),(4,7),(6,9),(9,12)]
d=0
for z in range(7):
    x=map(str,m[z])
    c="".join(x[:p[z][0]]) + b + "".join(x[p[z][1]:])+"\n"
    print "\n".join(m[:z]) + "\n" + c+"\n".join(m[z+1:])
for z in range(6)[::-1]:
    x=map(str,m[z])
    c="".join(x[:p[z+6][0]]) + b + "".join(x[p[z+6][1]:])+"\n"
    print "\n".join(m[:z]) + "\n" + c+"\n".join(m[z+1:])
</code>```

Result

Although @Jonathan obviously wins on byte count with Jelly, I am going to mark the Brainfuck answer from @Oyarsa as the accepted answer purely because I think that anyone who can actually do something like this in such a crazy language deserves +15 rep no matter how many bytes it takes. This is not because I have any problem with golfing languages. See my answer to a question regarding this on meta if you have any doubts. Many thanks and respect to all who contributed in whatever language.

Body:
Brainfuck, 690 Bytes

This is my first time golfing, so I'm sure there's still plenty of room for improvement

-[-[-<]>>+<]>-<<+++[>+++++++<-]>>>+>>-[<-->-------]<->++++++++>+>+++++>+>+++++>+>+++++++>+>+++++>+>+++++>+>++++++++>+>+>+>>+++[<++++++>-]<+>+>-->+>+>+[<]>[[<+>>-[>]+[[<]>+[>]<+[<]>>>-]<<[->>+<<]>-]>-[->>>>+<<<<]>++]>>>[[-]<]>>>>[>]>>+>+++++++<<<<[<]+<+<<+[[<]++++[>++++<-]>[<+[>]>[-<+>]<[<]>>-]>[>]++++++++++[>]>>>-[<]<<[<]<]<[<]>->-<<<[-]++++++<+<+++[>++++++<-]+<++++[>++++++++<-]---<-[>+<-----]++<----[>+<----]--<-[>+<---]<-[>++<-----]++++<-[>+<---]++<-[>+<-------]---<----[>+<----]<--[>+<++++++]<+++++[>+++++<-]++++++>[[[>]>[>]>>[-<<+>>]<<[<]<[<]>-]>[>]>[>]+++++++[>+++++++++<-]>-[->+>+>+<<<]++++[>>++++<<-]>>+<<<<[<]>[.>]>>[.>]<[<]>[-]>[-]>[-]<+[--<---[->]<]<[->+>+>+<<<]<<[[->>+<<]<]<]

<a href="http://brainfuck.tryitonline.net/#code=LVstWy08XT4-KzxdPi08PCsrK1s-KysrKysrKzwtXT4-Pis-Pi1bPC0tPi0tLS0tLS1dPC0-KysrKysrKys-Kz4rKysrKz4rPisrKysrPis-KysrKysrKz4rPisrKysrPis-KysrKys-Kz4rKysrKysrKz4rPis-Kz4-KysrWzwrKysrKys-LV08Kz4rPi0tPis-Kz4rWzxdWzxdPltbPCs-Pi1bPl0rW1s8XT4rWz5dPCtbPF0-Pj4tXTw8Wy0-Pis8PF0-LV0-LVstPj4-Pis8PDw8XT4rK10-Pj5bWy1dPF0-Pj4-Wz5dPj4rPisrKysrKys8PDw8WzxdKzwrPDwrW1s8XSsrKytbPisrKys8LV0-WzwrWz5dPlstPCs-XTxbPF0-Pi1dPls-XSsrKysrKysrKytbPl0-Pj4tWzxdPDxbPF08XTxbPF0-LT4tPDw8Wy1dKysrKysrPCs8KysrWz4rKysrKys8LV0rPCsrKytbPisrKysrKysrPC1dLS0tPC1bPis8LS0tLS1dKys8LS0tLVs-KzwtLS0tXS0tPC1bPis8LS0tXTwtWz4rKzwtLS0tLV0rKysrPC1bPis8LS0tXSsrPC1bPis8LS0tLS0tLV0tLS08LS0tLVs-KzwtLS0tXTwtLVs-KzwrKysrKytdPCsrKysrWz4rKysrKzwtXSsrKysrKz5bW1s-XT5bPl0-PlstPDwrPj5dPDxbPF08WzxdPi1dPls-XT5bPl0rKysrKysrWz4rKysrKysrKys8LV0-LVstPis-Kz4rPDw8XSsrKytbPj4rKysrPDwtXT4-Kzw8PDxbPF0-Wy4-XT4-Wy4-XTxbPF0-Wy1dPlstXT5bLV08K1stLTwtLS1bLT5dPF08Wy0-Kz4rPis8PDxdPDxbWy0-Pis8PF08XTxd&input=" rel="noreferrer">Try it online

Ungolfed some for readability:

-[-[-<]>>+<]>-<<+++[>+++++++<-]>>>+>>-[<-->-------]<->++++++++>+>+++++>+>+++++>+>+++++++>+>+++++>+>+++++>+>++++++++>+>+>+>>+++[<++++++>-]<+>+>-->+>+>+
Sets counters for creation of the m's and spaces
[<]>[[<+>>-[>]+[[<]>+[>]<+[<]>>>-]<<[->>+<<]>-]>-[->>>>+<<<<]>++]
Adds the first counter plus two of the character at the second counter to the end of the
current set of cells removes the first two counters on the list then repeats until
it encounters a 254
>>>[[-]<]>>>>[>]>>+>+++++++<<<<[<]
Removes some excess cells then adds a 7 after the end of the set of cells
+<+<<+[[<]++++[>++++<-]>[<+[>]>[-<+>]<[<]>>-]>[>]++++++++++[>]>>>-[<]<<[<]<]
Adds a newline every 16 characters until 7 newlines are added
<[<]>->-<<<[-]++++++<+<+++[>++++++<-]+<++++[>++++++++<-]---<-[>+<-----]++<----[>+<----]--<-[>+<---]<-[>++<-----]++++<-[>+<---]++<-[>+<-------]---<----[>+<----]<--[>+<++++++]<+++++[>+++++<-]++++++
Removes some excess cells then sets indices for the locations of bats
>[[[>]>[>]>>[-<<+>>]<<[<]<[<]>-]>[>]>[>]+++++++[>+++++++++<-]>-[->+>+>+<<<]++++[>>++++<<-]>>+<<<<[<]>[.>]>>[.>]<[<]>[-]>[-]>[-]<+[--<---[->]<]<[->+>+>+<<<]<<[[->>+<<]<]<]
Loops through the indices replacing the spaces at each index with a bat then printing
the set of cells then changing the bat back to spaces

I wanted to use the fact that by adding a newline to the beginning, each stage can be read in both directions to get two different stages, but I couldn't find a good way to do so without generating the full six and a half stages at once.


答:
Brain-Flak, 186 bytes

```<code>(((((((((((((((((((((((((((((((((()()()()()){})){}{}()){({}[()])}{})){}{})())())())())())())())())())()())[()])()())()())[()])()()())[()])()())())()())[()])()()())[()])()())())())())
</code>```

This code is 182 bytes long, and I added 4 bytes for two command line flags: -r and -u

Try it online!

Many thanks to @Neil for this awesome integer metagolfer that created this sweet way of pushing 1488 (the code point of the first character)

```<code>(((((((()()()()()){})){}{}()){({}[()])}{})){}{})
</code>```

Explanation:

Pushing large number in brain-flak is relatively difficult. However, since the act of pushing a number also evaluates to that number, we can push several numbers at the same time for massive byte savings. Here is a more concrete example. The innermost part (that I wrote above) in psuedo code is

```<code>push(1488)
</code>```

This expression evaluates to 1488, so we wrap the entire thing in another push statement:

```<code>push(push(1488) + 1)
</code>```

This pushes 1488 and 1489, as well as evaluating to 1489. So we wrap this:

```<code>push(push(push(1488) + 1) + 1)
</code>```

which pushes 1488, 1489, and 1490, as well as evaluating to 1490. Repeat this step for each number we need to push.

However, since the increments aren't always 1, it's a little bit more complicated than that. Here is a more readable version:

```<code>(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
#Push 1488
(((((((()()()()()){})){}{}()){({}[()])}{})){}{})
())     # + 1
())
())
())
())
())
())
())
())
()())   # + 2
[()])   # - 1
()())   # + 2
()())
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
()())   # + 2
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
())
())
</code>```

Title: Output the Hebrew alphabet

Body:
Brain-Flak, 186 bytes

(((((((((((((((((((((((((((((((((()()()()()){})){}{}()){({}[()])}{})){}{})())())())())())())())())())()())[()])()())()())[()])()()())[()])()())())()())[()])()()())[()])()())())())())

This code is 182 bytes long, and I added 4 bytes for two command line flags: -r and -u

Try it online!

Many thanks to @Neil for this awesome integer metagolfer that created this sweet way of pushing 1488 (the code point of the first character)

(((((((()()()()()){})){}{}()){({}[()])}{})){}{})

Explanation:

Pushing large number in brain-flak is relatively difficult. However, since the act of pushing a number also evaluates to that number, we can push several numbers at the same time for massive byte savings. Here is a more concrete example. The innermost part (that I wrote above) in psuedo code is

push(1488)

This expression evaluates to 1488, so we wrap the entire thing in another push statement:

push(push(1488) + 1)

This pushes 1488 and 1489, as well as evaluating to 1489. So we wrap this:

push(push(push(1488) + 1) + 1)

which pushes 1488, 1489, and 1490, as well as evaluating to 1490. Repeat this step for each number we need to push.

However, since the increments aren't always 1, it's a little bit more complicated than that. Here is a more readable version:

(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
#Push 1488
(((((((()()()()()){})){}{}()){({}[()])}{})){}{})
())     # + 1
())
())
())
())
())
())
())
())
()())   # + 2
[()])   # - 1
()())   # + 2
()())
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
()())   # + 2
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
())
())


问:
Find the maximum deviation
This problem is "inspired" from a question that was originally asked on Quora (not for code golfing). I just want to make it a challenge for you guys (and my first problem submission here).

Given an array of integer elements v and an integer d (we assume that d is lower or equal to the array's length), consider all the sequences of d consecutive elements in the array. For each sequence, compute the difference between the maximum and minimum value of the elements in that sequence and name it the deviation.

Your task is to write a program or function that computes the maximum value among all deviations of all the sequences considered above, and return or output that value.

Worked-through Example:

```<code>v: (6,9,4,7,4,1)
d: 3

The sequences of length 3 are:
6,9,4 with deviation 5
9,4,7 with deviation 5
4,7,4 with deviation 3
7,4,1 with deviation 6

Thus the maximal deviation is 6, so the output is 6.
</code>```

This is code golf, so the shortest answer in bytes wins.

答:
Scala, 48 bytes

```<code>(_:Seq[Int])sliding(_:Int)map(s=>s.max-s.min)max
</code>```

Ungolfed:

```<code>(a:Seq[Int],d:Int)=>a.sliding(d).map(s=>s.max-s.min).max
</code>```

Explanation:

```<code>(_:Seq[Int])   //define a function with a seq of ints as an argument
sliding(_:Int) //get the sequences with the length of an int argument
map(s=>        //map each sequence
  s.max-s.min    //to its deviation
)max           //and take the maximum value
</code>```

Title: Find the maximum deviation

Body:
Scala, 48 bytes

(_:Seq[Int])sliding(_:Int)map(s=>s.max-s.min)max

Ungolfed:

(a:Seq[Int],d:Int)=>a.sliding(d).map(s=>s.max-s.min).max

Explanation:

(_:Seq[Int])   //define a function with a seq of ints as an argument
sliding(_:Int) //get the sequences with the length of an int argument
map(s=>        //map each sequence
  s.max-s.min    //to its deviation
)max           //and take the maximum value


答:
Jelly, <s>22</s> <s>21</s> 20 bytes

```<code>27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ
</code>```

Try it online!

Idea

If we subtract 1487 from each code point, we get the array R that follows.

```<code>1 2 3 4 5 6 7 8 9 10 12 11 13 15 14 17 16 18 19 21 20 23 22 24 25 26 27
</code>```

That's just the range from 1 to 27, but not in ascending order; the pairs (11, 12), (14, 15), (16, 17), (20, 21), and (22, 23) have been swapped.

If we take the ascending range and add 2 to 11, 14, 16, 20, and 22, we get the array A that follows.

```<code>1 2 3 4 5 6 7 8 9 10 13 12 13 16 15 18 17 18 19 22 21 24 23 24 25 26 27
</code>```

This is no longer a permutation of the range, but if we stably sort the range by the values in that array, we can reconstruct the original array.

Code

```<code>27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ  Main link. No arguments.

27R                   Yield [1, ..., 27].
           ¦          Conditional application:
    “¿ÇÑÞæ‘             At indices 11, 14, 16, 20, and 22...
   +        2           add 2 to the corresponding value.
                      This yields the array A from the previous section.
             Ụ        Grade up; sort the indices of the result by its corresponding
                      values. This yields the array R from the previous section.
              +1487   Add 1487 to each integer in R.
                   Ọ  Unordinal; convert integers to characters.
</code>```

Title: Output the Hebrew alphabet

Body:
Jelly, <s>22</s> <s>21</s> 20 bytes

27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ

Try it online!

Idea

If we subtract 1487 from each code point, we get the array R that follows.

1 2 3 4 5 6 7 8 9 10 12 11 13 15 14 17 16 18 19 21 20 23 22 24 25 26 27

That's just the range from 1 to 27, but not in ascending order; the pairs (11, 12), (14, 15), (16, 17), (20, 21), and (22, 23) have been swapped.

If we take the ascending range and add 2 to 11, 14, 16, 20, and 22, we get the array A that follows.

1 2 3 4 5 6 7 8 9 10 13 12 13 16 15 18 17 18 19 22 21 24 23 24 25 26 27

This is no longer a permutation of the range, but if we stably sort the range by the values in that array, we can reconstruct the original array.

Code

27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ  Main link. No arguments.

27R                   Yield [1, ..., 27].
           ¦          Conditional application:
    “¿ÇÑÞæ‘             At indices 11, 14, 16, 20, and 22...
   +        2           add 2 to the corresponding value.
                      This yields the array A from the previous section.
             Ụ        Grade up; sort the indices of the result by its corresponding
                      values. This yields the array R from the previous section.
              +1487   Add 1487 to each integer in R.
                   Ọ  Unordinal; convert integers to characters.


问:
Image Smoothie!
Input into your program a black and white image. (png, jpg, etc)

Convert the image to a 2D matrix of pixels, where each index is the grayscale value of the image.

Take each index of the matrix and average the 8 pixels around it. Then replace that index with the average.

For example if you had:

```<code>120 80  60
20  10  30
40  100 05
</code>```

If you were finding the average for 10, the result would be 56.875, which is (120,80,60,30,05,100,40,20)/8.

Round to up to the nearest integer (57) and replace the index. The result of this iteration would be

```<code>120 80  60
20  57  30
40  100 05
</code>```

If you are finding the average for a pixel on an edge then only take values that are valid. In the example above if you were finding the average for 20 You would only consider 120, 80, 57, 100, and 40 which is 79.4 rounded to 80.

You may start at any index of the graph but it must be in order. For example you could do

```<code>[0][0], [0][1], ... [0][n], then [1][0], [1][1],... [1][n]
</code>```

Once the averaging is complete, convert the matrix back into a new image.

Display the new image as the output of the program. (Or save it and add it in your solution). The result of your code should be a blurry looking image but much smoother than the original.

Example Input

Example Output

Example Input two

Example Output two

Please provide your code and start and end image results.

Q/A

1Q. If one of the 8 neighbors has already been changed, should the average be calculated based on this new value, or based on the original values? That is, does the order of calculation affect the end result?

1A Yes, You should change each index with new values from any potential indices done before. That is why you need to go left-right, top-bottom etc. In order.

2Q. Could you clarify what is meant by "must be in order"? Does this mean that only raster order/reading order is acceptable? Or does it mean that the order must be the same each time the code is run? Would a spiral be valid? Or a shuffled order that is always the same?

2A. You should go left to right, right to left, top to bottom, or bottom to top. I.E. Do all of the 0th row, do all of the 1st row,... do all of the nth row

答:
PHP, 70 bytes

```<code>imagefilter($i=imagecreatefromjpeg($f="i.jpg"),10,0);imagejpeg($i,$f);
</code>```

Overwrites the original image file. Run with -r.

-2 bytes if you use a gif or png.

I thought PHP might have a built-in for this, and indeed:

10 stands for IMG_FILTER_SMOOTH; and 0 is the weight parameter.

See the GD library source code: This calls gdImageSmooth which calls gdImageConvolution with the requested matrix. I am not sure what it does at the edges; but overall it does the smoothing from top to bottom, from left to right.

Title: Image Smoothie!

Body:
PHP, 70 bytes

imagefilter($i=imagecreatefromjpeg($f="i.jpg"),10,0);imagejpeg($i,$f);

Overwrites the original image file. Run with -r.

-2 bytes if you use a gif or png.

I thought PHP might have a built-in for this, and indeed:

10 stands for IMG_FILTER_SMOOTH; and 0 is the weight parameter.

See the GD library source code: This calls gdImageSmooth which calls gdImageConvolution with the requested matrix. I am not sure what it does at the edges; but overall it does the smoothing from top to bottom, from left to right.


问:
A penny saved is a penny

...counted!

You will pass your program a variable which represents a quantity of money in dollars and/or cents and an array of coin values.  Your challenge is to output the number of possible combinations of the given array of coin values that would add up to the amount passed to the code.  If it is not possible with the coins named, the program should return 0.

Note on American numismatic terminology:

1-cent coin: penny

5-cent coin: nickel

10-cent coin: dime

25-cent coin: quarter (quarter dollar)

Example 1:

Program is passed:

```<code>12, [1, 5, 10]
</code>```

(12 cents)

Output:

```<code>4
</code>```

There are 4 possible ways of combining the coins named to produce 12 cents:

12 pennies

1 nickel and 7 pennies

2 nickels and 2 pennies

1 dime and 2 pennies

Example 2:

Program is passed:

```<code>26, [1, 5, 10, 25]
</code>```

(26 cents)

Output:

```<code>13
</code>```

There are 13 possible ways of combining the coins named to produce 26 cents:

26 pennies

21 pennies and 1 nickel

16 pennies and 2 nickels

11 pennies and 3 nickels

6 pennies and 4 nickels

1 penny and 5 nickels

16 pennies and 1 dime

6 pennies and 2 dimes

11 pennies, 1 dime, and 1 nickel

6 pennies, 1 dime, and 2 nickels

1 penny, 1 dime, and 3 nickels

1 penny, 2 dimes, and 1 nickel

1 quarter and 1 penny

Example 3:

Program is passed:

```<code>19, [2, 7, 12]
</code>```

Output:

```<code>2
</code>```

There are 2 possible ways of combining the coins named to produce 19 cents:

1 12-cent coin and 1 7-cent coin

1 7-cent coin and 6 2-cent coins

Example 4:

Program is passed:

```<code>13, [2, 8, 25]
</code>```

Output:

```<code>0
</code>```

There are no possible ways of combining the coins named to produce 13 cents.

This has been through the Sandbox.  Standard loopholes apply.  This is code golf, so the answer with the fewest bytes wins.

答:
tinylisp repl, 66 bytes

```<code>(d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1
</code>```

Recursive solution: tries using the first coin and not using the first coin, then adds the results from each. Exponential time complexity and no tail-recursion, but it computes the test cases just fine.

Ungolfed (key to builtins: d = define, q = quote, i = if, l = less-than, s = subtract, h = head, t = tail):

```<code>(d combos
 (q
  ((amount coin-values)
   (i amount
    (i (l amount 0)
     0
     (i coin-values
      (s
       (combos
        (s amount (h coin-values))
        coin-values)
       (s
        0
        (combos
         amount
         (t coin-values))))
      0))
    1))))
</code>```

Example usage:

```<code>tl> (d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1
C
tl> (C 12 (q (1 5 10)))
4
tl> (C 26 (q (1 5 10 25)))
13
tl> (C 19 (q (2 7 12)))
2
tl> (C 13 (q (2 8 25)))
0
tl> (C 400 (q (1 5 10 25)))
Error: recursion depth exceeded. How could you forget to use tail calls?!
</code>```

Title: A penny saved is a penny

Body:
tinylisp repl, 66 bytes

(d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1

Recursive solution: tries using the first coin and not using the first coin, then adds the results from each. Exponential time complexity and no tail-recursion, but it computes the test cases just fine.

Ungolfed (key to builtins: d = define, q = quote, i = if, l = less-than, s = subtract, h = head, t = tail):

(d combos
 (q
  ((amount coin-values)
   (i amount
    (i (l amount 0)
     0
     (i coin-values
      (s
       (combos
        (s amount (h coin-values))
        coin-values)
       (s
        0
        (combos
         amount
         (t coin-values))))
      0))
    1))))

Example usage:

tl> (d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1
C
tl> (C 12 (q (1 5 10)))
4
tl> (C 26 (q (1 5 10 25)))
13
tl> (C 19 (q (2 7 12)))
2
tl> (C 13 (q (2 8 25)))
0
tl> (C 400 (q (1 5 10 25)))
Error: recursion depth exceeded. How could you forget to use tail calls?!


答:
CJam, 23 bytes

```<code>27,"%(*.0"{i_)e\}/'אf+
</code>```

Try it online!

How it works

```<code>27,                     Push [0 ... 26].
   "%(*.0"              Push that string. Its code points are [37 40 42 46 48],
                        which are [10 13 15 19 21] modulo the length of the string.
          {     }/      For each character:
           i              Compute its code point.
            _)            Push an incremented copy.
              e\          Swap the integers of [0 ... 26] at those indices.
                  'אf+  Add all resulting integers to the first character of the
                        Hebrew alphabet.
</code>```

Title: Output the Hebrew alphabet

Body:
CJam, 23 bytes

27,"%(*.0"{i_)e\}/'אf+

Try it online!

How it works

27,                     Push [0 ... 26].
   "%(*.0"              Push that string. Its code points are [37 40 42 46 48],
                        which are [10 13 15 19 21] modulo the length of the string.
          {     }/      For each character:
           i              Compute its code point.
            _)            Push an incremented copy.
              e\          Swap the integers of [0 ... 26] at those indices.
                  'אf+  Add all resulting integers to the first character of the
                        Hebrew alphabet.


答:
PowerShell v2+, 58 bytes (UTF-16)

```<code>'אבגדהוזחטיכךלמםנןסעפףצץקרשת'
</code>```

PowerShell Unicode is UTF-16 unless explicitly specified otherwise, and then it's a crapshoot anyway since it's all UTF-16 in the background.

This just puts the literal string on the pipeline and the default Write-Output at the end of program execution prints it to screen.

The shortest I could get the ASCII version is 63

```<code>-join([char[]]'ABCDEFGHIJLKMONQPRSUTWVXYZ['|%{[char](1423+$_)})
</code>```

Which takes the ASCII value of the string ABC... and adds 1423 to each char to get the appropriate string.

Title: Output the Hebrew alphabet

Body:
PowerShell v2+, 58 bytes (UTF-16)

'אבגדהוזחטיכךלמםנןסעפףצץקרשת'

PowerShell Unicode is UTF-16 unless explicitly specified otherwise, and then it's a crapshoot anyway since it's all UTF-16 in the background.

This just puts the literal string on the pipeline and the default Write-Output at the end of program execution prints it to screen.

The shortest I could get the ASCII version is 63

-join([char[]]'ABCDEFGHIJLKMONQPRSUTWVXYZ['|%{[char](1423+$_)})

Which takes the ASCII value of the string ABC... and adds 1423 to each char to get the appropriate string.


答:
Java 7,159 bytes

Java = expensive(i know it can be golfed much more)

```<code>int c(int[]a,int d){int[]b=new int[d];int i,j,s=0;for(i=-1;i<a.length-d;){for(j=++i;j<i+d;)b[i+d-1-j]=a[j++];Arrays.sort(b);s=(j=b[d-1]-b[0])>s?j:s;}return s;}
</code>```

Ungolfed

```<code>static int c ( int []a , int d){
    int []b = new int[ d ];
    int i , j , s = 0 ;
    for ( i = -1 ; i < a.length - d ;) {
        for ( j = ++i ; j < i + d ;)
        b[ i + d - 1 - j ] = a[ j++ ] ;
        Arrays.sort( b ) ;
        s = ( j = b[ d - 1 ] - b[ 0 ] ) > s ? j : s ;
    }
    return s ;
    }
</code>```

Title: Find the maximum deviation

Body:
This problem is "inspired" from a question that was originally asked on Quora (not for code golfing). I just want to make it a challenge for you guys (and my first problem submission here).

Given an array of integer elements v and an integer d (we assume that d is lower or equal to the array's length), consider all the sequences of d consecutive elements in the array. For each sequence, compute the difference between the maximum and minimum value of the elements in that sequence and name it the deviation.

Your task is to write a program or function that computes the maximum value among all deviations of all the sequences considered above, and return or output that value.

Worked-through Example:

```<code>v: (6,9,4,7,4,1)
d: 3

The sequences of length 3 are:
6,9,4 with deviation 5
9,4,7 with deviation 5
4,7,4 with deviation 3
7,4,1 with deviation 6

Thus the maximal deviation is 6, so the output is 6.
</code>```

This is code golf, so the shortest answer in bytes wins.

Body:
Java 7,159 bytes

Java = expensive(i know it can be golfed much more)

int c(int[]a,int d){int[]b=new int[d];int i,j,s=0;for(i=-1;i<a.length-d;){for(j=++i;j<i+d;)b[i+d-1-j]=a[j++];Arrays.sort(b);s=(j=b[d-1]-b[0])>s?j:s;}return s;}

Ungolfed

static int c ( int []a , int d){
    int []b = new int[ d ];
    int i , j , s = 0 ;
    for ( i = -1 ; i < a.length - d ;) {
        for ( j = ++i ; j < i + d ;)
        b[ i + d - 1 - j ] = a[ j++ ] ;
        Arrays.sort( b ) ;
        s = ( j = b[ d - 1 ] - b[ 0 ] ) > s ? j : s ;
    }
    return s ;
    }


问:
Output the ALONED numbers
Consider the natural sequence up-to 6 (disregard 1):

```<code>2,3,4,5,6
</code>```

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:

```<code>3,5,6
</code>```

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,

```<code>5
</code>```

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.

OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT

```<code>2
6
15
20
22
</code>```

OUTPUT

```<code>2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21
</code>```

YET ANOTHER WORKED OUT EXAMPLE

For n= 22

```<code>=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)
</code>```

This is code-golf, so the shortest code in bytes wins.

答:
Python 2, <s>90</s> <s>79</s> 73 bytes

-6 bytes thanks to xnor

```<code>L=range(2,input()+1)
while L[0]*2<=L[-1]:L.remove(L[0]*2);L=L[1:]
print L
</code>```

Takes the input number on stdin. Ideone it!

Explanation

We construct the initial list from the input number and store it in L. Next, loop while the last number is greater than or equal to 2 times the first number and remove 2 times the first number from the list. This will always be the next number divisible by L[0]. L=L[1:] takes off the first number as well. When the condition is no longer true, no further removals can be made, and the list is printed.

Title: Output the ALONED numbers

Body:
Python 2, <s>90</s> <s>79</s> 73 bytes

-6 bytes thanks to xnor

L=range(2,input()+1)
while L[0]*2<=L[-1]:L.remove(L[0]*2);L=L[1:]
print L

Takes the input number on stdin. Ideone it!

Explanation

We construct the initial list from the input number and store it in L. Next, loop while the last number is greater than or equal to 2 times the first number and remove 2 times the first number from the list. This will always be the next number divisible by L[0]. L=L[1:] takes off the first number as well. When the condition is no longer true, no further removals can be made, and the list is printed.


答:
Detour, 11 bytes

```<code>{+(}-!>)*d.
</code>```

This uses the (a+b)*(b-a+1)/2 formula.

+ encodes (a+b), -!> encodes (b-a+1) (really -(a-b)+1), and *d. multiplies (*) the two together, halves it (d), and outputs it (.). {…} makes two copies of a and b and (…) manipulate where the two copies go so that the result of (a+b) doesn't get fed into the (b-a+1) section.

Try it online!

Title: Summation from a to b

Body:
The program has an input of a and b, and outputs the sum of numbers from a to b, inclusive. Score is in bytes. As always, standard loopholes are disallowed.

If your input is in the format [a,b], +3 bytes

Body:
Detour, 11 bytes

{+(}-!>)*d.

This uses the (a+b)*(b-a+1)/2 formula.

+ encodes (a+b), -!> encodes (b-a+1) (really -(a-b)+1), and *d. multiplies (*) the two together, halves it (d), and outputs it (.). {…} makes two copies of a and b and (…) manipulate where the two copies go so that the result of (a+b) doesn't get fed into the (b-a+1) section.

Try it online!


答:
JavaScript (ES6), 59 bytes

```<code>_=>"אבגדהוזחטיכךלמםנןסעפףצץקרשת"
</code>```

Best I could do in ASCII was <s>80</s> <s>79</s> 78 bytes:

```<code>_=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488))
</code>```

If a character array is acceptable, 75 bytes:

```<code>_=>[...0x377babbcf7f.toString(3)].map(c=>String.fromCharCode(++n-c),n=1488)
</code>```

Edit: Saved some bytes thanks to @IsmaelMiguel. Saved another byte thanks to @ETHproductions. If you use Firefox 30-57 then you can save another 2 bytes thanks to @ETHproductions using generator or array comprehensions:

```<code>_=>String.fromCharCode(...(for(c of 0x377babbcf7f.toString(3,n=1488))++n-c))
_=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c)]
</code>```

Title: Output the Hebrew alphabet

Body:
JavaScript (ES6), 59 bytes

_=>"אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Best I could do in ASCII was <s>80</s> <s>79</s> 78 bytes:

_=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488))

If a character array is acceptable, 75 bytes:

_=>[...0x377babbcf7f.toString(3)].map(c=>String.fromCharCode(++n-c),n=1488)

Edit: Saved some bytes thanks to @IsmaelMiguel. Saved another byte thanks to @ETHproductions. If you use Firefox 30-57 then you can save another 2 bytes thanks to @ETHproductions using generator or array comprehensions:

_=>String.fromCharCode(...(for(c of 0x377babbcf7f.toString(3,n=1488))++n-c))
_=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c)]


答:
Perl, 48 bytes

Includes +5 for -0pi

Give the width after the -i option, give the elements as separate lines on STDIN:

```<code>perl -0pi3 -e '/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F'
6
9
4
7
4
1
^D
</code>```

Just the code:

```<code>/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F
</code>```

(use a literal \n for the claimed score)

Title: Find the maximum deviation

Body:
Perl, 48 bytes

Includes +5 for -0pi

Give the width after the -i option, give the elements as separate lines on STDIN:

perl -0pi3 -e '/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F'
6
9
4
7
4
1
^D

Just the code:

/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F

(use a literal \n for the claimed score)


答:
05AB1E, <s>22</s> <s>17</s> <s>15</s> 14 bytes

```<code>L¦¹F¬·©¹›_i¦®K
</code>```

Try it online!

Explanation

```<code>L¦               # push the list [2..input]
  ¹F             # input nr of times do:
          i      # if
    ¬·©          # the first element in the list * 2
       ¹›_       # is less than or equal to input
                 # then
           ¦     # remove first element of list
            ®K   # and remove it's multiple
</code>```

Title: Output the ALONED numbers

Body:
Consider the natural sequence up-to 6 (disregard 1):

```<code>2,3,4,5,6
</code>```

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:

```<code>3,5,6
</code>```

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,

```<code>5
</code>```

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.

OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT

```<code>2
6
15
20
22
</code>```

OUTPUT

```<code>2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21
</code>```

YET ANOTHER WORKED OUT EXAMPLE

For n= 22

```<code>=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)
</code>```

This is code-golf, so the shortest code in bytes wins.

Body:
05AB1E, <s>22</s> <s>17</s> <s>15</s> 14 bytes

L¦¹F¬·©¹›_i¦®K

Try it online!

Explanation

L¦               # push the list [2..input]
  ¹F             # input nr of times do:
          i      # if
    ¬·©          # the first element in the list * 2
       ¹›_       # is less than or equal to input
                 # then
           ¦     # remove first element of list
            ®K   # and remove it's multiple


答:
Pyth - 19 bytes

Will definitely be refactoring.

```<code>u?Kf!%ThGtG-tGhKGtS
</code>```

Test Suite.

Title: Output the ALONED numbers

Body:
Pyth - 19 bytes

Will definitely be refactoring.

u?Kf!%ThGtG-tGhKGtS

Test Suite.


答:
Java 8, 140 128

Shaved a bunch off, in part thanks to VTCAKAVSMoACE.

```<code>int l(int[]a,int d){int x=0,i=0,f,j,k;for(;i<=a.length-d;i++)for(j=i;j<i+d;j++)for(k=i;k<i+d;)x=(f=a[j]-a[k++])>x?f:x;return x;}
</code>```

Ungolfed

```<code>int l(int[]a,int d){
    int x=0,i=0,f,j,k;
    for(;i<=a.length-d;i++)
        for(j=i;j<i+d;j++)
            for(k=i;k<i+d;)
                x=(f=a[j]-a[k++])>x?f:x;
    return x;
}
</code>```

Title: Find the maximum deviation

Body:
Java 8, 140 128

Shaved a bunch off, in part thanks to VTCAKAVSMoACE.

int l(int[]a,int d){int x=0,i=0,f,j,k;for(;i<=a.length-d;i++)for(j=i;j<i+d;j++)for(k=i;k<i+d;)x=(f=a[j]-a[k++])>x?f:x;return x;}

Ungolfed

int l(int[]a,int d){
    int x=0,i=0,f,j,k;
    for(;i<=a.length-d;i++)
        for(j=i;j<i+d;j++)
            for(k=i;k<i+d;)
                x=(f=a[j]-a[k++])>x?f:x;
    return x;
}


问:
The 3x3 Hexa Prime Square Puzzle

The 3x3 Hexa Prime Square Puzzle

Introduction

We consider 3x3 squares of hexadecimal digits (from 0 to F) such as:

```<code>2 E 3    1 F 3
8 1 5    7 2 7
D D 5    B B 9
</code>```

We define a 3x3 Hexa Prime Square (HPS3) as such a square for which all hexadecimal numbers read from left to right and from top to bottom are odd primes (i.e. primes greater than 2).

This is true for the left square and false for the right square:

```<code>2 E 3 --> 0x2E3 = 739       1 F 3 --> 0x1F3 = 499
8 1 5 --> 0x815 = 2069      7 2 7 --> 0x727 = 1831
D D 5 --> 0xDD5 = 3541      B B 9 --> 0xBB9 = 3001
| | |                       | | |
| | +---> 0x355 = 853       | | +---> 0x379 = 889 = 7 x 127
| +-----> 0xE1D = 3613      | +-----> 0xF2B = 3883 = 11 x 353
+-------> 0x28D = 653       +-------> 0x17B = 379
</code>```

Goal

Given a list of 9 hexadecimal digits, your goal is to find an arrangement that forms a HPS3.

Example:

```<code>Input: 123558DDE
Possible output: 2E3815DD5 (a flattened representation of the above left example)
</code>```

Input / Output

Input and output formats are flexible. The only requirement is that output digits are ordered from left to right and from top to bottom. Below are some possible options:

```<code>"2E3815DD5"
[ 0x2, 0xE, 0x3, 0x8, 0x1, 0x5, 0xD, 0xD, 0x5 ]
[ "2", "E", "3", "8", "1", "5", "D", "D", "5" ]
[
  [ 0x2, 0xE, 0x3 ],
  [ 0x8, 0x1, 0x5 ],
  [ 0xD, 0xD, 0x5 ]
]
[ "2E3", "815", "DD5" ]
etc.
</code>```

Using the same format for both input and output is not required.

Rules

This is code-golf, so the shortest answer in bytes wins. Standard loopholes are forbidden.

Your algorithm must be deterministic

You can't just bogosort the array until it's valid, even in a deterministic way (by using a constant random seed).

You may list all possible solutions for a given input, but this is neither required nor subject to a bonus.

You're not required to support inputs that do not admit any solution. (It's perfectly fine if your code is looping forever or crashing in that case.)

Test cases

```<code>Input       Possible output
---------------------------
123558dde   2e3815dd5
1155578ab   a7b851551
03bddffff   ffd0dfb3f
35899beff   8f99e3bf5
15899bbdf   581bb9fd9
14667799f   6f1469779
13378bcdd   78d1cd33b
24577bbdd   7274bd5db
1118bbddd   11b18dbdd
223556cdd   623c25dd5
12557899a   8a5295971
113579bbd   5b3db7191
</code>```

Title: The 3x3 Hexa Prime Square Puzzle

Body:
Groovy, 134 Bytes

Finds all possible solutions and returns them as an array, returns [] if there isn't a solution.

{it.toList().permutations().collect{it.collate(3).every{x=Integer.parseInt(it.join(),16);(2..x**0.5).every{x%it>0};}?it.join():0}-[0]}

Example input: 123558dde

Output:

[8235d5e1d, 2dd851e35, 815e352dd, 2e3d5518d, d2d3e5581, 853de5d21, 2dd3558e1, 2dd3e5581, 2e355d18d, 2518dd3e5, dd52e3185, e1d5d5283, 823ed1d55, 28d3e515d, 28d15de35, e351258dd, e5dd21853, 851d2d3e5, ed515d283, 2dd3e5185, 85de35d21, 5d1ed5823, 8dd355e21, d2d3e5815, d2d3e5851, 251e358dd, 2dde35851, 8235d5ed1, 2dde35815, e3585dd21, d2d8153e5, 85d5d12e3, 21dd85e35, d8521de35, 21d85d3e5, e1d5d5823, e35581d2d, 3e52dd581, dd52e3851, dd52e3815, 3e5281dd5, 8dd1253e5, 3e5815d2d, 3e55d128d, ed515d823, de5853d21, e218dd355, d8d1253e5, d8d251e35, d8d5512e3, 2dde35581, 3e52dd851, 5d1ed5283, e21dd5853, 3e5d2185d, 2513e58dd, 2dd3e5815, 2dd3e5851, e1d823d55, 3e52dd815, 581d2de35, e3515d28d, 2e318dd55, ed1823d55, dd52813e5, dd52e3581, 2e3515d8d, 28d3e55d1, 82355de1d, 82355ded1, 2dde35185, 3e5d8d125, 85d21de35, 281dd53e5, d21d85e35, d21e35d85, 2dd8e1355, 28d5d1e35, 85d15d2e3, 2813e5dd5, 3e5d2d185, 5d1e5d283, 3e5d2d581, e1dd55823, 3558e12dd, d55283e1d, 15dde5283, 5d128d3e5, 5518dd2e3, e5d28315d, 5d5823ed1, d2d1853e5, 823d55e1d, de521d853, d81d552e3, 5d5823e1d, 21ded5853, 823e1dd55, 3e52dd185, 5812dde35, d85e35d21, 3e585d21d, 8512dd3e5, 3e5251d8d, d2d8513e5, e1dd55283, 2e3d81d55, 853ed5d21, 2835d1ed5, 15d2e3d85, 5d1e3528d, 15dde5823, e35851d2d, 55d283e1d, 2e3551d8d, 8dd3e5125, 85d3e5d21, 8152e3dd5, 28de1d355, e1d55d823, 8dd3e5251, 5158dd2e3, e3521dd85, e1d35528d, 2e35d185d, 21de5d853, 823d55ed1, 5813e52dd, 8153e5d2d, e1d55d283, 21de3585d, d85d21e35, 5152e3d8d, 8513e5d2d, dd5e21853, 3552dd8e1, d552e318d, e5d2835d1, 2835d1e5d, 2835d1de5, 5d1e5d823, 8dde35125, 5d52e3d81, 3e5821dd5, 28d5d13e5, e35d21d85, dd51852e3, d2d185e35, 8dde35251, 8dd2513e5, e35d2d185, 2835d5e1d, 1852e3dd5, d85d213e5, 515d8d2e3, dd53e5821, d5518d2e3, 8dd5512e3, 283d55ed1, e5d5d1823, 28d355ed1, 3e58152dd, d812e3d55, e5d85321d, d8515d2e3, d2d581e35, 3e5581d2d, 85d21d3e5, 283d55e1d, dd53e5281, 851dd52e3, e35dd5821, 3e51258dd, dd58512e3, 28d355e1d, d8d2513e5, 125e358dd, e35dd5281, e35d2d851, d8d2e3515, e35d2d815, d21853ed5, d8d2e3551, 1852dd3e5, d21853e5d, 85dd213e5, d21853de5, 5d1283e5d, 823ed155d, 5d1283de5, ed521d853, 283e1dd55, d8d355e21, d8de35251, 5d1283ed5, e35d2d581, 3e528d15d, d55283ed1, 8512dde35, 3e5851d2d, 823ed15d5, 15d28de35, 15d3e528d, 2835d5ed1, 5d12e385d, 5d185d2e3, 5d5283e1d, 55d2e3d81, d2185de35, d55e1d283, ed582315d, 2dd8513e5, 853e5d21d, e352dd581, 851e352dd, 2dd5813e5, e352dd815, 853d21e5d, e352dd851, dd5821e35, ed155d283, 3e5d8d251, d8de35125, 2e3d8d551, 3e528d5d1, e5d21d853, dd5853e21, 853d21ed5, 85de3521d, e352518dd, 2e3d8d515, 125d8de35, e352dd185, 853d21de5, 8e13552dd, 1258dde35, 581e352dd, e21d8d355, ed155d823, e21853dd5, e3528d5d1, d2d851e35, 5512e38dd, 125d8d3e5, 2e3815dd5, 2513e5d8d, 21dde5853, 355d2d8e1, d55ed1283, 815dd52e3, 283ed1d55, 8152dd3e5, 281e35dd5, 28355de1d, 355e1d28d, ed182355d, 853dd5e21, e3528d15d, ed18235d5, 15d85d2e3, e351852dd, d55e1d823, 8e12dd355, 28355ded1, 2dd815e35, 581d2d3e5, d55ed1823, 15d283ed5, 821dd53e5, 2e35d518d, 5d5283ed1, 15d283e5d, 15d283de5, e1d28355d, e5d5d1283, 251d8d3e5, e1d2835d5, dd5281e35, ed15d5823, 21de35d85, dd58152e3, 2dd1853e5, 1258dd3e5, 5d5e1d283, 1253e58dd, 3e5d8521d, 18d2e3d55, e358152dd, 5512e3d8d, e35251d8d, 853ed521d, 3e5dd5281, 5813e5d2d, ed15d5283, 18d55d2e3, 281dd5e35, 8dde21355, 1852dde35, 3e585dd21, d85e3521d, 581e35d2d, ed1283d55, d812e35d5, 2e35518dd, 5d128de35, 8153e52dd, ed55d1823, e5d82315d, e35d85d21, d812e355d, d853e521d, 8dd2e3551, 2e3581dd5, 15de5d823, 8dd2e3515, 185e35d2d, 125e35d8d, 581dd52e3, 5d5e1d823, 5812e3dd5, 5152e38dd, 3558e1d2d, 85d3e521d, 5d1d852e3, 823de55d1, 2e3d8155d, d213e585d, ed55d1283, 2e3dd5581, 2e3dd5815, 15d823ed5, 2e3dd5851, d552e3d81, 55de1d823, e5d8235d1, 21d853de5, de528315d, d21e3585d, 2e3d815d5, 21d853e5d, ed58235d1, 2e3dd5185, 21d853ed5, de52835d1, 15d823e5d, e1d28d355, 355ed128d, 5812dd3e5, 815d2d3e5, 15d823de5, 823de515d, 55de1d283, ed5853d21, 2dd8153e5, 2e3d855d1, 185dd52e3, 8e1355d2d, 2e3d55d81, d2d3558e1, d8521d3e5, e5d15d823, ed52835d1, 35528de1d, dd5e35281, 3e58dd251, 5d5ed1283, dd58213e5, e355d128d, 3e58dd125, 3e5125d8d, 8213e5dd5, 355e218dd, 2e3d8515d, 35528ded1, e5d15d283, 853e21dd5, 8dd125e35, 15ded5823, e358dd251, 2e315dd85, 851d2de35, 551d8d2e3, d2d5813e5, ed528315d, 2e3185dd5, 185d2de35, 8152dde35, e35d2185d, 15de3528d, e358dd125, 251e35d8d, 5d5ed1823, 821dd5e35, 251d8de35, 8512e3dd5, 5d1823de5, d2d815e35, 3e51852dd, 5d1823e5d, 82315dde5, 3e5dd5821, 82315de5d, 5d518d2e3, 1853e5d2d, 8dd251e35, ed128355d, e1d8235d5, 82315ded5, d21ed5853, 823ed515d, 2e38dd551, ed135528d, 2e38dd515, 5d1823ed5, 2e318d55d, 15de5d283, e1d82355d, ed1d55823, 2e3851dd5, d8d5152e3, 283de515d, 823ed55d1, 3e55812dd, dd5e35821, 15ded5283, e21355d8d, 21d85de35, 8dd5152e3, e35125d8d, e355812dd, 5d52e318d, 8e1d2d355, d8155d2e3, 3e5d21d85, 21d3e5d85, ed12835d5, de585321d, d2185d3e5, 85dd21e35, 2e318d5d5, d213e5d85, 2e385d5d1, 55d823ed1, 15d2e385d, 3e521dd85, 283de55d1, ed1d55283, d8de21355, de5d21853, 55d823e1d, d852e315d, 355d8de21, d852e35d1, 8513e52dd, 185d2d3e5, 853e5dd21, 21d3e585d, 2dd581e35, de582315d, 823e5d15d, de515d283, 185e352dd, 28de3515d, 3e5d2d815, d21de5853, 283ed155d, 3e5d2d851, 55d283ed1, 3558dde21, 283ed15d5, d815d52e3, 28de355d1, 851e35d2d, de515d823, 5d1de5823, 55dd812e3, 283e5d15d, dd55812e3, 823e5d5d1, 15dd852e3, d2de35185, 1253e5d8d, 2e35d5d81, 1853e52dd, 2e35158dd, 21dd853e5, e35185d2d, 283e5d5d1, 18dd552e3, e35281dd5, 5d13e528d, e1d283d55, 2e385d15d, 28315de5d, 85d2e35d1, 28315dde5, 2dd185e35, e3585d21d, 283ed55d1, 5d1de5283, 28315ded5, d55823ed1, 5d12e3d85, e5d853d21, e35d8d125, e358512dd, d55823e1d, 815e35d2d, e35d8d251, 18d5d52e3, 28ded1355, e3521d85d, 283ed515d, 821e35dd5, d2d3e5185, 85321de5d, d2de35815, e35d8521d, d55d812e3, e213558dd, e35815d2d, d855d12e3, 15d28d3e5, d21e5d853, 85d2e315d, 3e58512dd, d2de35851, ed128d355, 28d15d3e5, 3e52518dd, 18d2e355d, de55d1823, d2de35581, 85321ded5, d2d8e1355, d853e5d21, 18d2e35d5, 2e35d1d85, 85321dde5, 3e5185d2d, 853de521d, 355e21d8d, 5d5d812e3, 55ded1823, de55d1283, 8235d1ed5, e35821dd5, 2518dde35, 8235d1de5, 8235d1e5d, 3e521d85d, d8d125e35, 2e315d85d, ed5d21853, 55ded1283, 815d2de35, 283e1d55d, 823e1d55d, 2e355dd81, 3e5d85d21, d8d3e5125, 3e515d28d, d21d853e5, 283e1d5d5, ed585321d, 823e1d5d5, 55d2e318d, d8d3e5251, 55d18d2e3, de58235d1]

Example input: 222222222
Output: []

If anyone wants me to comment it out, holler at a brother.


问:
Shuffle Up and Deal!
It is Friday and I am tired, so let's do a quick one! Take no input, however you should output all thirteen different numbered cards in a standard deck of cards. You should output 2 through Ace (Suit agnostic).

Each card has a top that is denoted with a space   and ten _ and another space .

The second row from the top is denoted with a / and ten spaces   and a \

The third row is the same as all the middle-ish rows excepts the character(s) denoting the card value appear two spaces to right (if at the top) or two space to the left (if at the bottom) of the edge.

Each middle-ish row is a simple | and ten spaces   and one more |

Finally the last line is a \ and ten _ and finally a /

If the value is multi-digit the overall width by height of the card should not change. (i.e. the 10 will not make the card's sides wider)

King Example:

```<code> __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/
</code>```

9 Example

```<code> __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
</code>```

10 Example

```<code> __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
</code>```

Output them in order from least to greatest (Aces are high!).

This is code-golf so the shortest code wins.

Have fun and have a fun weekend!

答:
Python, <s>161</s> <s>160</s> <s>156</s> 149 bytes

One byte saved by Shebang

This could use some work but here it is:

o=" ";v="_"*10
for x in map(str,range(2,11)+list("JKQA")):print o+v+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+v+"/"
```

<h2>Explanation</h2>

<p>We make a list of all the ranks in order using <code>map(str,range(2,11)</code>.  Then we loop through each of the ranks and make a card.</p>

<pre class="lang-python prettyprint-override"><code>print o+"_"*10+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+"_"*10+"/"
</code>```

We make the top of the card:

o+v+"\n"
```

<p>Then the rank goes on the left:</p>

<pre class="lang-python prettyprint-override"><code>"/",o*9+"\\\n|",x.ljust(8),"|"
</code>```

We use .ljust because 10 is two long and all the other ones are one wide.

Then we print the 5 rows in the middle:

"|"+("\n|"+o*10+"|")*5+"\n|"
```

<p>and the bottom rank:</p>

<pre class="lang-python prettyprint-override"><code>"\n|",o*6+x.ljust(3)+"|\n"
</code>```

Finally we print the bottom of the card:

"\\"+v+"/"
```

Title: Shuffle Up and Deal!

Body:
Python, <s>161</s> <s>160</s> <s>156</s> 149 bytes

One byte saved by Shebang

This could use some work but here it is:

o=" ";v="_"*10
for x in map(str,range(2,11)+list("JKQA")):print o+v+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+v+"/"

Explanation

We make a list of all the ranks in order using map(str,range(2,11).  Then we loop through each of the ranks and make a card.

print o+"_"*10+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+"_"*10+"/"

We make the top of the card:

o+v+"\n"

Then the rank goes on the left:

"/",o*9+"\\\n|",x.ljust(8),"|"

We use .ljust because 10 is two long and all the other ones are one wide.

Then we print the 5 rows in the middle:

"|"+("\n|"+o*10+"|")*5+"\n|"

and the bottom rank:

"\n|",o*6+x.ljust(3)+"|\n"

Finally we print the bottom of the card:

"\\"+v+"/"


答:
Scala/Groovy/Python 3, 9 ascii-chars + 27 2-byte chars = 63 bytes

```<code>print("אבגדהוזחטיכךלמםנןסעפףצץקרשת")
</code>```

assuming UTF-8

Scala, 59 bytes

```<code>print("ABCDEFGHIJLKMONQPRSUTWVXYZ["map(x=>(x+1423).toChar))
</code>```

x+1423 is the same as x-'A'+1488

Title: Output the Hebrew alphabet

Body:
Your task is to print this exact text:

```<code>אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

(You are allowed to print a trailing newline)

SHA256 hash of the UTF-8 encoding of the text:

```<code>0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085
</code>```

Base64 encoding:

```<code>15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq
</code>```

Rules

You can't use a builtin outputting this text.

Standard loopholes are disallowed.

This is code-golf, so the shortest answer wins.

Good luck!

Body:
Scala/Groovy/Python 3, 9 ascii-chars + 27 2-byte chars = 63 bytes

print("אבגדהוזחטיכךלמםנןסעפףצץקרשת")

assuming UTF-8

Scala, 59 bytes

print("ABCDEFGHIJLKMONQPRSUTWVXYZ["map(x=>(x+1423).toChar))

x+1423 is the same as x-'A'+1488


答:
PowerShell v2+, <s>120</s> <s>116</s> <s>114</s> 108 bytes

```<code>2..10+[char[]]'JQKA'|%{$z=' '*(8-!($_-10));$x='_'*10;$y=' '*10;" $x
/$y\
| $_$z|";,"|$y|"*5;"|$z$_ |
\$x/"}
</code>```

Constructs a range 2..10 and does array concatenation with char-array JQKA. Feeds that into a loop |%{...}. Each iteration, we set $z equal to an appropriate number of spaces (based on whether we're at card 10 or not), set $x to 10 underscores, and set $y to 10 spaces.

Then, we begin our placements. We're going to leverage the default Write-Output to insert a newline between pipeline elements, so we just need to get the stuff on the pipeline. Note that in most places, we're using a literal newline rather than closing and reopening our strings to save a couple bytes.

The first is just $x with two spaces, then $y with two slashes, then the | $_$z|" the pipe, a space, the appropriate number of spaces, and another pipe. This forms the top of the cards up to and including the value line.

We have to semicolon here, since the next uses an array. The ,"|$y|"*5 constructs a string-array, with the comma-operator, of the pipe with spaces - on output, each element of this array gets a newline for free.

Then, the "|$z$_ | for the bottom value marking, and finally $x with slashes for the bottom of the card.

Output Snippet

```<code>PS C:\Tools\Scripts\golfing> 2..10+[char[]]'JQKA'|%{$z=' '*(8,7)[$_-eq10];" $(($x='_'*10)) ";"/$(($y=' '*10))\";"| $_$z|";,"|$y|"*5;"|$z$_ |";"\$x/"}
 __________
/          \
| 2        |
|          |
|          |
|          |
|          |
|          |
|        2 |
\__________/
 __________
/          \
| 3        |
|          |
|          |
|          |
|          |
|          |
|        3 |
\__________/
 __________
/          \
| 4        |
...
</code>```

Title: Shuffle Up and Deal!

Body:
It is Friday and I am tired, so let's do a quick one! Take no input, however you should output all thirteen different numbered cards in a standard deck of cards. You should output 2 through Ace (Suit agnostic).

Each card has a top that is denoted with a space   and ten _ and another space .

The second row from the top is denoted with a / and ten spaces   and a \

The third row is the same as all the middle-ish rows excepts the character(s) denoting the card value appear two spaces to right (if at the top) or two space to the left (if at the bottom) of the edge.

Each middle-ish row is a simple | and ten spaces   and one more |

Finally the last line is a \ and ten _ and finally a /

If the value is multi-digit the overall width by height of the card should not change. (i.e. the 10 will not make the card's sides wider)

King Example:

```<code> __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/
</code>```

9 Example

```<code> __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
</code>```

10 Example

```<code> __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
</code>```

Output them in order from least to greatest (Aces are high!).

This is code-golf so the shortest code wins.

Have fun and have a fun weekend!

Body:
PowerShell v2+, <s>120</s> <s>116</s> <s>114</s> 108 bytes

2..10+[char[]]'JQKA'|%{$z=' '*(8-!($_-10));$x='_'*10;$y=' '*10;" $x
/$y\
| $_$z|";,"|$y|"*5;"|$z$_ |
\$x/"}

Constructs a range 2..10 and does array concatenation with char-array JQKA. Feeds that into a loop |%{...}. Each iteration, we set $z equal to an appropriate number of spaces (based on whether we're at card 10 or not), set $x to 10 underscores, and set $y to 10 spaces.

Then, we begin our placements. We're going to leverage the default Write-Output to insert a newline between pipeline elements, so we just need to get the stuff on the pipeline. Note that in most places, we're using a literal newline rather than closing and reopening our strings to save a couple bytes.

The first is just $x with two spaces, then $y with two slashes, then the | $_$z|" the pipe, a space, the appropriate number of spaces, and another pipe. This forms the top of the cards up to and including the value line.

We have to semicolon here, since the next uses an array. The ,"|$y|"*5 constructs a string-array, with the comma-operator, of the pipe with spaces - on output, each element of this array gets a newline for free.

Then, the "|$z$_ | for the bottom value marking, and finally $x with slashes for the bottom of the card.

Output Snippet

PS C:\Tools\Scripts\golfing> 2..10+[char[]]'JQKA'|%{$z=' '*(8,7)[$_-eq10];" $(($x='_'*10)) ";"/$(($y=' '*10))\";"| $_$z|";,"|$y|"*5;"|$z$_ |";"\$x/"}
 __________
/          \
| 2        |
|          |
|          |
|          |
|          |
|          |
|        2 |
\__________/
 __________
/          \
| 3        |
|          |
|          |
|          |
|          |
|          |
|        3 |
\__________/
 __________
/          \
| 4        |
...


答:
Groovy, <s>65</s> 58 Bytes

Algorithm idea from DSLoc, who noticed you need only to remove the doubles.

```<code>{n->a=(2..n);(2..(n/2)).each{if(it in a){a-=[it,it*2]}};a}
</code>```

Here's a breakdown:

```<code>{
    n->
    a=(2..n);             // Store [2,...,n].
    (2..(n/2)).each {     // From 2 to half of n.
        if(it in a){      // If it's there...
            a-=[it,it*2]  // Remove it and its double, store in a.
        }
    };
    a                     // Return a.
}
</code>```

Title: Output the ALONED numbers

Body:
Groovy, <s>65</s> 58 Bytes

Algorithm idea from DSLoc, who noticed you need only to remove the doubles.

{n->a=(2..n);(2..(n/2)).each{if(it in a){a-=[it,it*2]}};a}

Here's a breakdown:

{
    n->
    a=(2..n);             // Store [2,...,n].
    (2..(n/2)).each {     // From 2 to half of n.
        if(it in a){      // If it's there...
            a-=[it,it*2]  // Remove it and its double, store in a.
        }
    };
    a                     // Return a.
}


答:
Batch, 236 bytes

```<code>@echo off
for %%v in (2 3 4 5 6 7 8 9 10 J Q K A)do call:v %%v
exit/b
:v
set s=%1       %1
echo  __________
echo /          \
echo ^| %s:~0,8% ^|
for /l %%l in (1,1,5)do echo ^|          ^|
echo ^| %s:~-8% ^|
echo \__________/
</code>```

I tried golfing this in three different ways but ended up with the same byte count each time...

Title: Shuffle Up and Deal!

Body:
Batch, 236 bytes

@echo off
for %%v in (2 3 4 5 6 7 8 9 10 J Q K A)do call:v %%v
exit/b
:v
set s=%1       %1
echo  __________
echo /          \
echo ^| %s:~0,8% ^|
for /l %%l in (1,1,5)do echo ^|          ^|
echo ^| %s:~-8% ^|
echo \__________/

I tried golfing this in three different ways but ended up with the same byte count each time...


答:
Haskell, <s>71</s> <s>69</s> <s>62</s> 56 bytes

```<code>g(a:b)|s<-filter(/=2*a)b=[a|s==b]++g s
g x=x
q n=g[2..n]
</code>```

Usage example: q 22 -> [12,13,15,17,19,20,21].

If there's a multiple of the first number a, then it's 2*a. Keep a if 2*a is not in the list and append a recursive call with a and 2*a removed from the list.

Title: Output the ALONED numbers

Body:
Haskell, <s>71</s> <s>69</s> <s>62</s> 56 bytes

g(a:b)|s<-filter(/=2*a)b=[a|s==b]++g s
g x=x
q n=g[2..n]

Usage example: q 22 -> [12,13,15,17,19,20,21].

If there's a multiple of the first number a, then it's 2*a. Keep a if 2*a is not in the list and append a recursive call with a and 2*a removed from the list.


答:
MATL, 18 bytes

Borrowed the "multiply by 2" idea from @Emigna's 05AB1E answer.

```<code>q:Qt"t1)tEhym?6MX-
</code>```

Try it online!

Explanation

```<code>q:Q        % Input n implicitly. Push [2 3 ... n]
t"         % Duplicate. For each: repeat n-1 times
  t1)      %   Duplicate. Get first element from current array, say k
  tEh      %   Append twice that value: gives array [k 2*k]
  y        %   Push another copy of current array
  m?       %   If both k and 2*k are members of the array
    6M     %     Push [k 2*k] again
     X-    %     Set difference: remove from current array
           %   End if implicitly
           % End for each implicitly
           % Display implicitly
</code>```

Title: Output the ALONED numbers

Body:
MATL, 18 bytes

Borrowed the "multiply by 2" idea from @Emigna's 05AB1E answer.

q:Qt"t1)tEhym?6MX-

Try it online!

Explanation

q:Q        % Input n implicitly. Push [2 3 ... n]
t"         % Duplicate. For each: repeat n-1 times
  t1)      %   Duplicate. Get first element from current array, say k
  tEh      %   Append twice that value: gives array [k 2*k]
  y        %   Push another copy of current array
  m?       %   If both k and 2*k are members of the array
    6M     %     Push [k 2*k] again
     X-    %     Set difference: remove from current array
           %   End if implicitly
           % End for each implicitly
           % Display implicitly


答:
BaCon, 57 bytes

In most BASICs, the question mark simply represents PRINT.

At first glance, the solution below looks like 30 bytes, but the Hebrew characters need 2 bytes of storage because of UTF-8. So there are 27 characters x 2 bytes + 1 byte for the '?' and 2 bytes for the double quotes = 57 bytes.

Solution:

```<code>?"אבגדהוזחטיכךלמםנןסעפףצץקרשת"
</code>```

Title: Output the Hebrew alphabet

Body:
BaCon, 57 bytes

In most BASICs, the question mark simply represents PRINT.

At first glance, the solution below looks like 30 bytes, but the Hebrew characters need 2 bytes of storage because of UTF-8. So there are 27 characters x 2 bytes + 1 byte for the '?' and 2 bytes for the double quotes = 57 bytes.

Solution:

?"אבגדהוזחטיכךלמםנןסעפףצץקרשת"


Title: Shuffle Up and Deal!

Body:
JavaScript (ES6), 151 bytes

f=
_=>`2345678910JQKA`.replace(/.0?/g,s=>` __________
/          \\
| `+(s+=`   `+s).slice(0,4)+`     |
|     `.repeat(6)+s.slice(-4)+` |
\\__________/
`)
;
document.write('<pre>'+f());


答:
Python 3, 50 bytes

#coding:cp862
print('אבגדהוזחטיכךלמםנןסעפףצץקרשת')
```

<p>The file must be created using the CP862 encoding or by reversing the following hexdump.</p>

```0000000: 23 63 6f 64 69 6e 67 3a 63 70 38 36 32 0a 70 72  #coding:cp862.pr
0000010: 69 6e 74 28 27 80 81 82 83 84 85 86 87 88 89 8b  int('...........
0000020: 8a 8c 8e 8d 90 8f 91 92 94 93 96 95 97 98 99 9a  ................
0000030: 27 29                                            ')
```

<p>This could probably be ported to Python 2 (thus saving two bytes), but I lack the proper locale to test it. Python 3 dutifully prints an UTF-8 encoded version (or whatever is appropriate for the current locale) of the alphabet.</p>

<h3>Verification</h3>

```$ base64 > hebrew.py -d <<< I2NvZGluZzpjcDg2MgpwcmludCgngIGCg4SFhoeIiYuKjI6NkI+RkpSTlpWXmJmaJyk=
$ wc -c hebrew.py
50 hebrew.py
$ echo $LANG
en_US.UTF-8
$ python3 hebrew.py
אבגדהוזחטיכךלמםנןסעפףצץקרשת
```

Title: Output the Hebrew alphabet

Body:
Python 3, 50 bytes

#coding:cp862
print('אבגדהוזחטיכךלמםנןסעפףצץקרשת')

The file must be created using the CP862 encoding or by reversing the following hexdump.

0000000: 23 63 6f 64 69 6e 67 3a 63 70 38 36 32 0a 70 72  #coding:cp862.pr
0000010: 69 6e 74 28 27 80 81 82 83 84 85 86 87 88 89 8b  int('...........
0000020: 8a 8c 8e 8d 90 8f 91 92 94 93 96 95 97 98 99 9a  ................
0000030: 27 29                                            ')

This could probably be ported to Python 2 (thus saving two bytes), but I lack the proper locale to test it. Python 3 dutifully prints an UTF-8 encoded version (or whatever is appropriate for the current locale) of the alphabet.

Verification

$ base64 > hebrew.py -d <<< I2NvZGluZzpjcDg2MgpwcmludCgngIGCg4SFhoeIiYuKjI6NkI+RkpSTlpWXmJmaJyk=
$ wc -c hebrew.py
50 hebrew.py
$ echo $LANG
en_US.UTF-8
$ python3 hebrew.py
אבגדהוזחטיכךלמםנןסעפףצץקרשת


Title: Shuffle Up and Deal!

Body:
///, <s>182</s> 180 bytes

/+/_____//*/# |
&//&/@@@@@|# //%/ |
\\\\++\\\/
//$/ ++
\\\/!\\\\
| //#/       //!/#   //@/|!|
/$2*2%$3*3%$4*4%$5*5%$6*6%$7*7%$8*8%$9*9%$10#|
@@@@@|#10 |
\\++\/
$J*J%$K*K%$Q*Q%$A*A%

Try it online!

-2 bytes thanks to m-chrzan


Title: Shuffle Up and Deal!

Body:
Scala, 161 bytes

val a=" "*7
val u="_"*10
((2 to 10)++"JQKA")map(_+"")map{x=>val p=" "*(2-x.size)
s" $u \n/$a   \\\n| $x$p$a|\n" + s"|$a   |\n" * 5 + s"|$a$p$x |\n\\$u/\n"}


答:
Ruby, 124

Comparing scores to other answers, this is obviously the wrong approach:

->n{a={};b=[*2..n].each{|k|a[k]=7}
b.map{|i|g=b.select{|x|a[i]&&a[x]&&x%i<1}
a[g[0]]=a[g[1]]=!g[1]}
a.select{|k,v|v&k}.keys}
```

The somewhat clever bit here is a[g[0]]=a[g[1]]=!g[1] which sets the hash's values to true/false as necessary.

Title: Output the ALONED numbers

Body:
Consider the natural sequence up-to 6 (disregard 1):

```<code>2,3,4,5,6
</code>```

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:

```<code>3,5,6
</code>```

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,

```<code>5
</code>```

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.

OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT

```<code>2
6
15
20
22
</code>```

OUTPUT

```<code>2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21
</code>```

YET ANOTHER WORKED OUT EXAMPLE

For n= 22

```<code>=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)
</code>```

This is code-golf, so the shortest code in bytes wins.

Body:
Ruby, 124

Comparing scores to other answers, this is obviously the wrong approach:

->n{a={};b=[*2..n].each{|k|a[k]=7}
b.map{|i|g=b.select{|x|a[i]&&a[x]&&x%i<1}
a[g[0]]=a[g[1]]=!g[1]}
a.select{|k,v|v&k}.keys}

The somewhat clever bit here is a[g[0]]=a[g[1]]=!g[1] which sets the hash's values to true/false as necessary.


答:
///, 54 bytes

```<code>אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

Try it online!

There can't be any version more golfed than this :(

Title: Output the Hebrew alphabet

Body:
///, 54 bytes

אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!

There can't be any version more golfed than this :(


Title: Shuffle Up and Deal!

Body:
PHP, 233 Bytes

foreach([2,3,4,5,6,7,8,9,10,J,Q,K,A]as$k){for($c="",$i=0;$i<10;$i++)$c.=str_pad($i?$i>1&$i<9?"|":($i<2?"/":"\\"):" ",11,$i%9?" ":_).($i?$i>1&$i<9?"|":($i<2?"\\":"/"):" ")."\n";$c[113]=$c[28]=$k;$k>9&&$c[29]=$c[113]=0&$c[112]=1;echo$c;}


答:
Perl, <s>53</s> <s>49</s> <s>45</s> 44 bytes

Includes +1 for -n

Give input number on STDIN:

```<code>perl -M5.010 aloned.pl <<< 22
</code>```

aloned.pl:

```<code>#!/usr/bin/perl -n
@F[$F[$_*2]/2,$_*2,1]=0,$_&&say for@F=0..$_
</code>```

Directly checking the possible numbers is longer:

```<code>map{/$/;$_/=4until$_%4;$_%2^$_<3&&say$`}$_/2+1..$_
</code>```

This checks all numbers in the upper half range. Keep numbers that have an even number of 2 as prime factors except if the number is a power of 2 then odd (because 1 is left out of the original series). This method should however work well for other languages.

Title: Output the ALONED numbers

Body:
Perl, <s>53</s> <s>49</s> <s>45</s> 44 bytes

Includes +1 for -n

Give input number on STDIN:

perl -M5.010 aloned.pl <<< 22

aloned.pl:

#!/usr/bin/perl -n
@F[$F[$_*2]/2,$_*2,1]=0,$_&&say for@F=0..$_

Directly checking the possible numbers is longer:

map{/$/;$_/=4until$_%4;$_%2^$_<3&&say$`}$_/2+1..$_

This checks all numbers in the upper half range. Keep numbers that have an even number of 2 as prime factors except if the number is a power of 2 then odd (because 1 is left out of the original series). This method should however work well for other languages.


答:
05AB1E, <s>71</s> <s>70</s> <s>68</s> <s>66</s> <s>65</s> 64 bytes

Uses CP-1252 encoding.

```<code>TL¦"JQKA"S«vð'_T×©ððT×…/ÿ\9yg-ð×y"| ÿÿ|"ÂðT×…|ÿ|5×sTÂ‡®…\ÿ/JTä»,
</code>```

Slightly modified link as … doesn't work with ÿ on TIO atm.

Try it online!

Explanation

TL¦"JQKA"S« pushes the list [2,3,4,5,6,7,8,9,10,J,Q,K,A]

We then loop over each card value with v

ð'_T×©ð constructs " __________ "

ðT×…/ÿ\ constructs "/          \"

9yg-ð×y"| ÿÿ|"Â constructs the 2 rows with card values (the second row is the first reversed)

ðT×…|ÿ|5× constructs 5 rows of the form "|          |"

Then we

```<code>s     # move the 2nd card value row after the 5 "middle rows"
 TÂ‡  # and replace 1 with 0 and vice versa
</code>```

®…\ÿ/ constructs the bottom row

```<code>J       # join everything into 1 string
 Tä     # split into 10 parts
   »,   # merge by newline and print with newline
</code>```

Title: Shuffle Up and Deal!

Body:
05AB1E, <s>71</s> <s>70</s> <s>68</s> <s>66</s> <s>65</s> 64 bytes

Uses CP-1252 encoding.

TL¦"JQKA"S«vð'_T×©ððT×…/ÿ\9yg-ð×y"| ÿÿ|"ÂðT×…|ÿ|5×sTÂ‡®…\ÿ/JTä»,

Slightly modified link as … doesn't work with ÿ on TIO atm.

Try it online!

Explanation

TL¦"JQKA"S« pushes the list [2,3,4,5,6,7,8,9,10,J,Q,K,A]

We then loop over each card value with v

ð'_T×©ð constructs " __________ "

ðT×…/ÿ\ constructs "/          \"

9yg-ð×y"| ÿÿ|"Â constructs the 2 rows with card values (the second row is the first reversed)

ðT×…|ÿ|5× constructs 5 rows of the form "|          |"

Then we

s     # move the 2nd card value row after the 5 "middle rows"
 TÂ‡  # and replace 1 with 0 and vice versa

®…\ÿ/ constructs the bottom row

J       # join everything into 1 string
 Tä     # split into 10 parts
   »,   # merge by newline and print with newline


答:
Brain-Flak, 172 bytes

This answer is based largely one DJMcMayhem's solution here so I recomend you check it out.

Like DJMcMayhem's solution this uses the -rA flag to reverse output and print to unicode.

```<code>(((((()()()()()){})))<(((({}{}{}()){({}[()])}{})){}{})>){({}[()]<(({})())>)}{}(((((()()())((((((((({}(((({}())[()])()())()())[()]))[()])()())())()())[()]))[()])()())())())())
</code>```

Try it online!

Explanation

I made this answer by running a bunch of micro-optimizations over the original solution provided by DJMcMayhem.  These optimizations while saving bytes, make the code unreadable and the algorithm obtuse.  I, to be honest, do not really understand how or what my code does.

Perhaps someday I will understand how this works...

Title: Output the Hebrew alphabet

Body:
Your task is to print this exact text:

```<code>אבגדהוזחטיכךלמםנןסעפףצץקרשת
</code>```

(You are allowed to print a trailing newline)

SHA256 hash of the UTF-8 encoding of the text:

```<code>0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085
</code>```

Base64 encoding:

```<code>15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq
</code>```

Rules

You can't use a builtin outputting this text.

Standard loopholes are disallowed.

This is code-golf, so the shortest answer wins.

Good luck!

Body:
Brain-Flak, 172 bytes

This answer is based largely one DJMcMayhem's solution here so I recomend you check it out.

Like DJMcMayhem's solution this uses the -rA flag to reverse output and print to unicode.

(((((()()()()()){})))<(((({}{}{}()){({}[()])}{})){}{})>){({}[()]<(({})())>)}{}(((((()()())((((((((({}(((({}())[()])()())()())[()]))[()])()())())()())[()]))[()])()())())())())

Try it online!

Explanation

I made this answer by running a bunch of micro-optimizations over the original solution provided by DJMcMayhem.  These optimizations while saving bytes, make the code unreadable and the algorithm obtuse.  I, to be honest, do not really understand how or what my code does.

Perhaps someday I will understand how this works...


答:
Perl, <s>128</s> <s>117</s> 111 bytes

```<code>map{printf$"."_"x10 ."
/".$"x10 .'\
| %-9s|
'.("|".$"x10 ."|
")x5 ."|%9s |
\\"."_"x10 ."/
",$_,$_}2..10,J,Q,K,A
</code>```

The 6 literal newlines save 1 byte each.  This cannot be run directly from the command line because of the single quotes in lines 2 and 4 in order to save 1 byte by not having to escape a backslash.

Edit: I put Ace at the beginning, but it's supposed to be at the end.  It doesn't change the byte count.

Edit 2: -11 bytes: Got rid of some unnecessary statements and added another literal newline.  Everything is now output via a single printf.

Edit 3: -5 bytes thanks to @Ton Hospel.  But for some reason, I'm getting 111 bytes instead of 112 at home when compared to at work, so I'm going with the byte count my home computer is giving me.

Title: Shuffle Up and Deal!

Body:
It is Friday and I am tired, so let's do a quick one! Take no input, however you should output all thirteen different numbered cards in a standard deck of cards. You should output 2 through Ace (Suit agnostic).

Each card has a top that is denoted with a space   and ten _ and another space .

The second row from the top is denoted with a / and ten spaces   and a \

The third row is the same as all the middle-ish rows excepts the character(s) denoting the card value appear two spaces to right (if at the top) or two space to the left (if at the bottom) of the edge.

Each middle-ish row is a simple | and ten spaces   and one more |

Finally the last line is a \ and ten _ and finally a /

If the value is multi-digit the overall width by height of the card should not change. (i.e. the 10 will not make the card's sides wider)

King Example:

```<code> __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/
</code>```

9 Example

```<code> __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
</code>```

10 Example

```<code> __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
</code>```

Output them in order from least to greatest (Aces are high!).

This is code-golf so the shortest code wins.

Have fun and have a fun weekend!

Body:
Perl, <s>128</s> <s>117</s> 111 bytes

map{printf$"."_"x10 ."
/".$"x10 .'\
| %-9s|
'.("|".$"x10 ."|
")x5 ."|%9s |
\\"."_"x10 ."/
",$_,$_}2..10,J,Q,K,A

The 6 literal newlines save 1 byte each.  This cannot be run directly from the command line because of the single quotes in lines 2 and 4 in order to save 1 byte by not having to escape a backslash.

Edit: I put Ace at the beginning, but it's supposed to be at the end.  It doesn't change the byte count.

Edit 2: -11 bytes: Got rid of some unnecessary statements and added another literal newline.  Everything is now output via a single printf.

Edit 3: -5 bytes thanks to @Ton Hospel.  But for some reason, I'm getting 111 bytes instead of 112 at home when compared to at work, so I'm going with the byte count my home computer is giving me.


问:
Print a 10 by 10 grid of asterisks

Background

This is a standard textbook example to demonstrate for loops.

This is one of the first programs I learnt when I started learning programming ~10 years ago.

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

Specs

You may have extra trailing newlines.

You may have extra trailing spaces (U+0020) at the end of each line, including the extra trailing newlines.

Scoring

This is code-golf. Shortest answer in bytes wins.

答:
D2, 11 bytes

```<code>!7;//.|a:|a
</code>```

Explanation:

!7 is expanded to 7 +, so it set the current cell to 7.

; switch to the second shift state (7 is *)
/code|digit repeat code digit times (digit is base 36).

. print the character in the current shift state (so here, * is printed).

: print a newline in shift mode 2.

Title: Print a 10 by 10 grid of asterisks

Body:
D2, 11 bytes

!7;//.|a:|a

Explanation:

!7 is expanded to 7 +, so it set the current cell to 7.

; switch to the second shift state (7 is *)
/code|digit repeat code digit times (digit is base 36).

. print the character in the current shift state (so here, * is printed).

: print a newline in shift mode 2.


答:
Python, 61 bytes

lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]
```

<p>It's a bit easier to understand this less golfed code:</p>

<pre class="lang-python prettyprint-override"><code>lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]
</code>```

This uses a direct characterization of aloned numbers:

A number i is aloned if, when decomposed as i = a * 2^b with b odd, either

a>1 and b is even, or

a==1 and b is odd

The aloned numbers for n are all aloned numbers i in the interval n/2 + 1 <= i <= n.

Why does this hold? When doing the process for n, say we remove an odd number a in the lower half (1 to n/2). Then, 2*a is removed no matter where in the list it is. So, 4*a remains (if it existed). But if it's in the lower half, the deletion process will get to it and remove both 4*a and 8*a. So, we see that an upper-half number gets removed if it's of form 2*a, 8*a ... with odd c, but stays if it has form a, 4*a, 8*a, ...

The exception is for a=1, which does not start in the list and so is not removed. As a result, the removal chain starts with a=2, and the rule for powers of 2 is flipped.

lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]
```

<p>In the code above, <code>(i&-i)**.5%1>0</code> checks whether <code>i</code> lacks the form <code>i = a * 2^b</code> with <code>b</code> odd, by the bit-trick to extract the greatest power-of-two factor, <code>2^b = i&-i</code>, then checking if the result is not a perfect square. Then, <code>i&~-i>0</code> is another bit trick to check if <code>i</code> is not a perfect power of 2. These conditions are then xor'ed.</p>

<p>There's some more improvements here</p>

<pre class="lang-python prettyprint-override"><code>lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]
</code>```

First, we shift the range 1 index down to to shorten to range(n/2,n) from range(n/2+1,n+1), compensating by replacing all i with i+1 (or ~-i).

Whether a power of 2 is number is a power of 4 (2^b with b even) can be checked by and-ing with 2**c/3 for some large c. This is because 2**c/3 has binary representation 10101...101 with ones in the even-positioned bits. Using c=2*n suffices. To negate result when i is a power of 2, we halve this number is that case, putting 1's in the odd positions instead.

Title: Output the ALONED numbers

Body:
Python, 61 bytes

lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]

It's a bit easier to understand this less golfed code:

lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]

This uses a direct characterization of aloned numbers:

A number i is aloned if, when decomposed as i = a * 2^b with b odd, either

a>1 and b is even, or

a==1 and b is odd

The aloned numbers for n are all aloned numbers i in the interval n/2 + 1 <= i <= n.

Why does this hold? When doing the process for n, say we remove an odd number a in the lower half (1 to n/2). Then, 2*a is removed no matter where in the list it is. So, 4*a remains (if it existed). But if it's in the lower half, the deletion process will get to it and remove both 4*a and 8*a. So, we see that an upper-half number gets removed if it's of form 2*a, 8*a ... with odd c, but stays if it has form a, 4*a, 8*a, ...

The exception is for a=1, which does not start in the list and so is not removed. As a result, the removal chain starts with a=2, and the rule for powers of 2 is flipped.

lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]

In the code above, (i&-i)**.5%1>0 checks whether i lacks the form i = a * 2^b with b odd, by the bit-trick to extract the greatest power-of-two factor, 2^b = i&-i, then checking if the result is not a perfect square. Then, i&~-i>0 is another bit trick to check if i is not a perfect power of 2. These conditions are then xor'ed.

There's some more improvements here

lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]

First, we shift the range 1 index down to to shorten to range(n/2,n) from range(n/2+1,n+1), compensating by replacing all i with i+1 (or ~-i).

Whether a power of 2 is number is a power of 4 (2^b with b even) can be checked by and-ing with 2**c/3 for some large c. This is because 2**c/3 has binary representation 10101...101 with ones in the even-positioned bits. Using c=2*n suffices. To negate result when i is a power of 2, we halve this number is that case, putting 1's in the odd positions instead.