Code-Generator mit eindeutigen Zeichen

35

Herausforderung

Ihre Aufgabe ist es, einen Code zu schreiben, der einen anderen Code ausgibt. Dieser Code muss wiederum einen weiteren Code ausgeben, bis der endgültige Code die Ganzzahl 1 ausgibt . Die Kette endet mit der ersten Ausgabe von 1 .

Keines Ihrer Programme darf Zeichen gemeinsam haben (es gibt eine Ausnahme im Abschnitt Regeln).

Die Gewinner-Einsendung ist die Einsendung mit der längsten Kette. Der Tie-Breaker hat die kürzeste Gesamtcodelänge.


Regeln:

  • Sie können sowohl Funktionen als auch Programme und Snippets verwenden. Sie können eine REPL-Umgebung annehmen.
  • Alle Funktionen müssen in derselben Sprache geschrieben sein
  • Symbolunabhängige Sprachen sind nicht erlaubt. Dies schließt teilweise symbolunabhängige Sprachen wie Headsecks ein.
  • Die Standardausgabeformatierung kann optional in der Ausgabe einer Funktion ignoriert werden. Dies schließt Zeilenumbrüche ans =usw. ein.
  • Sie können das Leerzeichen (ASCII-Code Punkt 32) wiederverwenden, beachten Sie jedoch Folgendes:
    • Sie können in einer der Funktionen beliebig viele Leerzeichen verwenden, in allen anderen Funktionen jedoch maximal 5
    • Sie können keine Zeichen wiederverwenden, wenn Code-Punkt 32 in Ihrer Sprache kein Leerzeichen enthält.
  • Keines der Programme darf Eingaben annehmen

  • Die Kette muss mindestens zwei Programme lang sein.


Beispiel:

Ihr anfänglicher Code ist abc+cab+bac. Dieser gibt aus foofoo*123, welcher wiederum disp(~0)welche ausgibt 1. Dies ist eine Kette von 3 Programmen mit einer kombinierten Länge von 29 (Tie Breaker).

Stewie Griffin
quelle
Related
Jo King
1
Etwas verwandt
Kevin Cruijssen
Um sicherzugehen, dass ich verstanden habe: Die Programme können Kommentare verwenden, oder? Ich meine, Teile des Codes, die "nutzlos" sind
Luis Mendo
2
Sind einfache Ausdrücke erlaubt? Zum Beispiel könnte das letzte Glied eines Python - Programm 2^3, das nur zu bewerten wäre 1, oder muss es sein , zB lambda:2^3, print(2^3)usw.?
Nneonneo
3
In Sprachen, in denen Literale Programme sein können (wie zum Beispiel beim Golfspielen), kann 1dies sowohl ein Programm als auch die Ausgabe dieses Programms sein, oder endet die Kette, wann 1die Ausgabe erfolgt?
Emigna

Antworten:

18

05AB1E , 5- kettig : 236 + 29 + 13 + 3 + 1 = 282 Byte

10101100011010001101100010110110001111000111001110101001000000000010111100100110011011010110011000100110101001001101100001110001111010100100000100010010001010011101011001110001000001011010101111001110011110001010111100001110110C₁<Au¦н.V

Probieren Sie es online!

das druckt das Programm

633693S<J6bαð3<žQTÌ>è9663тαhJ

Probieren Sie es online!

das druckt das Programm

522472 2-255B

Probieren Sie es online!

das druckt das Programm

88ç

Probieren Sie es online!

das druckt das Programm

X

Probieren Sie es online!

welche druckt 1

Emigna
quelle
8784>žxBund ich bin wahrscheinlich KO'd. Das Fehlen von Zahlen für die Basiskonvertierung ist ein totaler Crapshoot, wenn Sie es nicht berechnen. Wenn Sie Emigna schlagen möchten, müssen Sie die geringste Anzahl eindeutiger Zahlen pro Iteration verwenden. Seine Antwort hat Vorrang vor der 88 in der vorletzten Iteration. Wirklich eine großartige Antwort.
Magic Octopus Urn
@MagicOctopusUrn: Wir könnten uns leicht befreien 10und etwas in Binär machen. Aber ich weiß nicht, ob wir das erste Programm aus Binärdateien ohne generieren können B.
Emigna
2
@MagicOctopusUrn: Ihre Aufgabe kann ein bisschen schwieriger sein, da ich glaube, ich habe eine 5-Kette;)
Emigna
2
@MagicOctopusUrn: Ich freue mich darauf :) Das war eine sehr lustige Herausforderung!
Emigna
1
Herzlichen Glückwunsch zum Erhalt der 5. Kette!
Chromium
12

