问:
ASCII's 95 Characters...95 Movie Quotes
Update: The winner has been decided, but the challenge is not over!

Finally, nearly 3 months after the question first started, someone has remained the last answerer for more than a week! Congratulations to jimmy23013 with his P1eq answer!

There are still however 8 characters left: 48KSaclw. If anyone is really ambitious they can keep on trying with those :D

Thanks a ton to everyone who participated, especially those of you who kept the contest going so long with multiple answers, notably KennyTM with a whopping 25 answers!!

Also, thanks to anyone who kept the answer list up to date, it was a great help :) (especially since I've been away from SE for a couple months :P).

Original Question:

In 2005 the American Film Institute produced AFI's 100 Years...100 Movie Quotes, a list of the best quotes in American cinema. Here they are listed exactly as they should be used in this challenge:

```<code>(answer  6) 1. "Frankly, my dear, I don't give a damn." - Rhett Butler
(answer  7) 2. "I'm gonna make him an offer he can't refuse." - Vito Corleone
(answer  5) 3. "You don't understand! I coulda had class. I coulda been a contender. I could've been somebody, instead of a bum, which is what I am." - Terry Malloy
(answer  3) 4. "Toto, I've a feeling we're not in Kansas anymore." - Dorothy Gale
5. "Here's looking at you, kid." - Rick Blaine
(answer  2) 6. "Go ahead, make my day." - Harry Callahan
(answer 11) 7. "All right, Mr. DeMille, I'm ready for my close-up." - Norma Desmond
(answer  8) 8. "May the Force be with you." - Han Solo
(answer 12) 9. "Fasten your seatbelts. It's going to be a bumpy night." - Margo Channing
(answer 13) 10. "You talking to me?" - Travis Bickle
(answer 16) 11. "What we've got here is failure to communicate." - Captain
(answer 15) 12. "I love the smell of napalm in the morning." - Lt. Col. Bill Kilgore
(answer  4) 13. "Love means never having to say you're sorry." - Jennifer Cavilleri Barrett
14. "The stuff that dreams are made of." - Sam Spade
(answer 18) 15. "E.T. phone home." - E.T.
(answer 20) 16. "They call me Mister Tibbs!" - Virgil Tibbs
17. "Rosebud." - Charles Foster Kane
(answer 10) 18. "Made it, Ma! Top of the world!" - Arthur "Cody" Jarrett
(answer 17) 19. "I'm as mad as hell, and I'm not going to take this anymore!" - Howard Beale
(answer 25) 20. "Louis, I think this is the beginning of a beautiful friendship." - Rick Blaine
(answer 26) 21. "A census taker once tried to test me. I ate his liver with some fava beans and a nice Chianti." - Hannibal Lecter
(answer  9) 22. "Bond. James Bond." - James Bond
(answer 22) 23. "There's no place like home." - Dorothy Gale
(answer 29) 24. "I am big! It's the pictures that got small." - Norma Desmond
25. "Show me the money!" - Rod Tidwell
(answer 31) 26. "Why don't you come up sometime and see me?" - Lady Lou
(answer 27) 27. "I'm walking here! I'm walking here!" - "Ratso" Rizzo
(answer 14) 28. "Play it, Sam. Play 'As Time Goes By.'" - Ilsa Lund
(answer 28) 29. "You can't handle the truth!" - Col. Nathan R. Jessup
(answer 23) 30. "I want to be alone." - Grusinskaya
(answer 30) 31. "After all, tomorrow is another day!" - Scarlett O'Hara
(answer  1) 32. "Round up the usual suspects." - Capt. Louis Renault
(answer 24) 33. "I'll have what she's having." - Customer
(answer 36) 34. "You know how to whistle, don't you, Steve? You just put your lips together and blow." - Marie "Slim" Browning
(answer 19) 35. "You're gonna need a bigger boat." - Martin Brody
(answer 39) 36. "Badges? We ain't got no badges! We don't need no badges! I don't have to show you any stinking badges!" - "Gold Hat"
(answer 40) 37. "I'll be back." - The Terminator
(answer 33) 38. "Today, I consider myself the luckiest man on the face of the earth." - Lou Gehrig
(answer 37) 39. "If you build it, he will come." - Shoeless Joe Jackson
(answer 43) 40. "My mama always said life was like a box of chocolates. You never know what you're gonna get." - Forrest Gump
(answer 34) 41. "We rob banks." - Clyde Barrow
(answer 38) 42. "Plastics." - Mr. Maguire
43. "We'll always have Paris." - Rick Blaine
(answer 49) 44. "I see dead people." - Cole Sear
(answer 21) 45. "Stella! Hey, Stella!" - Stanley Kowalski
(answer 32) 46. "Oh, Jerry, don't let's ask for the moon. We have the stars." - Charlotte Vale
(answer 35) 47. "Shane. Shane. Come back!" - Joey Starrett
(answer 42) 48. "Well, nobody's perfect." - Osgood Fielding III
(answer 51) 49. "It's alive! It's alive!" - Henry Frankenstein
(answer 41) 50. "Houston, we have a problem." - Jim Lovell
(answer 45) 51. "You've got to ask yourself one question: 'Do I feel lucky?' Well, do ya, punk?" - Harry Callahan
(answer 55) 52. "You had me at "hello."" - Dorothy Boyd
(answer 46) 53. "One morning I shot an elephant in my pajamas. How he got in my pajamas, I don't know." - Capt. Geoffrey T. Spaulding
(answer 44) 54. "There's no crying in baseball!" - Jimmy Dugan
(answer 59) 55. "La-dee-da, la-dee-da." - Annie Hall
(answer 60) 56. "A boy's best friend is his mother." - Norman Bates
(answer 47) 57. "Greed, for lack of a better word, is good." - Gordon Gekko
(answer 56) 58. "Keep your friends close, but your enemies closer." - Michael Corleone
(answer 48) 59. "As God is my witness, I'll never be hungry again." - Scarlett O'Hara
(answer 50) 60. "Well, here's another nice mess you've gotten me into!" - Oliver
(answer 65) 61. "Say "hello" to my little friend!" - Tony Montana
(answer 66) 62. "What a dump." - Rosa Moline
(answer 52) 63. "Mrs. Robinson, you're trying to seduce me. Aren't you?" - Benjamin Braddock
(answer 61) 64. "Gentlemen, you can't fight in here! This is the War Room!" - President Merkin Muffley
(answer 68) 65. "Elementary, my dear Watson." - Sherlock Holmes
(answer 64) 66. "Take your stinking paws off me, you damned dirty ape." - George Taylor
(answer 53) 67. "Of all the gin joints in all the towns in all the world, she walks into mine." - Rick Blaine
(answer 72) 68. "Here's Johnny!" - Jack Torrance
(answer 71) 69. "They're here!" - Carol Anne Freeling
(answer 73) 70. "Is it safe?" - Dr. Christian Szell
(answer 54) 71. "Wait a minute, wait a minute. You ain't heard nothin' yet!" - Jakie Rabinowitz/Jack Robin
(answer 77) 72. "No wire hangers, ever!" - Joan Crawford
(answer 67) 73. "Mother of mercy, is this the end of Rico?" - Cesare Enrico "Rico" Bandello
(answer 70) 74. "Forget it, Jake, it's Chinatown." - Lawrence Walsh
(answer 74) 75. "I have always depended on the kindness of strangers." - Blanche DuBois
(answer 78) 76. "Hasta la vista, baby." - The Terminator
(answer 75) 77. "Soylent Green is people!" - Det. Robert Thorn
(answer 76) 78. "Open the pod bay doors, HAL." - Dave Bowman
(answer 80) 79. Striker: "Surely you can't be serious." Rumack: "I am serious...and don't call me Shirley." - Ted Striker and Dr. Rumack
(answer 84) 80. "Yo, Adrian!" - Rocky Balboa
(answer 81) 81. "Hello, gorgeous." - Fanny Brice
(answer 83) 82. "Toga! Toga!" - John "Bluto" Blutarsky
(answer 63) 83. "Listen to them. Children of the night. What music they make." - Count Dracula
(answer 87) 84. "Oh, no, it wasn't the airplanes. It was Beauty killed the Beast." - Carl Denham
(answer 88) 85. "My precious." - Gollum
(answer 86) 86. "Attica! Attica!" - Sonny Wortzik
(answer 57) 87. "Sawyer, you're going out a youngster, but you've got to come back a star!" - Julian Marsh
(answer 82) 88. "Listen to me, mister. You're my knight in shining armor. Don't you forget it. You're going to get back on that horse, and I'm going to be right behind you, holding on tight, and away we're gonna go, go, go!" - Ethel Thayer
(answer 58) 89. "Tell 'em to go out there with all they got and win just one for the Gipper." - Knute Rockne
(answer 90) 90. "A martini. Shaken, not stirred." - James Bond
(answer 85) 91. "Who's on first." - Dexter
(answer 62) 92. "Cinderella story. Outta nowhere. A former greenskeeper, now, about to become the Masters champion. It looks like a mirac...It's in the hole! It's in the hole! It's in the hole!" - Carl Spackler
(answer 69) 93. "Life is a banquet, and most poor suckers are starving to death!" - Mame Dennis
(answer 89) 94. "I feel the need - the need for speed!" - Lt. Pete "Maverick" Mitchell and Lt. Nick "Goose" Bradshaw
(answer 79) 95. "Carpe diem. Seize the day, boys. Make your lives extraordinary." - John Keating
(answer 91) 96. "Snap out of it!" - Loretta Castorini
(answer 92) 97. "My mother thanks you. My father thanks you. My sister thanks you. And I thank you." - George M. Cohan
(answer 93) 98. "Nobody puts Baby in a corner." - Johnny Castle
(answer 94) 99. "I'll get you, my pretty, and your little dog, too!" - Wicked Witch of the West
(answer 95) 100. "I'm the king of the world!" - Jack Dawson
</code>```

(Feel free to mark quotes as used.)

There are 95 printable ASCII characters (hex codes 20 to 7E), that's pretty close to 100:

```<code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</code>```

In this challenge users will take turns writing programs that print one of the movie quotes using a new programming language and a smaller subset of printable ASCII each time.

How This Works

I've already submitted the first answer and I've labeled it 95 since I was allowed to use all 95 printable ASCII characters in my program. It is a Python program that prints the 100th quote, "I'm the king of the world!" - Jack Dawson, to stdout.

The second person to answer needs to choose a new quote, a new programming language, and one of the 95 printable ASCII characters to exclude from their code. They must write a program without using this character that prints their chosen quote to stdout. They should mark their answer as 94 since they had 94 printable ASCII characters to work with (think of it like a countdown).

The third person to answer must choose a quote and language that haven't been used in any previous answers (only 95 and 94 in this case), and a new character to forgo. They must not use this character or any previously forbidden characters in their code. They mark their answer as 93.

This answering process continues like this until all printable ASCII characters are forbidden and someone gives the "1" answer, or much more likely, no one can figure out how to answer again.

Rules (please read carefully)

It's important to understand that only one person can answer at a time and each answer depends on the one before it. There should never be two answers with the same number, quote, or programming language.

There's bound to be clashing answers submitted at the same time, and that's ok. If that happens the person who technically answered later should quickly (like 10 min or less) delete their post or edit it so it becomes the next answer. Otherwise, don't edit code unless truly necessary. Editing posts to only fix formatting is encouraged.

Specific Rules

A user who just answered must wait at least an hour before answering again.

A user may not answer twice in a row.

The quote number you choose must not be more than 5 below your answer number. For example, answer 90 can choose any unused quote from number 85 to 100. This leaves the better quotes for the harder answers. Other than this rule the quote numbering is irrelevant.

Programs may only contain tabs, newlines, and the printable ASCII character that are not forbidden so far. (Tabs and newlines are never forbidden.)

There is no program length limit, but there may not be more that 64 tabs or 64 newlines in your program.

Languages are considered distinct if they are commonly referred to by different names. Different versions of programming languages are not considered distinct. (Markup languages like HTML do count but full on programming languages are preferred.) Your language must have existed prior to the start of this contest.

If your language does not have stdout use some similar text output mechanism.

Your program should not take input or have unexpected side effects like creating files.

Please make sure your program is valid. It should be able to run as a full program as is, not just in a REPL environment.

Note that the "quote" you must output includes the quotation marks and the person who said it (but not the quote number). Your program should solely produce your quote exactly as it appears in the list above (a leading/trailing newline is fine).

Formatting

Please format your answers like this, {stuff in curly braces} needs to be replaced:

```<code>#{answer number}. {language}, uses no <code>{the forbidden character you just chose}</code>

    {program}

Output is quote {quote number}:

    {program output, should be identical to quote}

[Previously forbidden:]({url of previous answer (hit "share" just below it)}) <code>{the previous answerer's forbidden character followed by his previously forbidden list}</code>

{anything else you wish to say}
</code>```

The  tags can be replaced with backticks (`) as long as no backtick occurs within them.

Scoring

The communal goal of this challenge is to keep answers coming for as long as possible.

The official winner is the user who answers last, after a week of no additional answers. I will accept their last answer.

Answer List (newest first)

4 Progressive Unary

a Bueue

c Udage

S 1L_a105

w Binaryfuck

K Subskin

l 23

n P1eq

t Addleq

9 x86 Machine Code

r BSM

D ShaFuck 0.2

u Villmark

O PDP-11 machine code

f ProgFk

i NUMPAD

H Tri

2 ferNANDo

P Pointy

m Subleq

G FlogScript

? Nqubl

% Glypho

! 3var

q ETA

j BrainSpace 1.0

V Insomnia

` asdf

6 Lazy K

C !Py!Batch 1.5

T Fuckfuck

F PoGo

R Golunar

b 6502 machine code + Apple II System Monitor

Y Headsecks

I BRB

U Braincrash

Z Ecstatic

M Farm

A Enema

L ADJUST

$ Beatnik

N Rebmu

g Dupdog

B Gammaplex

J Fuck4

5 A0A0

W gs2

: l33t

h Tonoco

E Malbolge

k D1ffe7e45e

1 evil

Q CaneCode

d Grass

# URSL

| Burlesque

x Emmental

~ Applesoft BASIC

^ Forth

7 80386 machine code + DOS

_ Argh!

v Rexx

} AlphaBeta

o Super Stack!

e Pyth

z Plain TeX

> WASD

] POSIX shell