Java 8, Kette von 2 Funktionen, 90 + 10 37 + 4 28 + 4 = 32 Bytes

o\u002D\u003E"\44\55\76"+2/2

Welches ist gleichbedeutend mit:

o->"$->"+2/2

-57 Bytes dank @ OlivierGrégoire .

Probieren Sie es online aus.

Welches gibt den String zurück:

$->1

Probieren Sie es online aus.

Welches gibt die ganze Zahl zurück:

1
Kevin Cruijssen
quelle
\u0076\u002D\u003E\u0022\u0076\u002D\u003E\u0022+(3\u002D2)(59 Bytes + 4 Bytes). Die Regeln besagen "Keines Ihrer Programme darf Zeichen gemeinsam haben" und sind daher v->1gültig, da das Finale 1kein Programm ist.
Olivier Grégoire
1
39 Bytes + 4 Bytes
Olivier Grégoire
@ OlivierGrégoire Ich wusste, dass die v->1Rückgabe von 1 gültig ist, aber in meiner ursprünglichen Antwort \u0031würde eine 1 und v->1dann auch eine 1 enthalten. Eine gute Kombination aus Unicode-Java und regulärem Java. Und ich spielte 2 weitere Golf, indem ich (2/2)zu wechselte 2/2. (PS: Es gibt auch bereits eine Chain-3-Java-Antwort von Jakob .)
Kevin Cruijssen
@ OlivierGrégoire Korrektur, ich habe es 4-28 + Golf der Lage gewesen , mit Hilfe "\44\55\76"statt"\u0076\u002D\u003E"
Kevin Cruijssen
Nettes Golfen über meinem;) Ich habe die 3-Ketten-Antwort noch nicht überprüft. Ich mache es gleich.
Olivier Grégoire
10

R , 3-kettig 198 + 44 + 3 Bytes

`+`=`\143\141\164`;+"\143\141\164\050\151\156\164\124\157\125\164\146\070\050\143\050\070\070\055\071\055\071\054\071\071\071\055\070\070\071\055\070\055\070\054\070\070\055\071\055\071\051\051\051"

Probieren Sie es online!

Kehrt zurück :

cat(intToUtf8(c(88-9-9,999-889-8-8,88-9-9)))

Probieren Sie es online!

Kehrt zurück :

F^F

Probieren Sie es online!

Kehrt zurück 1

Erklärung:

Das erste Programm wird in Oktaldarstellung fast vollständig geschrieben, wobei jedes Zeichen wie geschrieben steht , \xxxwo xxxist der ASCII - Code in Oktal - Modus. In menschenlesbarer Form wäre:

`+`=`cat`;+"cat(intToUtf8(c(88-9-9,999-889-8-8,88-9-9)))"

Um die Verwendung von runden Klammern zu vermeiden, definieren wir den Präfixoperator +gleich catfunction neu und geben dann die nächste Zeichenfolge aus. Letzterer behält auch nach der Zuweisung catzu +seinen Präfix-Operator "Status" bei und nimmt nur das, was ihm folgt, als ersten Parameter.

Das zweite Programm druckt einfach die Zeichen F^F, die sie aus dezimalem ASCII erhalten:70,94,70

Da wir im ersten Programm die oktale Darstellung verwendet haben, dürfen nur Zahlen 8und 9verwendet werden; daher erhalten wir 70und 94mit einigen Unterschieden zwischen Zahlen mit nur 8'sund 9's.

Schließlich F^Fnutzt das letzte Programm die ^Funktion (Potenz von), die FALSEzur Rückkehr zwingt 0und diese berechnet0^01

Anerkennung an :

  • @ngm für die erste 2-Ketten-Idee
  • @ Giuseppe für den Hinweis, dass Oktale in Funktionen verwendet werden sollen
  • @BLT und @JayCe für die Idee zu überschreiben +, um Klammern zu vermeiden

Vorherige Version :

R , 2-kettig 27 + 3 24 + 2 Bytes

cat(intToUtf8(c(49,76)))

Probieren Sie es online!

Kehrt zurück:

1L

Probieren Sie es online!

Rückgabe 1.

digEmAll
quelle
Nice one! Is cat mandatory?
JayCe
2
Well potentially you could have an output as a string with "wri\164e"(function args) to avoid a t or other similar encodings
Giuseppe
1
@Giuseppe @digEmAll According to the latest comments to the question cat(intToUtf8(c(49,76))) would work and is a bit shorter. Doesn't expand the chain though.
JayCe
2
@digEmAll See BLT's comment to my answer to another challenge... I think there might be something here.
JayCe
2
I've made this answer a Community Wiki. Please feel free to add this with a little explanation.
ngm
8

Python 2, 2-Chain, 7+44 = 51 bytes

lambda:("7072696e74203"+`3-2`).decode("hex")

and

print 1

Try it online!

The base 16 code translates to print 1, which is returned by the anonymous function.

Jo King
quelle
7

Perl 5, 3-chain, 151 139 chars (114 + 20 + 5)

&{"CORE::SYSWRITe"|"CORE::39372!4"}(STDOUT,"\x70\x72\x69\x6E\x74\47\x50\x42\x5A\3\22\47\x5E\47\43\43\43\43\43\47")

The ugliness inside the &{ } evaluates to CORE::syswrite, and so the hex-escaped string is printed to standard output as:

print'PBZ^C^R'^'#####'

Please note that the ^C and ^R in the above represent literal control characters. (And not to be confused with the literal ^ caret that occurs between the two strings.)

This program in turn outputs:

say 1
breadbox
quelle
6

Cjam, 4-chain, 28+20+3+1=52 bytes

Snippet 1:

"tugshrm\x18$\x18vj\x1b\x07um~l$\x1b"{71^}%

Snippet 2:

32 4/5*_c_1-\@2*9+c\

Snippet 3:

'Y(

Snippet 4:

X

Which then prints 1.

Try it online!

Note:

  1. Since Cjam does not have interpretation for escape characters, the ones in snippet 1 are only there for better web view. You need to use the corresponding actual characters to run the snippet.

  2. If I cannot shave off more characters, then good job to @Emigna for the 05AB1E answer!

Chromium
quelle
In snippet 2 you've reused the character 1 used in snippet 1
digEmAll
See my note please. The escape characters are for the reader's convenience, in Cjam there are no escape characters, or they would not translate into the characters you think would in languages like C or python. When testing, you literally have to enter the characters manually instead of using the escape characters.
Chromium
ah I see, thanks
digEmAll
5

Excel, Chain 2, 27+3 bytes

=CHAR(45)&CHAR(45)&CHAR(49)

Not sure if this is OK...

tsh
quelle
2
Shouldn't there be a CHAR(61)& in the beginning as well for there to be a chain of 2?
Emigna
5
You should use french instead of english (CHAR become CAR, 3 bytes saved), not sure if another language reduce it more
Sefa
1
@Emigna But it seems typing --1 in a cell and hit enter, it would just show 1 on the screen...
tsh
@tsh: Hmm, yeah it seems like Excel adds the = implicitly if you type --1.
Emigna
1
@Neil Excel does not insert a = mark for +1 (but it does for --1), so I won't consider it as an expression. And I'm not sure if simply writing an 1 in the cell and call it "output 1" is valid. That's why --1 is used.
tsh
5

x86 bytecode, Chain 2, 10+4 bytes

(Assembled with FASM, format PE)

ÇA.Ï?¿<÷Y. produces 1À@Ã in the address next to it and executes it, which returns 1 in eax (as per fastcall). In both cases the . actually represents A or LF.

In hex: C7 41 0A CF 3F BF 3C F7 59 0A and 31 C0 40 C3.

Disassembled:

mov dword ptr ds:[ecx+A],3CBF3FCF
neg dword ptr ds:[ecx+A]         

produces

xor eax,eax                      
inc eax                          
ret                              

This (ab?)uses the fact that the entrypoint of the program is stored in ecx, and then writes the inverse of the to be executed code to the address 10 bytes over and negates it.

May or may not break if assembled with anything but fasm, to anything but a PE or with a different entrypoint.

S.Klumpers
quelle
5

JavaScript REPL, lots of bytes, 4 iterate