& Gibberish

/ GolfScript

* x86_64 assembly

0 AppleScript

X Deadfish~

, Spoon

- oOo CODE

= J

@ Mathematica

. Perl

+ DNA#

< Pi

) Postscript

[ ABC

s dc

{ HTML

( Unary

; Ook!

' CJam

  PHP

" Brainfuck

\ Marbelous

3 C++

y Ruby

p JavaScript

     Python

(Feel free to edit if incorrect or out of date)

This question works best when you sort by "oldest".

NOTE: Like my last question, this is a test of a new challenge type where each answer depends on the last and increases in difficulty. Come to chat or meta to discuss either question or the idea in general.

答:
4. 1L_a105 (uses no S)

Bzip2 base64:

```<code>QlpoOTFBWSZTWVR7yccAMKPJBP/zgEAIACQAAAhgCh8fX2ZMFsFCgAyUUDWIqtBVMUyYmQZGFMmJ
kGRhTJiZBkYJPVKSjTJpoAmpSKaTyJoeoFJSEoYCH2Cn2qmEpqUGFZEmVWiDRKsJGUrUDVFMgbKL
CqwL+5JIu+pxDaUCrUXmU0oPSp6qLhIexTKrr4zYzWxrZGTS+euNkqJSShWg2azbLpEXIMKVe6jf
m/CPNKuVCeiNRYjviqXpWqY1lqlsDohjlDUXFKwV1xVcqulOaOFOBHAsF1oHz3xFkpMRhStqqL6i
MonEjzEcJXKJsWUoplMAl9+42TRsgtGaWiEz8WiEis2aWGKmxMVGWCpd10Tdtbdq4pIhkxRpqitU
1BFHXNGjQqmkJba1q2zWbbJGKZEtEaDwxprYYxjU2pfOHLaUSFImoDSqWgk15WqNbXtrlGkaSZMS
mpIu6YhNSaNV3bNN27a7LN1IbRr79KVGhiU0jaSmjNM2kzNqJLMNrM2jNNocqvKlgchTzXpAUoka
iUwhkRohkrW3attLXZgaMxK03gSZGyJFCUiJAoGRIsJUMTbW3s1pXBZaqNJ6YY2xMmtbZvGBLKaI
2RIsUzrbZuiJBK0sMxIkWiMTBmpKTDAeeUkoxBEbKZhSjJMkjbWyq9tfLFGAiik2maUEurbxBkwp
IWhNKolo0Xa8YxbKUWTIWbDUGJKNFJc+mGkySizUEbzzIRa9aYtcJ1Lmk2EmQZXZRSljbz1Ms2SI
WQ2kRs0FbVuSOkAZ371yi7J6jRicklfERiHIOSnDzms1DDMCYTKUiJo0sEBMW5bVqVqm2qy1TUVo
pfXEi5UmQbQ+/tbTDEQUikV9EkyTFKE6Hzgq7BcxpkEurjRiteeZTYiCMUkp6SPGRHj0fvLZa21t
a2rLMpEN5W1srckhhgC0JTEBBTUtg1IETdfGt8KGaMRagbMWZoI0MpO2tmuxmU2kMaMmMUa6229k
ssNRAsFkrDNAwlqbEiFGtsQ0mRZE893rW2GbZZImBQJESkKJEzazWtts6lHzCrahNoFfrkpwh4iO
EcUtKNVLrlEcEyR8QaVfBeLNNta1YyxMSM02Cy+HSlMUUR9tWttq9CWWRERmjAIhixDExUTMLbWw
VYjBYFWtrbWtqTLbDUFkiRFra021mgD3e/D3uYutuua6uVuq3xpa7uuzXb1pel3XJIulSQVzBous
Q9op3Tyd8PN3K3XTuOObd5ZnePHjq5o0afbbVX519NoSm+bM2u3btNnarmk1IRk82tavLxJqUjJk
miaKNdbbV9eGZtK0KVPeugyCaKSmLGCSkkQnVVK70le8ejNmYzZsy2oYlGmxm0u2ZotF3NLoxtrb
NWxQ+SGKZFlNXxL3kTlzZczLtzq1Tp1Bw5pzuXVy5CuJBdyuqg/4u5IpwoSCo95OOA==
</code>```

Or see it here: http://pastebin.com/083XbrLW

Note that the trailing newline is required.

This image does the same thing: http://i.stack.imgur.com/pdWDE.png

And to demonstrate, this program outputs "Love means:

```<code>c8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888c8
[encoded data, 8504 characters]
</code>```

And the image version which only outputs Love:

Output is quote 13:

```<code>"Love means never having to say you're sorry." - Jennifer Cavilleri Barrett
</code>```

Previously forbidden:

```<code>?!"#$%&'()*+,-./01235679:;<=>@[\]^_` AbBCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRstTuUvVwWxXyYzZ{|}~
</code>```

Remaining characters: 4 8 a c

Generator (in CJam)

```<code>q{i2b8Ue[~}%ee2af.%2aa..+
{~
[["888888888888888888888888
888888888888888888888888
888888888888ccc888888888
8888888cccccccc888888888
8888888cc8c8ccc888ccccc8
88c8888cc8c8c888888888c8
88c8888888c8c888888888c8
88ccccccccc8ccccccccccc8
888888888888888888888888"
"8888888888888888888888888
88888888888cccc8888888888
88888888888c88c8888888888
88888888888c88c8888888888
8888888ccc8c88cc888ccccc8
88c8888ccccccccc8888888c8
88c888888c8c88888888888c8
88cccccccc8ccccccccccccc8
8888888888888888888888888"
"8888888888888888888888888
8888888888888888888888888
88888888888cccc8888888888
88888888888c88c8888888888
8888888ccc8ccccc888ccccc8
88c8888cccccc8cc8888888c8
88c888888c8c88888888888c8
88cccccccc8ccccccccccccc8
8888888888888888888888888"]
["8888888888888888888888
ccc88888ccc88888888888
c8c88888c8c88888888888
c8c88888c8ccc888888888
c8888888c888c888cccc88
ccccccccccccc888888c88
88888888cccccccccccc88
8888888888888888888888
8888888888888888888888"
"8888888888888888
ccc8888888888888
c8c8888888888888
c8c8888888888888
c888888888ccc888
ccccccccccccc888
8888888888888888
8888888888888888
8888888888888888"
"8888888888888888
ccccccccccccc888
cccc88888888c888
88c888888888c888
8888888888ccc888
8888888888888888
8888888888888888
8888888888888888
8888888888888888"]
["c88888888888888
c8cc88888888888
c8cccc888888888
c88c8c888888888
cccccc888ccccc8
88cc888888888c8
88c8888888888c8
88cccccccccccc8
888888888888888"
"c888888888888888
c888888888888888
c8cccc8888888888
c8c88c8888888888
c8c88c8888ccccc8
c8c88ccc888888c8
cccccccc888888c8
88ccccccccccccc8
8888888888888888"]]
@=T@:T-=}%
_,
["88888888c8
88888888c8
88888888c8
88888888c8
88888888c8
88c88888c8
88c88888c8
88ccccccc8
8888888888"
"88c
88c
88c
88c
888
888
888
888
888"]=a+
Nf/{1$z,8-S*f{\+}..e>}*
z{_2$=1$'ce=1=&{;}*}*]zN*N
</code>```

My last language to use.

Title: ASCII's 95 Characters...95 Movie Quotes

Body:
4. 1L_a105 (uses no S)

Bzip2 base64:

QlpoOTFBWSZTWVR7yccAMKPJBP/zgEAIACQAAAhgCh8fX2ZMFsFCgAyUUDWIqtBVMUyYmQZGFMmJ
kGRhTJiZBkYJPVKSjTJpoAmpSKaTyJoeoFJSEoYCH2Cn2qmEpqUGFZEmVWiDRKsJGUrUDVFMgbKL
CqwL+5JIu+pxDaUCrUXmU0oPSp6qLhIexTKrr4zYzWxrZGTS+euNkqJSShWg2azbLpEXIMKVe6jf
m/CPNKuVCeiNRYjviqXpWqY1lqlsDohjlDUXFKwV1xVcqulOaOFOBHAsF1oHz3xFkpMRhStqqL6i
MonEjzEcJXKJsWUoplMAl9+42TRsgtGaWiEz8WiEis2aWGKmxMVGWCpd10Tdtbdq4pIhkxRpqitU
1BFHXNGjQqmkJba1q2zWbbJGKZEtEaDwxprYYxjU2pfOHLaUSFImoDSqWgk15WqNbXtrlGkaSZMS
mpIu6YhNSaNV3bNN27a7LN1IbRr79KVGhiU0jaSmjNM2kzNqJLMNrM2jNNocqvKlgchTzXpAUoka
iUwhkRohkrW3attLXZgaMxK03gSZGyJFCUiJAoGRIsJUMTbW3s1pXBZaqNJ6YY2xMmtbZvGBLKaI
2RIsUzrbZuiJBK0sMxIkWiMTBmpKTDAeeUkoxBEbKZhSjJMkjbWyq9tfLFGAiik2maUEurbxBkwp
IWhNKolo0Xa8YxbKUWTIWbDUGJKNFJc+mGkySizUEbzzIRa9aYtcJ1Lmk2EmQZXZRSljbz1Ms2SI
WQ2kRs0FbVuSOkAZ371yi7J6jRicklfERiHIOSnDzms1DDMCYTKUiJo0sEBMW5bVqVqm2qy1TUVo
pfXEi5UmQbQ+/tbTDEQUikV9EkyTFKE6Hzgq7BcxpkEurjRiteeZTYiCMUkp6SPGRHj0fvLZa21t
a2rLMpEN5W1srckhhgC0JTEBBTUtg1IETdfGt8KGaMRagbMWZoI0MpO2tmuxmU2kMaMmMUa6229k
ssNRAsFkrDNAwlqbEiFGtsQ0mRZE893rW2GbZZImBQJESkKJEzazWtts6lHzCrahNoFfrkpwh4iO
EcUtKNVLrlEcEyR8QaVfBeLNNta1YyxMSM02Cy+HSlMUUR9tWttq9CWWRERmjAIhixDExUTMLbWw
VYjBYFWtrbWtqTLbDUFkiRFra021mgD3e/D3uYutuua6uVuq3xpa7uuzXb1pel3XJIulSQVzBous
Q9op3Tyd8PN3K3XTuOObd5ZnePHjq5o0afbbVX519NoSm+bM2u3btNnarmk1IRk82tavLxJqUjJk
miaKNdbbV9eGZtK0KVPeugyCaKSmLGCSkkQnVVK70le8ejNmYzZsy2oYlGmxm0u2ZotF3NLoxtrb
NWxQ+SGKZFlNXxL3kTlzZczLtzq1Tp1Bw5pzuXVy5CuJBdyuqg/4u5IpwoSCo95OOA==

Or see it here: http://pastebin.com/083XbrLW

Note that the trailing newline is required.

This image does the same thing: http://i.stack.imgur.com/pdWDE.png

And to demonstrate, this program outputs "Love means:

[encoded data, 9567 characters]

And the image version which only outputs Love:

Output is quote 13:

"Love means never having to say you're sorry." - Jennifer Cavilleri Barrett

Previously forbidden:

?!"#$%&'()*+,-./01235679:;<=>@[\]^_` AbBCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRstTuUvVwWxXyYzZ{|}~

Remaining characters: 4 8 a c

Generator (in CJam)

q{i2b8Ue[~}%ee2af.%2aa..+
{~
[["888888888888888888888888
888888888888888888888888
888888888888ccc888888888
8888888cccccccc888888888
8888888cc8c8ccc888ccccc8
88c8888cc8c8c888888888c8
88c8888888c8c888888888c8
88ccccccccc8ccccccccccc8
888888888888888888888888"
"8888888888888888888888888
88888888888cccc8888888888
88888888888c88c8888888888
88888888888c88c8888888888
8888888ccc8c88cc888ccccc8
88c8888ccccccccc8888888c8
88c888888c8c88888888888c8
88cccccccc8ccccccccccccc8
8888888888888888888888888"
"8888888888888888888888888
8888888888888888888888888
88888888888cccc8888888888
88888888888c88c8888888888
8888888ccc8ccccc888ccccc8
88c8888cccccc8cc8888888c8
88c888888c8c88888888888c8
88cccccccc8ccccccccccccc8
8888888888888888888888888"]
["8888888888888888888888
ccc88888ccc88888888888
c8c88888c8c88888888888
c8c88888c8ccc888888888
c8888888c888c888cccc88
ccccccccccccc888888c88
88888888cccccccccccc88
8888888888888888888888
8888888888888888888888"
"8888888888888888
ccc8888888888888
c8c8888888888888
c8c8888888888888
c888888888ccc888
ccccccccccccc888
8888888888888888
8888888888888888
8888888888888888"
"8888888888888888
ccccccccccccc888
cccc88888888c888
88c888888888c888
8888888888ccc888
8888888888888888
8888888888888888
8888888888888888
8888888888888888"]
["c88888888888888
c8cc88888888888
c8cccc888888888
c88c8c888888888
cccccc888ccccc8
88cc888888888c8
88c8888888888c8
88cccccccccccc8
888888888888888"
"c888888888888888
c888888888888888
c8cccc8888888888
c8c88c8888888888
c8c88c8888ccccc8
c8c88ccc888888c8
cccccccc888888c8
88ccccccccccccc8
8888888888888888"]]
@=T@:T-=}%
_,
["88888888c8
88888888c8
88888888c8
88888888c8
88888888c8
88c88888c8
88c88888c8
88ccccccc8
8888888888"
"88c
88c
88c
88c
888
888
888
888
888"]=a+
Nf/{1$z,8-S*f{\+}..e>}*
z{_2$=1$'ce=1=&{;}*}*]zN*N

My last language to use.


问:
Alternating Sign Sequence

Introduction

The sign of a number is either a +, or a - for every non-zero integer. Zero itself is signless (+0 is the same as -0). In the following sequence, we are going to alternate between the positive sign, the zero and the negative sign. The sequence starts with 1, so we write 1 with a positive sign, with zero (this one is weird, but we just multiply the number by 0) and the negative sign:

```<code>1, 0, -1
</code>```

The next number is 2, and we do the same thing again:

```<code>2, 0, -2
</code>```

The sequence eventually is:

```<code>1, 0, -1, 2, 0, -2, 3, 0, -3, 4, 0, -4, 5, 0, -5, 6, 0, -6, 7, 0, -7, ...
</code>```

Or a more readable form:

```<code>a(0) = 1
a(1) = 0
a(2) = -1
a(3) = 2
a(4) = 0
a(5) = -2
a(6) = 3
a(7) = 0
a(8) = -3
a(9) = 4
...
</code>```

The Task

Given a non-negative integer n, output the nth term of the above sequence. You can choose if you use the zero-indexed or one-indexed version.

Test cases:

Zero-indexed:

```<code>a(0) = 1
a(11) = -4
a(76) = 0
a(134) = -45
a(296) = -99
</code>```

Or if you prefer one-indexed:

```<code>a(1) = 1
a(12) = -4
a(77) = 0
a(135) = -45
a(297) = -99
</code>```

This is code-golf, so the submission with the smallest number of bytes wins!

ContentLicense: CC BY-SA 3.0

Title: Alternating Sign Sequence

Body:
MarioLANG, <s>93</s> 81 bytes

one-indexed

Try It Online

;(-))+(-
"============<
>:(![<:![<:)![
 !=#="!#="!=#=
!  < !-< !- <
#==" #=" #=="

Explanation :

we begin by taking the imput

;

wich give us

          v
... 0 0 input 0 0 ...

we then decrement the left byte and increment the right byte with

;(-))+(
=======

we end up with

           v
... 0 -1 input +1 0 ...

we then set up the loop

;(-))+(-
"============<
>  ![< ![<  ![
   #=" #="  #=
!  < !-< !- <
#==" #=" #=="

the loop will go until the memory look like

         v
... 0 -X 0 +X 0 ...

we then only need to output the result

;(-))+(-
"============<
>:(![<:![<:)![
 !=#="!#="!=#=
!  < !-< !- <
#==" #=" #=="


问:
Falsify brief truths
Find the longest run of true in a list of booleans. Return the same list, with all other trues falsified.

Input, output

A list; any usual format (e.g., a delimited list as a string).

Details

True and false can be anything your language typically uses for those values, or the integers 1 and 0. If you use single characters, the list can be a concatenation (e.g., 10001).

If there's a tie for longest run, keep all tying runs true, and falsify all shorter runs.

Examples

```<code>input ↦ output
1,0,1,0,1 ↦ 1,0,1,0,1
1,1,0,1,1,0,1 ↦ 1,1,0,1,1,0,0
1,1,0,1,1,1,0,1,1 ↦ 0,0,0,1,1,1,0,0,0
1,1,1 ↦ 1,1,1
0,0,1 ↦ 0,0,1
0,0 ↦ 0,0
1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,0,1,1,1,1,0,0,1,0 ↦ 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0
</code>```

(directly from https://stackoverflow.com/q/37447114)

答:
Java 8, 205 bytes

This is a lambda expression for a Function<String,String>:

s->{int x=s.length();for(String t="1",f="0";s.indexOf(t+1)>=0;t+=1){s=s.replaceAll(0+t+0,0+f+0);if(s.indexOf(t+0)==0)s=s.replaceFirst(t,f);if(s.lastIndexOf(0+t)==--x-1)s=s.substring(0,x)+f;f+=0;}return s;}
```

<p>input/output is a <code>String</code> where true is represented by 1 and false is represented by 0. There are no delimiter characters separating the values.</p>

<p>code with explanation:</p>

<pre class="lang-java prettyprint-override"><code>inputString -> {
  int x = inputString.length();
  //starting with the truth combination "1",
  //loop until the input string does not contain the combination appended with another "1"
  //with each consecutive loop appending a "1" to the combination
  for( String truthCombo = "1", falseCombo = "0"; inputString.indexOf( truthCombo + 1 ) >= 0; truthCombo += 1 ) {
    //all instances in the input string
    //where the combination has a "0" on either side of it
    //are replaced by "0"'s
    inputString = inputString.replaceAll( 0 + truthCombo + 0, 0 + falseCombo + 0 );
    //if the combination followed by a "0"
    //is found at the beginning of the input string
    //replace it with "0"'s
    if( inputString.indexOf( truthCombo + 0 ) == 0 )
      inputString = inputString.replaceFirst( truthCombo , falseCombo );
    //if the combination preceeded by a "0"
    //is found at the end of the input string
    //replace it with "0"'s
    if( inputString.lastIndexOf( 0 + truthCombo ) == --x - 1 )
      inputString = inputString.substring( 0, x ) + falseCombo;
    falseCombo += 0;
  }
  return inputString;
}
</code>```

see ideone for the test cases

Title: Falsify brief truths

Body:
Java 8, 205 bytes

This is a lambda expression for a Function<String,String>:

s->{int x=s.length();for(String t="1",f="0";s.indexOf(t+1)>=0;t+=1){s=s.replaceAll(0+t+0,0+f+0);if(s.indexOf(t+0)==0)s=s.replaceFirst(t,f);if(s.lastIndexOf(0+t)==--x-1)s=s.substring(0,x)+f;f+=0;}return s;}

input/output is a String where true is represented by 1 and false is represented by 0. There are no delimiter characters separating the values.

code with explanation:

inputString -> {
  int x = inputString.length();
  //starting with the truth combination "1",
  //loop until the input string does not contain the combination appended with another "1"
  //with each consecutive loop appending a "1" to the combination
  for( String truthCombo = "1", falseCombo = "0"; inputString.indexOf( truthCombo + 1 ) >= 0; truthCombo += 1 ) {
    //all instances in the input string
    //where the combination has a "0" on either side of it
    //are replaced by "0"'s
    inputString = inputString.replaceAll( 0 + truthCombo + 0, 0 + falseCombo + 0 );
    //if the combination followed by a "0"
    //is found at the beginning of the input string
    //replace it with "0"'s
    if( inputString.indexOf( truthCombo + 0 ) == 0 )
      inputString = inputString.replaceFirst( truthCombo , falseCombo );
    //if the combination preceeded by a "0"
    //is found at the end of the input string
    //replace it with "0"'s
    if( inputString.lastIndexOf( 0 + truthCombo ) == --x - 1 )
      inputString = inputString.substring( 0, x ) + falseCombo;
    falseCombo += 0;
  }
  return inputString;
}

see ideone for the test cases


答:
Pyth checkout 8593c76, March 24th, 10 bytes

```<code>efq-VTtT)y
</code>```

This is exactly the same as Doorknob's answer, except that back in march, there was a 2 byte function (q ... )) which checked whether all of the elements of a list were the same, which is the same as !P{, which is the best you can do currently.

ContentLicense: CC BY-SA 4.0

Title: Longest arithmetic subsequence

Body:
Given a non empty finite sequence of integers, return an arithmetic subsequence of maximal length.

If there are multiple of the same maximal length, any of them can be returned.

Definitions:

An arithmetic sequence is a sequence \$a(1),a(2),a(3),a(4),...\$ such that there is a constant \$c\$ such that \$a(m+1)-a(m) = c\$ for all \$m\$. In other words: The difference between two subsequent terms is constant.

Given a sequence \$b(1),b(2),b(3),b(4),...\$ a subsequence is a sequence \$b(s(1)),b(s(2)),b(s(3)),b(s(4)),...\$ where \$1 <= s(1)\$ and \$s(m) < s(m+1)\$ for all \$m\$. In other words: Take the original sequence and remove as many entries as you want.

Examples

```<code>Input                     Output
[4,1,2,3,6,5]             [1,3,5] or [1,2,3]
[5,4,2,-1,-2,-4,-4]       [5,2,-1,-4]
[1,2,1,3,1,4,1,5,1]       [1,1,1,1,1] or [1,2,3,4,5]
[1]                       [1]
</code>```

Some longer test cases:

```<code>Length: 25
Input: [-9,0,5,15,-1,4,17,-3,20,13,15,9,0,-6,11,17,17,9,26,11,5,11,3,16,25]
Output: [15,13,11,9] or [17,13,9,5]

Length: 50
Input: [35,7,37,6,6,33,17,33,38,30,38,12,37,49,44,5,19,19,35,30,40,19,11,5,39,11,20,28,12,33,25,8,40,6,15,12,27,5,21,6,6,40,15,31,49,22,35,38,22,33]
Output: [6,6,6,6,6] or [39,33,27,21,15]

Length: 100
Input: [6,69,5,8,53,10,82,82,73,15,66,52,98,65,81,46,44,83,9,14,18,40,84,81,7,40,53,42,66,63,30,44,2,99,17,11,38,20,49,34,96,93,6,74,27,43,55,95,42,99,31,71,67,54,70,67,18,13,100,18,4,57,89,67,20,37,47,99,16,86,65,38,20,43,49,13,59,23,39,59,26,30,62,27,83,99,74,35,59,11,91,88,82,27,60,3,43,32,17,18]
Output: [6,18,30,42,54] or [8,14,20,26,32] or [46,42,38,34,30] or [83,63,43,23,3] or [14,17,20,23,26] or [7,17,27,37,47] or [71,54,37,20,3]
</code>```

Background

I got this idea when I recalled the Green-Tao-Theorem from 2004, which states that the sequence of primes contains finite arithmetic sequences of arbitrary length.

Body:
Pyth checkout 8593c76, March 24th, 10 bytes

efq-VTtT)y

This is exactly the same as Doorknob's answer, except that back in march, there was a 2 byte function (q ... )) which checked whether all of the elements of a list were the same, which is the same as !P{, which is the best you can do currently.


问:
My "keybore" is key-boring me! Help me find a minimal keystrokes
Credits to @Agawa001 for coming up with this question.

Explanation

My new "keybore" only has 2 buttons, namely + and -.

The number in the memory starts at 0.

Each consecutive press of + or - will increment/decrement the memory for exactly how many times it has been pressed consecutively.

Therefore, if you press + 4 times, first time it adds 1, the second time it adds 2, the third time it adds 3, the fourth time it adds 4, giving you 10 (ten).

Now, if you press - 3 times, the first time it subtracts 1, the second time 2, the third time 3, leaving you with 4 (four).

TL;DR

Given a string of + and -, divide it at each change of character. Then each resulting string of m + symbols adds the m-th triangle number, and each string of n - symbols subtracts the n-th triangle number.

Walk-through

Now, if you still do not understand, I will show you how +++--+-- creates 1.

```<code>Program   | Counter | Memory
----------------------------
          |  0      | 0
+         | +1      | 1
++        | +2      | 3
+++       | +3      | 6
+++-      | -1      | 5
+++--     | -2      | 3
+++--+    | +1      | 4
+++--+-   | -1      | 3
+++--+--  | -2      | 1
</code>```

Task

You will take a positive integer as input, either as functional argument or from STDIN.

Then, you will output/print the minimum number of keystrokes needed to create that number using the method above.

Testcases

Since rearranging the + or - runs gives the same number, for each such group only the lexicographically earliest sequence is listed.

```<code>Input | Output | Possible corresponding sequences
-------------------------------------------------
    4 |      5 | -+++-
    6 |      3 | +++
    9 |      5 | ++++-
   11 |      7 | +++-+++
   12 |      7 | +++++--, ++++-++
   19 |      8 | -++++++-
   39 |     12 | +++++++++---
   40 |     13 | +++++++++---+, ++++++++-+++-
   45 |      9 | +++++++++
   97 |     20 | ++++++++++++++--+---, +++++++++++++-++++--, ++++++++++++-++++++-
  361 |     34 | ++++++++++++++++++++++++++-+++-+++
</code>```

Extra resources

Proof that any number can be made: basically, by repeating ++-, you can obtain any even number. To obtain the odd numbers, just put a + at the end.

Another general way to obtain any number. For example, to generate 50, a way is to press + 50 times, and then press - 49 times.

Solution of the first 50 numbers.

Obligatory JSFiddle.

Scoring

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

答:
MATL, <s>43</s> 29 bytes

```<code>E:"@TFEqZ^!"@Y'tQ**s]vGE=a?@.
</code>```

This is memory- and time-inefficient. The online compiler can handle up to input 45 only.

Try it online!

Here's a modified version with all test cases up to 40 (it takes almost a minute in the online compiler).

Explanation

This tests all possible key-press sequences of each length, in order of increasing length, until a valid sequence is found.

```<code>E:       % Range [1 2 ... 2*N] where N is implicit input. The required sequence length is
         % less than 2*N, so this is enough
"        % For each
  @      %   Push current value: length of sequence
  TFEq   %   Push array [1 -1]
  Z^     %   Cartesian power. Gives all possible sequences of 1, -1 of that length
  !      %   Transpose. Each sequence is now a row
  "      %   For each sequence
    @    %     Push current sequence
    Y'   %     Run-length decoding: Pushes an array of values 1 and -1, and then an
         %     array of run-lengths
    tQ*  %     Duplicate, add 1, multiply. Gives twice the triangular number for each run
    *    %     Multiply element-wise by 1 or -1 to produce correct sign
    s    %     Sum of array. This is the number produced by the current sequence
  ]      %   End for
  v      %   Concatenate all numbers into an array
  GE=a   %   True if any of those numbers equals twice the input
  ?      %   If so
    @    %     Push current sequence length. This is the final result
    .    %     Break loop
         %   End if
         % End for
         % Implicit display
</code>```

Body:
MATL, <s>43</s> 29 bytes

E:"@TFEqZ^!"@Y'tQ**s]vGE=a?@.

This is memory- and time-inefficient. The online compiler can handle up to input 45 only.

Try it online!

Here's a modified version with all test cases up to 40 (it takes almost a minute in the online compiler).

Explanation

This tests all possible key-press sequences of each length, in order of increasing length, until a valid sequence is found.

E:       % Range [1 2 ... 2*N] where N is implicit input. The required sequence length is
         % less than 2*N, so this is enough
"        % For each
  @      %   Push current value: length of sequence
  TFEq   %   Push array [1 -1]
  Z^     %   Cartesian power. Gives all possible sequences of 1, -1 of that length
  !      %   Transpose. Each sequence is now a row
  "      %   For each sequence
    @    %     Push current sequence
    Y'   %     Run-length decoding: Pushes an array of values 1 and -1, and then an
         %     array of run-lengths
    tQ*  %     Duplicate, add 1, multiply. Gives twice the triangular number for each run
    *    %     Multiply element-wise by 1 or -1 to produce correct sign
    s    %     Sum of array. This is the number produced by the current sequence
  ]      %   End for
  v      %   Concatenate all numbers into an array
  GE=a   %   True if any of those numbers equals twice the input
  ?      %   If so
    @    %     Push current sequence length. This is the final result
    .    %     Break loop
         %   End if
         % End for
         % Implicit display


问:
Generate Wordenticons
Identicons are visual depictions of hash values, often made from symmetrical arrangements of geometric shapes. Your default Stack Exchange avatar is an identicon. This challenge is about creating "wordenticons", simple text-based versions of identicons that apply to strings of lowercase letters, i.e. words.

Challenge

Write a program or function that takes in a string S and outputs its wordenticon. S is guaranteed to be nonempty and only contain lowercase English letter characters a-z. You may optionally assume S has a trailing newline.

The wordenticon of S will be a square grid of text with side lengths 2*length(S) composed of spaces ( ), vertical bars, (|), and horizontal bars (―).

To generate the wordenticon of S, form a square grid where every column corresponds to a letter of S (in normal left-to-right reading order) and every row corresponds to a letter of S (in normal top-to-bottom reading order).

For example, if S is food our initial grid looks like

```<code> food
f....
o....
o....
d....
</code>```

where . is just a placeholder.

For every empty point (every .) in the grid:

If the column letter comes before the row letter alphabetically, replace the . with |.

If the column letter comes after the row letter alphabetically, replace the . with ―.

If the column and row letters are the same, replace the . with   (space).

Here is the food example after each of these steps:

Adding |'s:

```<code> food
f...|
o|..|
o|..|
d....
</code>```

Adding ―'s:

```<code> food
f.――|
o|..|
o|..|
d―――.
</code>```

Adding  's:

```<code> food
f ――|
o|  |
o|  |
d―――
</code>```

To complete the wordenticon, remove the superfluous row and column containing the words

```<code> ――|
|  |
|  |
―――
</code>```

then mirror the entire thing horizontally

```<code> ――||――
|  ||  |
|  ||  |
―――  ―――
</code>```

and finally mirror it again vertically

```<code> ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――
</code>```

resulting in the 2*length(S) side length text grid that is the final wordenticon.

Examples

Here are some additional wordenticon examples. Note that different words can have identical wordenticons and some wordenticons can be completely made of spaces (unfortunately markdown does not want to render those).

```<code>food

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

mood

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

foof

 ――  ――
|  ||  |
|  ||  |
 ――  ――
 ――  ――
|  ||  |
|  ||  |
 ――  ――

fool

 ――――――
|  ||  |
|  ||  |
|――  ――|
|――  ――|
|  ||  |
|  ||  |
 ――――――

a [2*2 grid of spaces]

to

 ||
―  ―
―  ―
 ||

it

 ――
|  |
|  |
 ――

tt [4*4 grid of spaces]

abc

 ――――
| ―― |
||  ||
||  ||
| ―― |
 ――――

and

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

but

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

you

 ||||
― ―― ―
―|  |―
―|  |―
― ―― ―
 ||||

bob

 ―  ―
| || |
 ―  ―
 ―  ―
| || |
 ―  ―

cat

 |――|
― ―― ―
||  ||
||  ||
― ―― ―
 |――|

cart

 |――――|
― ―――― ―
|| ―― ||
|||  |||
|||  |||
|| ―― ||
― ―――― ―
 |――――|

todo

 ||||||
― |  | ―
―― ―― ――
― |  | ―
― |  | ―
―― ―― ――
― |  | ―
 ||||||

mice

 ||||||
― |||| ―
―― ―― ――
――|  |――
――|  |――
―― ―― ――
― |||| ―
 ||||||

zyxw

 ||||||
― |||| ―
―― || ――
―――  ―――
―――  ―――
―― || ――
― |||| ―
 ||||||

banana

 |―|―||―|―|
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
 |―|―||―|―|

codegolf

 ――――――――――――――
| ||| |||| ||| |
|― ―――――――――― ―|
|―| ―――――――― |―|
|―|| ――||―― ||―|
| ||| |||| ||| |
|―|||― || ―|||―|
|―||―――  ―――||―|
|―||―――  ―――||―|
|―|||― || ―|||―|
| ||| |||| ||| |
|―|| ――||―― ||―|
|―| ―――――――― |―|
|― ―――――――――― ―|
| ||| |||| ||| |
 ――――――――――――――

programming

 ―||―||||||||||||―||―
| || |||||||||||| || |
―― |―||||||||||||―| ――
――― ―|――――  ――――|― ―――
| || |||||||||||| || |
――――― ―――――――――― ―――――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
―――|―|―― ―||― ――|―|―――
―――|―|||| || ||||―|―――
――― ―|――――  ――――|― ―――
――― ―|――――  ――――|― ―――
―――|―|||| || ||||―|―――
―――|―|―― ―||― ――|―|―――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
――――― ―――――――――― ―――――
| || |||||||||||| || |
――― ―|――――  ――――|― ―――
―― |―||||||||||||―| ――
| || |||||||||||| || |
 ―||―||||||||||||―||―

abcdefghijklm

 ――――――――――――――――――――――――
| ―――――――――――――――――――――― |
|| ―――――――――――――――――――― ||
||| ―――――――――――――――――― |||
|||| ―――――――――――――――― ||||
||||| ―――――――――――――― |||||
|||||| ―――――――――――― ||||||
||||||| ―――――――――― |||||||
|||||||| ―――――――― ||||||||
||||||||| ―――――― |||||||||
|||||||||| ―――― ||||||||||
||||||||||| ―― |||||||||||
||||||||||||  ||||||||||||
||||||||||||  ||||||||||||
||||||||||| ―― |||||||||||
|||||||||| ―――― ||||||||||
||||||||| ―――――― |||||||||
|||||||| ―――――――― ||||||||
||||||| ―――――――――― |||||||
|||||| ―――――――――――― ||||||
||||| ―――――――――――――― |||||
|||| ―――――――――――――――― ||||
||| ―――――――――――――――――― |||
|| ―――――――――――――――――――― ||
| ―――――――――――――――――――――― |
 ―――――――――――――――――――――――― </code>```

Scoring

This is code-golf, the shortest code in bytes wins. Tiebreaker goes to the earlier answer.

Notes

Any instance of horizontal bar (―) in your code may be counted as 1 byte instead of the 3 UTF-8 bytes it actually takes up. (Up to ten instances.)

If desired you may use regular dashes (-) in place of horizontal bars (―).

Removing or adding trailing spaces in the lines of a wordenticon is not allowed (even if the shape remains unchanged). It should be an exact 2*length(S) side length text square.

The output wordenticon may optionally have a single trailing newline.

答:
Octave, 39 bytes

```<code>@(x)'| -'(sign([x,y=flip(x)]-[x y]')+2)
</code>```

Creates an anonymous function that is able to be run using ans('string').

Demo

Explanation

This solution combines the input string (x) and it's inverse (flip(x)) using [x, flip(x)]. The inverse is assigned to y to shorten the answer, [x, y = flip(x)]. We then create a column vector of the same thing by combining x and y and taking the transpose: [x,y]'. Then we take the difference which will automatically broadcast to create a 2D array of differences between any ASCII representations of letters in the strings. We use sign to make these either -1, 0, or 1 and then add 2 to get valid 1-based index values. We then use these to index into the initial string '| -'.

Title: Generate Wordenticons

Body:
Octave, 39 bytes

@(x)'| -'(sign([x,y=flip(x)]-[x y]')+2)

Creates an anonymous function that is able to be run using ans('string').

Demo

Explanation

This solution combines the input string (x) and it's inverse (flip(x)) using [x, flip(x)]. The inverse is assigned to y to shorten the answer, [x, y = flip(x)]. We then create a column vector of the same thing by combining x and y and taking the transpose: [x,y]'. Then we take the difference which will automatically broadcast to create a 2D array of differences between any ASCII representations of letters in the strings. We use sign to make these either -1, 0, or 1 and then add 2 to get valid 1-based index values. We then use these to index into the initial string '| -'.


答:
MATL, 8 bytes

```<code>:t~y_vG)
</code>```

The result is 1-based.

Try it online!

Explanation

This builds the 2D array

```<code> 1  2  3  4  5 ...
 0  0  0  0  0 ...
-1 -2 -3 -4 -5 ...
</code>```

and then uses linear indexing to extract the desired term. Linear indexing means index down, then across (so in the above array the first entries in linear order are 1, 0, -1, 2, 0, ...)

```<code>:     % Vector [1 2 ... N], where N is implicit input
t~    % Duplicate and logical negate: vector of zeros
y_    % Duplicate array below the top and negate: vector [-1 -2 ... -N]
v     % Concatenate all stack contents vertically
G)    % Index with input. Implicit display
</code>```

Title: Alternating Sign Sequence

Body:
Introduction

The sign of a number is either a +, or a - for every non-zero integer. Zero itself is signless (+0 is the same as -0). In the following sequence, we are going to alternate between the positive sign, the zero and the negative sign. The sequence starts with 1, so we write 1 with a positive sign, with zero (this one is weird, but we just multiply the number by 0) and the negative sign:

```<code>1, 0, -1
</code>```

The next number is 2, and we do the same thing again:

```<code>2, 0, -2
</code>```

The sequence eventually is:

```<code>1, 0, -1, 2, 0, -2, 3, 0, -3, 4, 0, -4, 5, 0, -5, 6, 0, -6, 7, 0, -7, ...
</code>```

Or a more readable form:

```<code>a(0) = 1
a(1) = 0
a(2) = -1
a(3) = 2
a(4) = 0
a(5) = -2
a(6) = 3
a(7) = 0
a(8) = -3
a(9) = 4
...
</code>```

The Task

Given a non-negative integer n, output the nth term of the above sequence. You can choose if you use the zero-indexed or one-indexed version.

Test cases:

Zero-indexed:

```<code>a(0) = 1
a(11) = -4
a(76) = 0
a(134) = -45
a(296) = -99
</code>```

Or if you prefer one-indexed:

```<code>a(1) = 1
a(12) = -4
a(77) = 0
a(135) = -45
a(297) = -99
</code>```

This is code-golf, so the submission with the smallest number of bytes wins!

Body:
MATL, 8 bytes

:t~y_vG)

The result is 1-based.

Try it online!

Explanation

This builds the 2D array

 1  2  3  4  5 ...
 0  0  0  0  0 ...
-1 -2 -3 -4 -5 ...

and then uses linear indexing to extract the desired term. Linear indexing means index down, then across (so in the above array the first entries in linear order are 1, 0, -1, 2, 0, ...)

:     % Vector [1 2 ... N], where N is implicit input
t~    % Duplicate and logical negate: vector of zeros
y_    % Duplicate array below the top and negate: vector [-1 -2 ... -N]
v     % Concatenate all stack contents vertically
G)    % Index with input. Implicit display


问:
The game of Sevens! Who said what?
The game of Sevens is played as follows: n players sit in a circle, and start counting up from 1, passing to the left (or from player A to player B).

When a number p that has a 7 in it OR is divisible by 7 is reached, then the player who spoke the number p-1, after the next player says p, must say p+1 and the order of people speaking reverses. For example, if player B speaks 6, player C says 7, B says 8, and player A says 9.

Note: For those who want to play in real life, if a person forgets a number (or in the version where sevens are not said, accidentally says a seven), they are eliminated from the circle, but we will omit this detail from this challenge.

The challenge itself is to print which numbers each player should say in a perfect game of Sevens up to an input m for an input n players.

As an example, where five people, A, B, C, D, and E, are to play till they reach 30. They play in this manner

```<code>A: 1 6 8 13    15 19       23    30
B: 2 7*  12    16 18       24
C: 3     11    17*         25
D: 4     10          21*   26 28*
E: 5      9 14*      20 22 27*29
</code>```

where sevens are marked with *. Note that at 27 and 28, we're reversing twice, and play continues "as normal" from D to E.

Please note that the output does not have to be in the above format. I simply printed it that way for some clarity.

Rules

The input is two integers in any order, m representing the last number to say, n representing the number of players.

The output can be several arrays or several strings, one for each player. If you use strings, you do not have to use separators (though, if you could add some in your code tests, we would appreciate the readability). If you can actually print them in a circle somehow, that is acceptable as well, and it would be pretty cool too.

The output does not have to designate which players are which (it's fairly obvious that the first player is the one who says 1), though if the output isn't sorted for whatever reason, you should make clear which player is speaking which set of numbers. Omitting players who do not say anything is also allowed if you make it clear which players are speaking. I will add some more examples of possible outputs below.

This is code golf, so the smallest number of bytes wins.

As always, if the problem is unclear, please let me know. Good luck and good golfing!

Examples

```<code>>>> sevens_string(30, 5, " ")
'1 6 8 13 15 19 23 30'
'2 7 12 16 18 24'
'3 11 17 25'
'4 10 21 26 28'
'5 9 14 20 22 27 29'
>>> sevens_string(42, 5)
'16813151923303539'
'27121618243140'
'31117253241'
'410212628333742'
'591420222729343638'
>>> sevens_array(20, 3)
[1, 4, 7, 10, 13, 15, 19]
[2, 5, 9, 12, 16, 18]
[3, 6, 8, 11, 14, 17, 20]
>>> sevens_array(18, 10)
[1, 13, 15]
[2, 12, 16, 18]
[3, 11, 17]
[4, 10]
[5, 9]
[6, 8]
[7]
[]
[]
[14]
</code>```

答:
Python 3, 155 bytes

```<code>from turtle import*
def f(m,n,i=0,r=20,d=360):
 k=n
 while i<m:i+=1;fd(r);write(i);bk(r);e='7'[:i%7]in str(i);d*=1-2*e;k=~-e*(1-k)%n;r+=(k<1)*15;rt(d/n)
</code>```

Uses turtle graphics to print in a circle such that numbers spoken by the same player are on the same radius. The radius of the circle is increased when the direction is reversed, or when the sequence wraps around the circle, so previous numbers aren't overwritten.

Sample output for f(22,6)

Title: The game of Sevens! Who said what?

Body:
Python 3, 155 bytes

from turtle import*
def f(m,n,i=0,r=20,d=360):
 k=n
 while i<m:i+=1;fd(r);write(i);bk(r);e='7'[:i%7]in str(i);d*=1-2*e;k=~-e*(1-k)%n;r+=(k<1)*15;rt(d/n)

Uses turtle graphics to print in a circle such that numbers spoken by the same player are on the same radius. The radius of the circle is increased when the direction is reversed, or when the sequence wraps around the circle, so previous numbers aren't overwritten.

Sample output for f(22,6)


答:
Perl 5, 22 bytes

21 plus one for -p:

```<code>$_=(-$_,$_+2)[$_%3]/3
</code>```

Uses 1-based indexing.

Explanation:

-p sets the variable $_ equal to the input. The code then sets it equal to the $_%3th element, divided by 3, of the 0-based list (-$_,$_+2) (where % is modulo). Note that if $_%3 is two, then there is no such element, and the subsequent division by 3 numifies the undefined to 0. -p then prints $_.

Title: Alternating Sign Sequence

Body:
Perl 5, 22 bytes

21 plus one for -p:

$_=(-$_,$_+2)[$_%3]/3

Uses 1-based indexing.

Explanation:

-p sets the variable $_ equal to the input. The code then sets it equal to the $_%3th element, divided by 3, of the 0-based list (-$_,$_+2) (where % is modulo). Note that if $_%3 is two, then there is no such element, and the subsequent division by 3 numifies the undefined to 0. -p then prints $_.


答:
Actually, 10 bytes

```<code>3@│\u)%1-*
</code>```

Try it online!

Explanation:

```<code>3@│\u)%1-*
3@│         push 3, swap, duplicate entire stack ([n 3 n 3])
   \u)      floor division, increment, move to bottom ([n 3 n//3+1])
      %1-   mod, subtract from 1 ([1-n%3 n//3+1])
         *  multiply ([(1-n%3)*(n//3+1)])
</code>```

Title: Alternating Sign Sequence

Body:
Actually, 10 bytes

3@│\u)%1-*

Try it online!

Explanation:

3@│\u)%1-*
3@│         push 3, swap, duplicate entire stack ([n 3 n 3])
   \u)      floor division, increment, move to bottom ([n 3 n//3+1])
      %1-   mod, subtract from 1 ([1-n%3 n//3+1])
         *  multiply ([(1-n%3)*(n//3+1)])


Title: Display "Happy Easter!"

Body:
Your task is to print the following ASCII Art:

```<code> _     _                            _______                           _
| |   | |                          (_______)          _              | |
| |__ | | ____ ____  ____  _   _    _____   ____  ___| |_  ____  ____| |
|  __)| |/ _  |  _ \|  _ \| | | |  |  ___) / _  |/___)  _)/ _  )/ ___)_|
| |   | ( ( | | | | | | | | |_| |  | |____( ( | |___ | |_( (/ /| |    _
|_|   |_|\_||_| ||_/| ||_/ \__  |  |_______)_||_(___/ \___)____)_|   |_|
              |_|   |_|   (____/
</code>```

Remember, this is code-golf, so the code with the smallest amount of bytes wins.
Good luck.

Body:
Vim, <s>374</s> <s>365</s> <s>326</s> <s>319</s> <s>313</s> <a href="http://retina.tryitonline.net/#code=KDxbXjw-XSs-fC4p&input=OmltIEAgX19fPENSPgo6aW0gJSBffDxDUj4KYSBfIyMgXzxlc2M-MjhhIDxlc2M-eWw3YV88ZXNjPjI3cGFfIDxDUj4KfCEjISE8ZXNjPjI2cGEoPGVzYz43YV88ZXNjPmEpPGVzYz4xMHBhXzxlc2M-MTRwYXwhPENSPgp8IV9fISE8ZXNjPjNhIEBfPGVzYz5iaSA8ZXNjPkEjXyMgXyMjQF9fIyBAXyNAfCFfI0BfI0AlITxDUj4KfCNfXyl8IS8gXyAhI18gXHwjXyBcPGVzYz40YXwgPGVzYz5hISNAKSAvIF8gIS9AKSNfKS8gXyMpLyBAKSU8Q1I-CnwhIyEgKCAoPGVzYz45YSE8ZXNjPmElISAhIUBfKCAoISFAISFfKCAoLyAvfCEjI18gPENSPgp8JSMhJVwlfF88ZXNjPjJhfCF8Xy88ZXNjPmEgXF9fICEgITxlc2M-N2FfPGVzYz5hKSV8XyhALyBcQClAXyklIyElPENSPgo8ZXNjPjE0cGF8JSMhJSMgKEBfLzxlc2M-Cjolcy8hLyB8L2c8Q1I-Cjolcy8jLyAgL2c8Q1I-" rel="nofollow noreferrer">311 keystrokes

9 keystrokes thanks to @Dr Green Eggs and Ham DJ .

:im @ ___<CR>
:im % _|<CR>
a _## _<esc>28a <esc>yl7a_<esc>27pa_ <CR>
|!#!!<esc>26pa(<esc>7a_<esc>a)<esc>10pa_<esc>14pa|!<CR>
|!__!!<esc>3a @_<esc>bi <esc>A#_# _##@__# @_#@|!_#@_#@%!<CR>
|#__)|!/ _ !#_ \|#_ \<esc>4a| <esc>a!#@) / _ !/@)#_)/ _#)/ @)%<CR>
|!#! ( (<esc>9a!<esc>a%! !!@_( (!!@!!_( (/ /|!##_ <CR>
|%#!%\%|_<esc>2a|!|_/<esc>a \__ ! !<esc>7a_<esc>a)%|_(@/ \@)@_)%#!%<CR>
<esc>14pa|%#!%# (@_/<esc>
:%s/!/ |/g<CR>
:%s/#/  /g<CR>

Probably can be golfed further by using :nn?


问:
Is the gas lighter than air?
Air balloons need a gas that is lighter than air. However, hydrogen is flammable, while helium is not sustainable, so we need a replacement! You must write code that determines whether any given gas is lighter than air.

Input: a molecular chemical formula of a gas (ASCII)

Output: true if the gas is lighter than air; false otherwise (see here for consensus on what can be used as true and false).

If the chemical formula doesn't represent a gas (at standard conditions), or if it's a nonsense, any behavior is acceptable.

That is to say, you can assume the following:

The input is a valid chemical formula

The input is a molecular chemical formula: all element symbols are mentioned only once, and there are no parentheses

The chemical substance exists at normal conditions

The chemical substance is a gas at normal conditions

As a special case, H2O (water vapor) is considered a gas, because you can mix a significant quantity of it with air at standard conditions.

Whether or not a gas is lighter than air can be determined by calculating its molar mass:

Extract the chemical element symbols from the formula. Their atomic masses are given by the following table:

H - 1

He - 4

B - 11

C - 12

N - 14

O - 16

F - 19

Ne - 20

Others - greater values

Calculate the molar mass, which is the sum of all the atomic masses. If the molar mass is less than 29, the gas is lighter than air.

Test cases:

```
H2      true
He      true
B2H6    true
CH4     true
C2H2    true
C2H4    true
HCN     true
N2      true
NH3     true
H2O     true
CO      true
HF      true
Ne      true
O2      false
C2H6    false
C4H10   false
H2S     false
COH2    false
CO2     false
SiH4    false
NO      false
BN      behavior nor specified: not a gas
HBO2    behavior nor specified: not a gas
F2O     behavior nor specified: incorrect formula
CH3     behavior nor specified: incorrect formula
HCOOH   behavior nor specified: not a molecular formula
B(OH)3  behavior nor specified: not a molecular formula
XYZ     behavior nor specified: nonsense
```

(Note: this is meant to be an enumeration of all possible inputs that generate true. If I forgot some, I'll add it. In any case, Wikipedia is the answer for questions like "Does substance X exist?", "Is it a gas?")

A related (but different) question: calculate the molar mass

答:
Perl 5, 52 bytes

51 plus 1 for -p:

```<code>$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O?|e)|N2|NH3|Ne|CO)$/
</code>```

or

```<code>$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O)|[HN][e2]|NH3|CO)$/
</code>```

or any of a few similar scripts.

Based (obviously) on MattPutnam's Clojure answer.

Title: Is the gas lighter than air?

Body:
Perl 5, 52 bytes

51 plus 1 for -p:

$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O?|e)|N2|NH3|Ne|CO)$/

or

$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O)|[HN][e2]|NH3|CO)$/

or any of a few similar scripts.

Based (obviously) on MattPutnam's Clojure answer.


答:
Python 2, 119 bytes

```<code>def g(n,i=0,s=''):
 c=x=t=0
 for d in s:C=int(d)*2-1;t=(c==C)*t+1;c=C;x+=c*t
 return(x==n)*len(s)or g(n,i+1,bin(i)[3:])
</code>```

Very slow brute-force approach. The third line computes the score of a string x; the other lines loop over all possible binary strings until one whose score equals the argument is found.

@Leaky saved three bytes!

Title: My "keybore" is key-boring me! Help me find a minimal keystrokes

Body:
Credits to @Agawa001 for coming up with this question.

Explanation

My new "keybore" only has 2 buttons, namely + and -.

The number in the memory starts at 0.

Each consecutive press of + or - will increment/decrement the memory for exactly how many times it has been pressed consecutively.

Therefore, if you press + 4 times, first time it adds 1, the second time it adds 2, the third time it adds 3, the fourth time it adds 4, giving you 10 (ten).

Now, if you press - 3 times, the first time it subtracts 1, the second time 2, the third time 3, leaving you with 4 (four).

TL;DR

Given a string of + and -, divide it at each change of character. Then each resulting string of m + symbols adds the m-th triangle number, and each string of n - symbols subtracts the n-th triangle number.

Walk-through

Now, if you still do not understand, I will show you how +++--+-- creates 1.

```<code>Program   | Counter | Memory
----------------------------
          |  0      | 0
+         | +1      | 1
++        | +2      | 3
+++       | +3      | 6
+++-      | -1      | 5
+++--     | -2      | 3
+++--+    | +1      | 4
+++--+-   | -1      | 3
+++--+--  | -2      | 1
</code>```

Task

You will take a positive integer as input, either as functional argument or from STDIN.

Then, you will output/print the minimum number of keystrokes needed to create that number using the method above.

Testcases

Since rearranging the + or - runs gives the same number, for each such group only the lexicographically earliest sequence is listed.

```<code>Input | Output | Possible corresponding sequences
-------------------------------------------------
    4 |      5 | -+++-
    6 |      3 | +++
    9 |      5 | ++++-
   11 |      7 | +++-+++
   12 |      7 | +++++--, ++++-++
   19 |      8 | -++++++-
   39 |     12 | +++++++++---
   40 |     13 | +++++++++---+, ++++++++-+++-
   45 |      9 | +++++++++
   97 |     20 | ++++++++++++++--+---, +++++++++++++-++++--, ++++++++++++-++++++-
  361 |     34 | ++++++++++++++++++++++++++-+++-+++
</code>```

Extra resources

Proof that any number can be made: basically, by repeating ++-, you can obtain any even number. To obtain the odd numbers, just put a + at the end.

Another general way to obtain any number. For example, to generate 50, a way is to press + 50 times, and then press - 49 times.

Solution of the first 50 numbers.

Obligatory JSFiddle.

Scoring

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

Body:
Python 2, 119 bytes

def g(n,i=0,s=''):
 c=x=t=0
 for d in s:C=int(d)*2-1;t=(c==C)*t+1;c=C;x+=c*t
 return(x==n)*len(s)or g(n,i+1,bin(i)[3:])

Very slow brute-force approach. The third line computes the score of a string x; the other lines loop over all possible binary strings until one whose score equals the argument is found.

@Leaky saved three bytes!


答:
Pyth, 25 bytes

```<code>ffqyQ.as-Mc*RhdY2{s.pM./T
</code>```

Try it online.

This is extremely inefficient, and runs out of memory for f(n) ≥ 11. It calculates f(22) = 10 in about 10 seconds on my laptop.

Explanation

Starting from 1, loop through numbers T. (f)

Generate all partitions of T. (./T)

Generate all permutations of those. (.pM)

Flatten the list. (s)

Uniquify the list. ({) This step could be removed, but it makes the  code much faster.

Filter the resulting permutations of partitions: (f)

Multiply each number d of the partition (*R) by itself plus one (hd). This gives double the number to add/subtract to the result.

Chop the list to parts of length 2. (c…2)

Subtract any second number in those parts from the second number. (-M)

Sum the results. This gives double the resulting number if the partition permutation was interpreted as number of additions, then subtractions, etc.

Take the absolute value. (.a) If the result was negative, swapping the additions and subtractions gets the positive result.

Check if the result equals double the input. (qyQ) In this case the partition permutation is correct, return it.

If the filter returned any results, there was a solution of length T. Return and print T.

Body:
Pyth, 25 bytes

ffqyQ.as-Mc*RhdY2{s.pM./T

Try it online.

This is extremely inefficient, and runs out of memory for f(n) ≥ 11. It calculates f(22) = 10 in about 10 seconds on my laptop.

Explanation

Starting from 1, loop through numbers T. (f)

Generate all partitions of T. (./T)

Generate all permutations of those. (.pM)

Flatten the list. (s)

Uniquify the list. ({) This step could be removed, but it makes the  code much faster.

Filter the resulting permutations of partitions: (f)

Multiply each number d of the partition (*R) by itself plus one (hd). This gives double the number to add/subtract to the result.

Chop the list to parts of length 2. (c…2)

Subtract any second number in those parts from the second number. (-M)

Sum the results. This gives double the resulting number if the partition permutation was interpreted as number of additions, then subtractions, etc.

Take the absolute value. (.a) If the result was negative, swapping the additions and subtractions gets the positive result.

Check if the result equals double the input. (qyQ) In this case the partition permutation is correct, return it.

If the filter returned any results, there was a solution of length T. Return and print T.


问:
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.

The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. :D

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainf**k-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.

Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be  improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

```<code># Language name, X bytes
</code>```

Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

```<code>#[Language name](http://link.to/the/language), X bytes
</code>```

Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//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"//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}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;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">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
niblet, 2 bytes

```<code> [
</code>```

The space is just a no-op, and the [ moves the IP to the previous character.

Body:
niblet, 2 bytes

 [

The space is just a no-op, and the [ moves the IP to the previous character.


问:
Make your language unusable
Try to write some code in your language and make it not satisfying our criteria of being a programming language any more.

A language satisfies our criteria (simplified version for this challenge) of being a programming language if:

It can read user input representing tuples of positive integers in some way.

It can output at least two different possible results depending on the input.

It can take two positive integers and add them (and the result can affect the output).

It can take a positive integer and decide whether it is a prime (and the result can affect the output).

For the purpose of this challenge, any kind of output that isn't an allowed output method for a normal challenge is ignored. So it doesn't matter whether the program can also play a piece of music, or posting via HTTP, etc.

Update: You can also choose one or some of the allowed output methods, and ignore all the others. But you must use the same definition everywhere in the following criteria. And if your program can disable more than one output methods — that worths more upvotes.

Examples like making it not able to output, or disabling all the loop constructs so it won't be able to do primality test and making sure the user cannot re-enable them.

You should leave a place for inserting new code. By default, it is at the end of your code. If we consider putting the source code in that place in your answer and running the full code as a complete program the interpreter of a new language, that language should not satisfy the criteria.

But the inserted code must be executed in such a way like a language satisfying the criteria:

The inserted code must be grammatically the same as something (say it's a code block in the following criteria) that generally do satisfy the criteria, from the perspective of whoever wants to write a syntax highlighter. So it cannot be in a string, comment, etc.

The inserted code must be actually executed, in a way it is supposed to satisfy the criteria. So it cannot be in an unused function or sizeof in C, you cannot just execute only a non-functional part in the code, and you cannot put it after an infinite loop, etc.

You can't limit the number of possible grammatically correct programs generated this way. If there is already something like a length limit in the language you are using, it shouldn't satisfy the criteria even if this limit is removed.

You can't modify or "use up" the content of input / output, but you can prevent them from being accessed.

These criteria usually only applies to languages without explicit I/O:

Your code should redirect the user input (that contains informations of arbitrary length) to the inserted code, if a code block isn't usually able to get the user input directly / explicitly in the language you are using.

Your code should print the returned value of the inserted code, if a code block isn't usually able to output things directly / explicitly in the language you are using.

In case you print the returned value, and it is typed in the language you are using, the returned type should be able to have 2 different practically possible values. For example, you cannot use the type struct {} or struct {private:int x;} in C++.

This is popularity-contest. The highest voted valid answer (so nobody spotted an error or all errors are fixed) wins.

Clarifications

You shouldn't modify the code in the text form, but can change the syntax before the code is interpreted or compiled.

You can do other things while the code is running. But the reason that it doesn't satisfy the criteria should be within the inserted code itself. It can error because of the interference of another thread, but not just be killed by another thread.

All the specs basically means it should be grammatically likely satisfying the criteria if all the built-ins were not changed but not actually do. It's fine if you find any non-grammatical workarounds, such as passing the parameters to the code block correctly, but make them not able to be used in some way.

Again, the inserted code must be actually executed. Code after an infinite loop or crashing is considered "not actually executed", thus not valid. Those answers might be interesting, but there are already some other infinite loop or crashing questions on this site, and you may find a more appropriate one to answer. If not, consider asking a new question. Examples of those questions are:

Shortest infinite loop producing no output

Why isn't it ending?

Loop without 'looping'

Challenge: Write a piece of code that quits itself

Ridiculous Runtime Errors

Crash your favorite compiler

Leaderboard

var QUESTION_ID=61115/*,OVERRIDE_USER=8478*/;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()*/(more_answers?getAnswers():process())}})}/*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),score:s.score,language:a[1],lang:jQuery('
').html(a[1]).text(),link:s.share_link})}),e.sort(function(e,s){var r=e.score,a=s.score;return a-r});var s={},r=1,a=null,n=1;e.forEach(function(e){e.score!=a&&(n=r),a=e.score,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",e.n=n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.score).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang.toUpperCase())-(e.lang.toUpperCase()<s.lang.toUpperCase())||(e.lang>s.lang)-(e.lang<s.lang)});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{PLACE}}",o.n).replace("{{LANGUAGE}}",o.language).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.score).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|(?!.*<h\d>)p)>\s*((?:[^,;(\s]| +[^-,;(\s])+)(?=(?: *(?:[,;(]| -).*?)?\s*<\/(h\d|p)>)/,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;float:left}table{width:250px}table thead{font-weight:700}table td{padding:5px}</code>```

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

Leaderboard

	Author	Language	Score

Sorted by Language

	Language	User	Score

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

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

```

答:
Python 3 REPL

def f():
    import gc
    obs = gc.get_objects()
    for ob in obs:
       if isinstance(ob, dict) and ob is not locals() and ob is not __builtins__.__dict__ and ob is not globals():
           ob.clear()
f()
#What can you do now!
```

Title: Make your language unusable


Title: Display "Happy Easter!"

Body:
HTML, 482 481 475 bytes

<pre> _     _                            _______                           _
| |   | |                          (_______)          _              | |
| |__ | | ____ ____  ____  _   _    _____   ____  ___| |_  ____  ____| |
|  __)| |/ _  |  _ \|  _ \| | | |  |  ___) / _  |/___)  _)/ _  )/ ___)_|
| |   | ( ( | | | | | | | | |_| |  | |____( ( | |___ | |_( (/ /| |    _
|_|   |_|\_||_| ||_/| ||_/ \__  |  |_______)_||_(___/ \___)____)_|   |_|
              |_|   |_|   (____/


答:
Julia, 70 bytes

This is my first attempt at code golf and I have not used Julia before, so tell me what you think:

```<code>f(s)=join([join([r>c?'|':r<c?'―':' 'for c=s])for r=s*=reverse(s)],"
")
</code>```

Try it online!

Ungolfed:

```<code>function wordenticon(word::AbstractString)
    word*=reverse(word)
    join([
        join([
            if r>c
                '|'
            elseif r<c
                '―'
            else
                ' '
            end
            for c in word
        ])
        for r in word]
        ,"\n"
    )
end
</code>```

I think it could probably be made shorter. This code stores the characters of the wordicon in a matrix:

```<code>f(s)=[r>c?'|':r<c?'―':' 'for r=s*=reverse(s),c=s]
</code>```

Unfortunately, I couldn't manage to produce the desired output using the matrix.

Title: Generate Wordenticons

Body:
Identicons are visual depictions of hash values, often made from symmetrical arrangements of geometric shapes. Your default Stack Exchange avatar is an identicon. This challenge is about creating "wordenticons", simple text-based versions of identicons that apply to strings of lowercase letters, i.e. words.

Challenge

Write a program or function that takes in a string S and outputs its wordenticon. S is guaranteed to be nonempty and only contain lowercase English letter characters a-z. You may optionally assume S has a trailing newline.

The wordenticon of S will be a square grid of text with side lengths 2*length(S) composed of spaces ( ), vertical bars, (|), and horizontal bars (―).

To generate the wordenticon of S, form a square grid where every column corresponds to a letter of S (in normal left-to-right reading order) and every row corresponds to a letter of S (in normal top-to-bottom reading order).

For example, if S is food our initial grid looks like

```<code> food
f....
o....
o....
d....
</code>```

where . is just a placeholder.

For every empty point (every .) in the grid:

If the column letter comes before the row letter alphabetically, replace the . with |.

If the column letter comes after the row letter alphabetically, replace the . with ―.

If the column and row letters are the same, replace the . with   (space).

Here is the food example after each of these steps:

Adding |'s:

```<code> food
f...|
o|..|
o|..|
d....
</code>```

Adding ―'s:

```<code> food
f.――|
o|..|
o|..|
d―――.
</code>```

Adding  's:

```<code> food
f ――|
o|  |
o|  |
d―――
</code>```

To complete the wordenticon, remove the superfluous row and column containing the words

```<code> ――|
|  |
|  |
―――
</code>```

then mirror the entire thing horizontally

```<code> ――||――
|  ||  |
|  ||  |
―――  ―――
</code>```

and finally mirror it again vertically

```<code> ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――
</code>```

resulting in the 2*length(S) side length text grid that is the final wordenticon.

Examples

Here are some additional wordenticon examples. Note that different words can have identical wordenticons and some wordenticons can be completely made of spaces (unfortunately markdown does not want to render those).

```<code>food

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

mood

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

foof

 ――  ――
|  ||  |
|  ||  |
 ――  ――
 ――  ――
|  ||  |
|  ||  |
 ――  ――

fool

 ――――――
|  ||  |
|  ||  |
|――  ――|
|――  ――|
|  ||  |
|  ||  |
 ――――――

a [2*2 grid of spaces]

to

 ||
―  ―
―  ―
 ||

it

 ――
|  |
|  |
 ――

tt [4*4 grid of spaces]

abc

 ――――
| ―― |
||  ||
||  ||
| ―― |
 ――――

and

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

but

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

you

 ||||
― ―― ―
―|  |―
―|  |―
― ―― ―
 ||||

bob

 ―  ―
| || |
 ―  ―
 ―  ―
| || |
 ―  ―

cat

 |――|
― ―― ―
||  ||
||  ||
― ―― ―
 |――|

cart

 |――――|
― ―――― ―
|| ―― ||
|||  |||
|||  |||
|| ―― ||
― ―――― ―
 |――――|

todo

 ||||||
― |  | ―
―― ―― ――
― |  | ―
― |  | ―
―― ―― ――
― |  | ―
 ||||||

mice

 ||||||
― |||| ―
―― ―― ――
――|  |――
――|  |――
―― ―― ――
― |||| ―
 ||||||

zyxw

 ||||||
― |||| ―
―― || ――
―――  ―――
―――  ―――
―― || ――
― |||| ―
 ||||||

banana

 |―|―||―|―|
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
 |―|―||―|―|

codegolf

 ――――――――――――――
| ||| |||| ||| |
|― ―――――――――― ―|
|―| ―――――――― |―|
|―|| ――||―― ||―|
| ||| |||| ||| |
|―|||― || ―|||―|
|―||―――  ―――||―|
|―||―――  ―――||―|
|―|||― || ―|||―|
| ||| |||| ||| |
|―|| ――||―― ||―|
|―| ―――――――― |―|
|― ―――――――――― ―|
| ||| |||| ||| |
 ――――――――――――――

programming

 ―||―||||||||||||―||―
| || |||||||||||| || |
―― |―||||||||||||―| ――
――― ―|――――  ――――|― ―――
| || |||||||||||| || |
――――― ―――――――――― ―――――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
―――|―|―― ―||― ――|―|―――
―――|―|||| || ||||―|―――
――― ―|――――  ――――|― ―――
――― ―|――――  ――――|― ―――
―――|―|||| || ||||―|―――
―――|―|―― ―||― ――|―|―――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
――――― ―――――――――― ―――――
| || |||||||||||| || |
――― ―|――――  ――――|― ―――
―― |―||||||||||||―| ――
| || |||||||||||| || |
 ―||―||||||||||||―||―

abcdefghijklm

 ――――――――――――――――――――――――
| ―――――――――――――――――――――― |
|| ―――――――――――――――――――― ||
||| ―――――――――――――――――― |||
|||| ―――――――――――――――― ||||
||||| ―――――――――――――― |||||
|||||| ―――――――――――― ||||||
||||||| ―――――――――― |||||||
|||||||| ―――――――― ||||||||
||||||||| ―――――― |||||||||
|||||||||| ―――― ||||||||||
||||||||||| ―― |||||||||||
||||||||||||  ||||||||||||
||||||||||||  ||||||||||||
||||||||||| ―― |||||||||||
|||||||||| ―――― ||||||||||
||||||||| ―――――― |||||||||
|||||||| ―――――――― ||||||||
||||||| ―――――――――― |||||||
|||||| ―――――――――――― ||||||
||||| ―――――――――――――― |||||
|||| ―――――――――――――――― ||||
||| ―――――――――――――――――― |||
|| ―――――――――――――――――――― ||
| ―――――――――――――――――――――― |
 ―――――――――――――――――――――――― </code>```

Scoring

This is code-golf, the shortest code in bytes wins. Tiebreaker goes to the earlier answer.

Notes

Any instance of horizontal bar (―) in your code may be counted as 1 byte instead of the 3 UTF-8 bytes it actually takes up. (Up to ten instances.)

If desired you may use regular dashes (-) in place of horizontal bars (―).

Removing or adding trailing spaces in the lines of a wordenticon is not allowed (even if the shape remains unchanged). It should be an exact 2*length(S) side length text square.

The output wordenticon may optionally have a single trailing newline.

Body:
Julia, 70 bytes

This is my first attempt at code golf and I have not used Julia before, so tell me what you think:

f(s)=join([join([r>c?'|':r<c?'―':' 'for c=s])for r=s*=reverse(s)],"
")

Try it online!

Ungolfed:

function wordenticon(word::AbstractString)
    word*=reverse(word)
    join([
        join([
            if r>c
                '|'
            elseif r<c
                '―'
            else
                ' '
            end
            for c in word
        ])
        for r in word]
        ,"\n"
    )
end

I think it could probably be made shorter. This code stores the characters of the wordicon in a matrix:

f(s)=[r>c?'|':r<c?'―':' 'for r=s*=reverse(s),c=s]

Unfortunately, I couldn't manage to produce the desired output using the matrix.


问:
Print cos(2π/17) exactly
One way to construct a regular heptadecagon starts with drawing a horizontal line of length 1 from the center to a vertex. Then the distance along that line from the center to the second vertex is cos(2π/17). All other vertices are easy to get.

The goal of this challenge is to print (or produce in any other conventional way) an ASCII math expression involving the operations +, -, *, /, sqrt() and the natural numbers, which gives cos(2π/17) when evaluated. The power operator is not allowed: e.g. sqrt(17) cannot be written as 17^(1/2).

For example (formula taken from Wikipedia):

```<code>1/16*(
    -1+
    sqrt(17)+
    sqrt(34-2*sqrt(17))+
    2*sqrt(
        17+
        3*sqrt(17)-
        sqrt(34-2*sqrt(17))-
        2*sqrt(34+2*sqrt(17))
    )
)
</code>```

Whitespace doesn't matter. The length and complexity of the expression doesn't matter, as long as it's syntactically correct (as defined above) and numerically equivalent to cos(2π/17).

Built-in functions are allowed.

Title: Print cos(2π/17) exactly

Body:
Vim, 70 keystrokes

:im a *sqrt(<CR>
:im b a17)<CR>
i(1b-1+1a34-2b)+2b<bsp>+3b-1a34-2b)-2a34+2b)))/16<esc>


问:
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>```

答:
PyCal

Factoid:

PyCal is a math-based programming language written in Python, hence the name. It's designed to compete in code-golf challenges that need math.

Length 1 snippet

```<code>!
</code>```

OK, let me explain a little about PyCal. PyCal has two "variables". One variable's value can be set by the user. The other variable's value comes from the values that some commands return. For example, the F returns the nth Fibonacci number.

Anyways, the ! command outputs the value that is in the user-set variable. By default, it's 0, so the above snippet outputs 0.

Length 2 snippet

```<code>IP
</code>```

This snippet outputs the first n prime numbers as a list.

Let me explain what this does:

I gets input, and converts it to an integer before storing it in the variable. (From now on, I'll call the variable that the user can change "variable". The other one will be called the result. Read snippet 1 for more info)

P takes the variable's value and prints n prime numbers. For example, if the value is 5, it will output the first 5 primes.

So, here's what it will look like if the input is 10:

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

Length 3 snippet

```<code>(7)
</code>```

Ah, it's good to be back, I took a long break.

Anyways, let's get on with the explanation. Well, this is actually really simple. It changes the value of the variable to 7. Of course, this doesn't output anything. You can add a ! to the end to output the number.

Length 4 snippet

(wip)

Length 5 snippet

```<code>(i)S!
</code>```

This snippet gets the square root of the input. (i) sets the value of the variable to the input and converts it into an integer. S calculates the square root.

Title: Showcase of Languages

Body:
PyCal

Factoid:

PyCal is a math-based programming language written in Python, hence the name. It's designed to compete in code-golf challenges that need math.

Length 1 snippet

!

OK, let me explain a little about PyCal. PyCal has two "variables". One variable's value can be set by the user. The other variable's value comes from the values that some commands return. For example, the F returns the nth Fibonacci number.

Anyways, the ! command outputs the value that is in the user-set variable. By default, it's 0, so the above snippet outputs 0.

Length 2 snippet

IP

This snippet outputs the first n prime numbers as a list.

Let me explain what this does:

I gets input, and converts it to an integer before storing it in the variable. (From now on, I'll call the variable that the user can change "variable". The other one will be called the result. Read snippet 1 for more info)

P takes the variable's value and prints n prime numbers. For example, if the value is 5, it will output the first 5 primes.

So, here's what it will look like if the input is 10:

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

Length 3 snippet

(7)

Ah, it's good to be back, I took a long break.

Anyways, let's get on with the explanation. Well, this is actually really simple. It changes the value of the variable to 7. Of course, this doesn't output anything. You can add a ! to the end to output the number.

Length 4 snippet

(wip)

Length 5 snippet

(i)S!

This snippet gets the square root of the input. (i) sets the value of the variable to the input and converts it into an integer. S calculates the square root.


答:
Oracle SQL 12.1, <s>137</s> 135 bytes

SELECT REPLACE(REPLACE(REPLACE(:1,m,2),1,0),2,m)FROM(SELECT MAX(TRIM(COLUMN_VALUE))m FROM XMLTABLE(('"'||REPLACE(:1,0,'",0,"')||'"')));
```

<p>Un-golfed </p>

<pre class="lang-sql prettyprint-override"><code>-- Replace the max value with 2
-- Then replace every 1 with 0
-- Then replace 2 with the max value
SELECT REPLACE(REPLACE(REPLACE(:1,m,2),1,0),2,m)
FROM   ( -- Split on 0 and keep the max value
         SELECT MAX(TRIM(COLUMN_VALUE))m
         FROM XMLTABLE(('"'||REPLACE(:1,'0','",0,"')||'"'))
       );
</code>```

Input use single characters. Ex: '1100111'

Title: Falsify brief truths

Body:
Find the longest run of true in a list of booleans. Return the same list, with all other trues falsified.

Input, output

A list; any usual format (e.g., a delimited list as a string).

Details

True and false can be anything your language typically uses for those values, or the integers 1 and 0. If you use single characters, the list can be a concatenation (e.g., 10001).

If there's a tie for longest run, keep all tying runs true, and falsify all shorter runs.

Examples

```<code>input ↦ output
1,0,1,0,1 ↦ 1,0,1,0,1
1,1,0,1,1,0,1 ↦ 1,1,0,1,1,0,0
1,1,0,1,1,1,0,1,1 ↦ 0,0,0,1,1,1,0,0,0
1,1,1 ↦ 1,1,1
0,0,1 ↦ 0,0,1
0,0 ↦ 0,0
1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,0,1,1,1,1,0,0,1,0 ↦ 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0
</code>```

(directly from https://stackoverflow.com/q/37447114)

Body:
Oracle SQL 12.1, <s>137</s> 135 bytes

SELECT REPLACE(REPLACE(REPLACE(:1,m,2),1,0),2,m)FROM(SELECT MAX(TRIM(COLUMN_VALUE))m FROM XMLTABLE(('"'||REPLACE(:1,0,'",0,"')||'"')));

Un-golfed

-- Replace the max value with 2
-- Then replace every 1 with 0
-- Then replace 2 with the max value
SELECT REPLACE(REPLACE(REPLACE(:1,m,2),1,0),2,m)
FROM   ( -- Split on 0 and keep the max value
         SELECT MAX(TRIM(COLUMN_VALUE))m
         FROM XMLTABLE(('"'||REPLACE(:1,'0','",0,"')||'"'))
       );

Input use single characters. Ex: '1100111'


答:
JavaScript (ES6), 157 bytes

```<code>a=>{for(m=i=0,l=a.length;i<l;i++)for(j=i;++j<l;)for(t=n=a[k=i],c=0;k<l;k++)a[k]==t&&(t+=a[j]-n,++c>m)?q=a[m=c,p=n,j]-n:q;return a.slice(-m).map(_=>(p+=q)-q)}
</code>```

Almost 20 times longer than the Jelly answer... Ungolfed:

```<code>function subsequence(a) {
    var max = 0;
    for (var i = 0; i < a.length; i++) {
        for (var j = i + 1; j < a.length; j++) {
            var target = a[i];
            var count = 0;
            for (var k = i; k < a.length; k++) {
                if (a[k] == target) {
                    count++;
                    target += a[j] - a[i];
                    if (count > max) {
                        max = count;
                        start = a[i];
                        step = a[j] - a[i];
                    }
                }
            }
        }
    }
    var result = new Array(max);
    for (var i = 0; i < max; i++) {
        result[i] = start + step * i;
    }
    return result;
}
</code>```

Title: Longest arithmetic subsequence

Body:
Given a non empty finite sequence of integers, return an arithmetic subsequence of maximal length.

If there are multiple of the same maximal length, any of them can be returned.

Definitions:

An arithmetic sequence is a sequence \$a(1),a(2),a(3),a(4),...\$ such that there is a constant \$c\$ such that \$a(m+1)-a(m) = c\$ for all \$m\$. In other words: The difference between two subsequent terms is constant.

Given a sequence \$b(1),b(2),b(3),b(4),...\$ a subsequence is a sequence \$b(s(1)),b(s(2)),b(s(3)),b(s(4)),...\$ where \$1 <= s(1)\$ and \$s(m) < s(m+1)\$ for all \$m\$. In other words: Take the original sequence and remove as many entries as you want.

Examples

```<code>Input                     Output
[4,1,2,3,6,5]             [1,3,5] or [1,2,3]
[5,4,2,-1,-2,-4,-4]       [5,2,-1,-4]
[1,2,1,3,1,4,1,5,1]       [1,1,1,1,1] or [1,2,3,4,5]
[1]                       [1]
</code>```

Some longer test cases:

```<code>Length: 25
Input: [-9,0,5,15,-1,4,17,-3,20,13,15,9,0,-6,11,17,17,9,26,11,5,11,3,16,25]
Output: [15,13,11,9] or [17,13,9,5]

Length: 50
Input: [35,7,37,6,6,33,17,33,38,30,38,12,37,49,44,5,19,19,35,30,40,19,11,5,39,11,20,28,12,33,25,8,40,6,15,12,27,5,21,6,6,40,15,31,49,22,35,38,22,33]
Output: [6,6,6,6,6] or [39,33,27,21,15]

Length: 100
Input: [6,69,5,8,53,10,82,82,73,15,66,52,98,65,81,46,44,83,9,14,18,40,84,81,7,40,53,42,66,63,30,44,2,99,17,11,38,20,49,34,96,93,6,74,27,43,55,95,42,99,31,71,67,54,70,67,18,13,100,18,4,57,89,67,20,37,47,99,16,86,65,38,20,43,49,13,59,23,39,59,26,30,62,27,83,99,74,35,59,11,91,88,82,27,60,3,43,32,17,18]
Output: [6,18,30,42,54] or [8,14,20,26,32] or [46,42,38,34,30] or [83,63,43,23,3] or [14,17,20,23,26] or [7,17,27,37,47] or [71,54,37,20,3]
</code>```

Background

I got this idea when I recalled the Green-Tao-Theorem from 2004, which states that the sequence of primes contains finite arithmetic sequences of arbitrary length.

Body:
JavaScript (ES6), 157 bytes

a=>{for(m=i=0,l=a.length;i<l;i++)for(j=i;++j<l;)for(t=n=a[k=i],c=0;k<l;k++)a[k]==t&&(t+=a[j]-n,++c>m)?q=a[m=c,p=n,j]-n:q;return a.slice(-m).map(_=>(p+=q)-q)}

Almost 20 times longer than the Jelly answer... Ungolfed:

function subsequence(a) {
    var max = 0;
    for (var i = 0; i < a.length; i++) {
        for (var j = i + 1; j < a.length; j++) {
            var target = a[i];
            var count = 0;
            for (var k = i; k < a.length; k++) {
                if (a[k] == target) {
                    count++;
                    target += a[j] - a[i];
                    if (count > max) {
                        max = count;
                        start = a[i];
                        step = a[j] - a[i];
                    }
                }
            }
        }
    }
    var result = new Array(max);
    for (var i = 0; i < max; i++) {
        result[i] = start + step * i;
    }
    return result;
}