(+!![]+[!![]+!![]+!![]+!![]]+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+![]+(!![]+!![]+!![])+![]+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+![]+![]+(+!![])+(!![]+!![])+![]+(+!![])+(!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(+!![])+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(+!![])+(!![]+!![]+!![])+![]+![]+(!![]+!![]+!![])+![]+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+![]+![]+(+!![])+(!![]+!![])+![]+(+!![])+(!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(+!![])+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(+!![])+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+![]+(+!![])+(!![]+!![])+![]+(+!![])+(+[])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(+!![])+(+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+![]+(+!![])+(!![]+!![])+![]+(+!![])+(+[])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![])+![]+![]+(+!![])+![]+(!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(!![]+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+![]+(+!![])+![]+(+!![])+(+[])+![]+(+!![])+(+!![])+![]+(+!![])+(!![]+!![]+!![]+!![]))[(![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[+[]]](![])[(+(!![]+!![]+[+[]]+(+!![])+(!![]+!![])+(!![]+!![]+!![]+!![]+!![])))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]](!![]+!![]+!![]+[+[]])](([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()(+[]+[![]])[!![]+!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+!![]]+(+[![]]+[][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]())[+!![]+[+!![]]]+(!![]+[])[+[]]][([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+([][[]]+[])[!![]+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]+[+[]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+!![]]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]+[])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()(![]+[![]])[+!![]+[+[]]]+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![])+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![]+!![])+(!![]+!![])+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(![]+[])[+[]]+(!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(!![]+!![]+!![]+!![]+!![])+([][[]]+[])[!![]+!![]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[!![]+!![]]]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])))[([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]]([])
"\x60\44\x7b\55\x7e\x7b\x7d\x7d\44\x7b\55\x7e\x7b\x7d\x7d\x60\56\x73\x70\x6c\x69\x74\x60\x60\56\x74\x6f\x53\x74\x72\x69\x6e\x67\x60\x60"
`${-~{}}${-~{}}`.split``.toString``
1,1
1

Too lazy to optimize the JSFUCK code

JavaScript REPL, 164 bytes, 3 iterate

may be able to expand

[g=222222222222222222,e=2e40,f=2e23,f,2e40,n=2222e49,r=2e24,2e30,e,n,r,8e28,2e40,n,r,9e29,g].map(S=>String.fromCharCode(Math.log(S))).join([])
'\55\x7E\x7B\x7D'
-~{}
1

Try it online!

l4m2
quelle
@JoKing I didn't use 1 in other pros, so the first 1 is program and the 2nd one is result
l4m2
Aren't you reusing the {}s?
Neil
@Neil Fixed and optimized
l4m2
"The chain ends the first time 1 is outputted."
12Me21
5

CJam, 7-chain, 92365+1819+79+14+9+3+1 bytes

This 92365-byte program prints

YaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR1+1+1+1+1+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR1+1+1+1+1+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+11+YaY+`$1<mR1+11+11+YaY+`$1<mRYaY+`$1<mR1+1+1+1+1+1+11+1+1+1+1+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR1+11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+11+11+11+11+11+1+1+1+1+YaY+`$1<mR11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1+1+1+1+1+YaY+`$1<mR1+1+11+11+11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+1+1+1+11+11+1+1+YaY+`$1<mR11+11+YaY+`$1<mR1+1+1+1+1+1+11+1+1+1+YaY+`$1<mR1+11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+11+11+YaY+`$1<mR1+1+11+YaY+`$1<mR1+11+YaY+`$1<mR1+1+1+1+1+11+11+1+1+YaY+`$1<mR11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+YaY+`$1<mR1+1+1+1+1+

which prints

34 4673 4656 4673 4656 5464 4656 4673 4673 4740 34 50 34707 5477]{N7=64777-,=}%

which prints

";*;*Q*;;~"2f^

which prints

9(9(S(99|

which prints

88c

which prints

X

which prints 1.

Lynn
quelle
5

MATL, 5 programs, 404+159+35+4+1 = 603 bytes

Getting to 4 programs was hard. 5 programs was very hard!

'/'37 13+3+3+'3`/'37 13+3+3+77 13+37 13+3+3+'3`/'37 13+3+3+'3tttttttt`/'37 13+3+3+'3#'37 13+3+3+'3ttttt`'37 13+3+3+'3ttttt'37 13+3+3+77 13+'/'37 13+3+3+'3`<<tttttttttt'37 13+3+3+'3#'37 13+3+3+77 13+37 13+3+3+'3///<3////t````ttttt```<</////t`````t<3tttttttttt<3tt/'37 13+3+3+'3ttttttttt'37 13+3+3+'3`{'37 13+3+3+77 13+'y$'37 13+3+3+'3/////t`````ttI#I'77 13+3+'dk'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh3_+''h

Try it online!

,50],5W50],50qqqqqqqq],50 50qqqqq]50qqqqq5W,50]99qqqqqqqqqq50 5W50,,,90,,,,q]]]]qqqqq]]]99,,,,,q]]]]]q90qqqqqqqqqq90qq,50qqqqqqqqq50]x5Wv!50,,,,,q]]]]]qqF FZah

Try it online!

This might be my favorite program I've written on PPCG:

22 2 2**2-2-- 22Y2 2EEEEEEEEBPX)2) 

Try it online!

84
c

Try it online!

T

Try it online!

Explanation:

Having used hours on this program, I won't write the entire explanation now! I'll write it later!

Short summary:

T            -> Literal true = 1

84c          -> Convert 84 to its ASCII-character T

22 2 2**...  -> Calculate 84 using only 2, * and -
 22Y2        -> 22Y2 is a cell array with the name of all the months
 2EE..B      -> Is 512 in binary [1 0 0 ...]
 P           -> Flips is, [0 0 ... 1]
 X)          -> Uses the binary vector as index and gets the 10th element
             -> 'October'
2)           -> The second character, 'c'
             -> Resulting in the stack: 84, 'c' that's implicitly printed

,50]...      -> A string with ASCII character codes of '22 2...
             -> There's a lot of ,xyz], which means "do twice" and q which is decrement

In order to convert this to a string instead of character codes, we need to concatenate it with a string using h. To get a string, without using quotes, or the XY modifiers, we do base conversion and convert an integer to whitespace.


'/'37 13 ...  -> Concatenation of strings and character codes using only available numbers
3_+           -> Subtract 3 from all character codes to get the correct ones
''h           -> And concatenate with the empty string.
Stewie Griffin
quelle
4

CJam, 10 programs, 5,751,122,990 bytes

I was too lazy to golf it... But apparently I don't need to golf it to be competitive. But without golfing it is a bit difficult to post the solution in an answer.

It should work in the JavaScript interpreter in theory, but the program is too long to be tested in a browser. It should output the same in the Java interpreter except for the last program. But it may also run out of memory in the Java interpreter for the first few programs.

Statistics

5683631402 bytes, used )\_l
  65027874 bytes, used %&<>WXehrstu{|} and newline
   2247044 bytes, used +DEFHIS~
    199997 bytes, used ,38=[]`
     15352 bytes, used -25:N and space
      1181 bytes, used 67c
        84 bytes, used #'(@CKMTgkp
        21 bytes, used !"$?BJLQR^fijo
        16 bytes, used */4AGYZabdy
        19 bytes, used .09
         1 byte,  used 1

First bytes

l)__)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))...
\n{s}sX>X<eu{h}sX>X<eu{\n}sX>X<{{XXXXXXX}seeseeseeW>{X<{|}%}%}%{|}sX>X<{{X}se...
SH+~+E+E+E+SH+~+H+E~+SH+~+H+E~+SI+~+H+D+D+SI+~+I+E+E+SH+~+H+E~+SF+~+E+SD+~+D+...
[33]`3=,3333=[33]`3=,388333=[8]`88=,8333=[8]`88=,8333=[8]`88=,8338=[8]`88=,33...
N:--25--22- 2-N:--25--22- 2-N:--22--22-N:--25--22- 2-N:--25--22- 2-N:--22--22...
776776777767c677676676677667c66677666676776c776776777767c7667776c666776666767...
'#('@('T(('k(('T((('k(('K('p(''((('@('T(('k(('T((('k(('k('M('#(('#('C('g('g((...
"?RiQiJo$?RiQijL!"Bf^
4YbZbAd/4YbZbaG*
0.99999999999999999
1

\n is newline in the second program.

Generator

"'#('@('T(('k(('T((('k(('K('p(''((('@('T(('k(('T((('k(('k('M('#(('#('C('g('g((((((((("

{_[i1:X;{_1&6+ \1$X*X5*:X;- 2/}16*;]__,,:)\f<Wf%10fb:c@#)<W%'c}%s

"67c"
"N:--22--22-
N:--25--22- 2-
N:--55--25--5--2--2-"N/ers

"N:-25 "
"[33]`3=,3333=
[33]`3=,388333=
[8]`88=,8333=
[8]`88=,8338=
[8]`88=,333=
[8]`88=,88="N/ers

"[]`38=,"
"SH+~+E+E+E+
SI+~+H+D+D+
SI+~+I+E+E+
SH+~+H+E~+
SI+~+I+D~+H+E~+
SF+~+E+
SD+~+D+D~+"N/ers

"SDEFHI+~"
"{s}sX>X<eu
{t}sX>X<{{XXXXXXXX}s{X}s{XXXXXX}erseeW>{X<{&}%}%}%
{ee}sX>X<eu
{&}sX>X<{{XXXXXXs}s{X}s{XXXXXX}erseeW>{X<{|}%eu}%}%
{h}sX>X<eu
{h}sX>X<eu{X|}%
{N}sX>X<{{XXXXXXX}seeseeseeW>{X<{|}%}%}%
{|}sX>X<{{X}seeW>{X<{|}%}%}%"N/'Nf/Nf*erN\+s

1>"l)_"o)\{'_oi10-')*o'\o}/i10-')*o
jimmy23013
quelle
3

APL (Dyalog), 2 chain, 15+2 = 17 bytes

AV[2+⎕AV'⍳.']

Try it online!

Outputs the program

*0

That outputs

1
Uriel
quelle
3

JavaScript (ES6), 2 functions, 31+4 = 35 bytes

function(){return atob`Xz0+MQ`}

returns _=>1, which returns 1

Arnauld
quelle
Wouldn't function invocation have to be part of each program?
TehShrike
@TehShrike Functions were explicitly allowed in the rules. (A function + its invocation code would be a full program. So, I don't think that would make much sense.)
Arnauld
Oh good call, I missed that 👍
TehShrike
3

Jelly,  38 37 36  35 bytes, Chain of 4

ØJiⱮ⁾ɱṾ⁽÷ṃ;ṾØJ⁽¡Ṡị

Try it online! (18 bytes)

8220,163,187Ọ

Try it online! (13 bytes)

“£»

Try it online! (3 bytes)

!

Try it online! (1 byte)

18+13+3+1=35 bytes

How?

ØJiⱮ⁾ɱṾ⁽÷ṃ;ṾØJ⁽¡Ṡị - Main Link: no arguments
    ⁾ɱṾ            - list of charcters -> ['ɱ','Ṿ']
ØJ                 - yield the characters of Jelly's code-page
   Ɱ               - Ɱap across the two characters applying:
  i                -   first index of? -> [163, 187]
       ⁽÷ṃ         - 8220 (a base 250 compressed number)
          ;        - concatenate -> [8220, 163 187]
           Ṿ       - un-eval (get Jelly code) -> "8220,163,187"
                   - (Note: here a full program prints 8220,163,187 as it is the end
                   - of a leading constant chain due to the following constant)
            ØJ     - yield the characters of Jelly's code-page
              ⁽¡Ṡ  - 1206 (a base 250 compressed number)
                 ị - index into (1-indexed & modular, so gets the 182nd item, 'Ọ')
                   - implicit print (making the final output 8220,163,187Ọ)

8220,163,187Ọ - Main link: no arguments
8220,162,187  - list of numbers -> [8220, 162, 187]
            Ọ - cast ordinals to characters -> ['“','£','»']
              - implicit print (flat Jelly lists print as if strings so outputs “£»)

“£» - Main link: no arguments
“   - open string-literal
 £  - the content of the string-literal
  » - close it interpreting as a compressed string
    - this yields ['!']
    - implicit print (outputs !)

! - Main link: no arguments
! - factorial (of implicit input 0 - 0! = 1 as it is the empty product)
  - implicit print (outputs 1)
Jonathan Allan
quelle
3

Python 2, 3 snippets, 68 + 12 + 3 = 83 bytes

chr(44*2+4).join([chr(42&54),`45+25`,`42*2+52`,`4*4+55`+chr(42&54)])

which produces the string of octal literals:

"\70\136\71"

which produces:

8^9

Which finally produces 1.

Try it online!

Jo King
quelle
3

Java 8, 3 programs, 431 bytes

Program 1, 332 bytes

A lambda from one (empty) parameter of any type to String.

x\u002D\u003E"\151\156\164\40\157\75\70\46\70\52\70\54\156\75\53\53\157\53\70\73\156\145\167\40\123\164\162\151\156\147\50\51\53\50\143\150\141\162\51\50\47\171\47\53\157\51\53\50\143\150\141\162\51\50\47\54\47\53\157\51\53\50\143\150\141\162\51\50\47\75\47\53\157\51\53\156\53\50\143\150\141\162\51\50\47\56\47\53\157\51\53\156\73"

This is just a lambda with the arrow characters Unicode-escaped returning the text of the second program encoded with octal escape sequences.

Try It Online

Program 2, 93 bytes

Snippet producing a String.

int o=8&8*8,n=++o+8;new String()+(char)('y'+o)+(char)(','+o)+(char)('='+o)+n+(char)('.'+o)+n;

Try It Online (with return added)

Program 3, 6 bytes

A lambda from one (empty) parameter of any type to int.

z->9/9

Try It Online

Jakob
quelle
2
Nice answer! You can golf \166 to \44 for -1 byte, since $ is also a valid variable name. Try it online, resulting in $->9-8 (Try it online.)
Kevin Cruijssen
After several tries, it's just not possible to make a 3-chain with Java. You need the \uXXXX in the first code to avoid ->. Then you need either return (function) or System.out (snippet or function), both contain a u which you already used in \uXXXX. So I personally think this entry is invalid and I downvoted it accordingly.
Olivier Grégoire
@OlivierGrégoire Snippets are explicitly allowed in this challenge (first rule). In addition, System.console().printf could be used to prevent the use of u. Something similar is done in this answer and I've also used it in these two answers of mine.
Kevin Cruijssen
Thanks @KevinCruijssen but a snippet must still output. Here's a fix around all: x->"\146\157\162\50\143\150\141\162\40\44\72\156\145\167\40\143\150\141\162\133\135\173\47\171\47\54\47\54\47\54\47\75\47\54\47\70\47\54\47\56\47\54\47\70\47\175\51\123\171\163\164\145\155\56\143\157\156\163\157\154\145\50\51\56\160\162\151\156\164\146\50\53\53\44\53\156\145\167\40\123\164\162\151\156\147\50\51\51\73" (319 bytes) turns into for(char $:new char[]{'y',',','=','8','.','8'})System.out.printf(++$+new String()); (89 bytes) turns into z->9/9 (6 bytes). Total: 404 bytes.
Olivier Grégoire
I meant System.console() for the 2nd program, which is correctly 89 bytes (while the System.out makes it 83 bytes).
Olivier Grégoire
2

SmileBASIC, chain 3, 375 bytes

k=59599-44444print c("sbanm",k,4,"")+c("sbwav",44-5,2,"")+c("sbwav",594-222,4,"")+c("game5vs",4528-442,2,"")+c("sbanm",k,4,"")+c("sbanm",72,5-4,"")*2+c("sbwav",594-222,4,"")+c(sbwav,854-44,2,"")+c("staffroll",259+2,9,"")+c("ex8techdemo",24455,5-2,"")+key(4)[.]def c(f,s,l,q)for i=.to-5+l+4q=q+load("txt:sys/"+f,.)[s+i]next:return q:end

Outputs:

CHR$63OUT A$CHR$33OUT B$PRINT A$;B$;L

Outputs:

?!0

Outputs:

1
12Me21
quelle
2

PHP 7.0, 2-chain, 35 + 8 = 43 bytes

While writing my initial answer I realized I could just use base64 encode the second echo. It shaved off 11 bytes, so here it is. You can find my original idea below, too.

Run using php -r:

echo base64_decode('RUNITyAxPz4=');

This outputs:

ECHO 1?>

Which then obviously prints:

1

Output:

Code run with additional && echo for readability
My code when run in a terminal. The appended && echo is for readability only.

Comments:

There's not much to it really. Very simple once you know about "?>" implicitly acting as ";". The "tricky" part was to figure out what to encode:

  • ECHO 1; became RUNITyAxOw==, so we have a collision of uppercase O's. No good.
  • echo 1; became ZWNobyAxOw==, so now there's two lowercase o's. Unfortunate!
  • ECHO 1?> became RUNITyAxPz4=. It's the same length and none of the characters collide. So that's it!

Alternatively we can use "echO" and "ECHo", too (36 + 7 = 43 bytes).

echO base64_decOde('RUNIbyAxOw==')?>
ECHo 1;
1

We can also switch the ; and ?> around using that. It works equally well and it all scores the same in length.



My initial solution:

PHP 7.0, 2-chain, 44 + 10 = 54 bytes

This is the best I could come up with at first. I understood that "unique characters" meant "echo" is not equal to "ECHO". Hope I got that right!

Run using php -r:

echo strtoupper(urldecode('echo true%3b'))?>

This outputs:

ECHO TRUE;

Which in turn gives us our number:

1

Output:

Code run with additional && echo for readability
My code when run in a terminal. The appended && echo is for readability only.

Some comments:

  • I think you can only do a 2-chain in PHP since it requires the ";" instruction separator.
    • You can get around this once by using "?>", which implies a semicolon, but obviously can't re-use it a second time
    • This was the hardest part for me to figure out. I didn't know this worked beforehand, nor that "?>" was even allowed when running via php -r
  • By using strtoupper() I was able to just write the code for chain #2 in lowercase, while the output is obviously uppercase. Easy mode right there!
  • urldecode() allows me to encode ";" as "%3b"
  • That's all there is really, nothing too exciting

Thanks for the challenge, I learned something today!

Maz
quelle
2

Lua, 2 chain, 83+8=91 bytes

load(('').char(0x70,0x72,0x69,0x6E,0x74,39,0x70,0x72,0x69,0x6E,0x74,34,49,34,39))()

Outputs

print"1"

Which outputs

1
GalladeGuy
quelle
1

Charcoal, 2 programs, 10 + 2 = 12 bytes

⭆´G´·℅⊕⊕℅ι

Try it online! Outputs

I¹

Try it online! Which outputs 1.

Neil
quelle
1

Röda, 2 chain, 31 + 3 = 34 bytes

Snippet 1:

(`X.Z`/"")|ord _|push _+3|chr _

Try it online!

Snippet 2:

[1]

Try it online!

They are snippets, because every valid Röda program must include main{...} bloat. They are also valid Röda REPL programs.

fergusq
quelle
1

dc, 3 programs, 48 bytes

First:

82 2-adAArdAAI2*-rAAI-I2/2^-f

Yields the second:

75
P
90
P
110
P

Yields the third:

KZn

Yields 1.

Try it online! (has some stack-clearing and newline-printing code thrown in to make all three bits run in one go).

Perhaps best to start at program three, KZn. There are only a few ways to print things in dc, and I realized at this stage I would probably be stuck with either p or n, both of which are in the 100s in decimal ASCII. This means that I was almost certainly going to have to generate 1 instead of just using the program 1n. K pushes the current (default: 0) precision to the stack, and Z pushes the number of digits of top-of-stack, which gives us the 1 to print.

The second program is pretty straightforward. P prints the character with the given ASCII value, so we print 75 (K) 90 (Z) and finally 110 (n), which works wonderfully. It also means that, aside from the aforementioned 1, I can't use the digits 5, 7, 9, or 0 elsewhere. I also need a method other than P for turning numbers into characters.

The first program, then, has to make four numbers without using the digits 1, 5, 7, 9, or 0. It needs to make 80 (ASCII value of P): 82 2-; 75: AA (110) I- (subtract the default input radix, 10) I2/ (so, 5) 2^ (so, 5^2, 25) - (75); 90: AA (110) I2* (twice the default input radix of 10, so 20) - (90); and 110: well, it's just AA. After making 80, we use a to convert a number to a string. There are some reverse and duplicate commands in there to put the Ps in the right spots, and then finally we print the whole stack with f.

I'm pretty sure I didn't screw this up, but I did have my head spinning a little bit...

brhfl
quelle
1

05AB1E, 5 + 3 = 8 bytes

ght<n

Try it online!

which right off the bat returns

I am taking the output 1.0 as not equalling 1, so I run that code:

1.0

Try it online!

which returns

1

And there you go!

Number of programs = 2

Caleb Evans
quelle
Welcome to PPCG.
Muhammad Salman
I just tried to write random things and see what i get. Also, one might use a turing machine program.
Caleb Evans
You can remove the h (convert to hexadecimal). The g (get length, default 0) with t (square-root) already gives a decimal 0.0. With < (decrease by 1) it becomes -1.0 and then n (square) changes this into 1.0. You could also replace the <n with > (increase by 1). ;) So in total it's 3 bytes (gt>). Alternatively you could use Xt (1 and square-root). PS: I'm not sure if 1.0 to 1 is a valid part of the chain. I've asked OP to verify. Welcome to PPCG and enjoy your stay.
Kevin Cruijssen
well, computers process the string '1.0' differently than '1'.
Caleb Evans
0

Ruby, 2-chain, 24+3 = 27 bytes

$><<(''<<56+56<<' '<<49)

Output is

p 1
G B
quelle