안녕, 월드! 반 공통 문자


28

아시다시피 Dennis의 멋진 온라인 언어를 사용해보십시오! , 안녕하세요, 세계! 프로그램이 필요합니다. 최근 Dennis는 웹 사이트에서 이러한 프로그램을로드하는 방법을 추진했습니다. 다음은 2017 년 7 월 27 일 기준으로 해당 프로그램에서 사용 된 문자의 빈도를 기준으로 JSON pastebin 입니다.

그 캐릭터들 중 일부는 사랑이 필요하기 때문에 당신의 도전은 Hello, World!를 출력하는 것입니다! 아래에 지정된 문자 만 사용하여이 프로세스와 관련된 언어로 사용하는 것이 좋습니다. 이러한 문자 사이에 사용되는 문자의 모두 1099가장 일반적인 두 가지 문자와 함께 (포함) 시간, 0그리고 내가 좋은 느낌 거니까.

0 $&*?ABCDEFGIJKLNPQRSTUXYZ\`gjkqwxyz{}÷≤≥=║_

문자 사용은 코드 포인트 나 바이트 값이 아닌 일반 프로그램에서의 모양을 기반으로해야합니다.

해당 세트에서 하나 이상의 문자를 사용해야하므로 길이가 0 인 프로그램은 유효하지 않습니다.

이것은 이므로 바이트 단위의 최단 답변이 이깁니다.

답변이 유효한지 확인하는 JSFiddle


다음 줄에 공백을 출력 할 수 있습니까?
dzaima

@dzaima 공백없이 출력 할 수 없으면 출력하십시오. 공간을 제거하는 데 더 많은 바이트가 사용되는 경우 공간을 제거하십시오.
Stephen

비 인쇄 캐릭터가 결과물 (STDOUT)로 이동하는 것에 대한 커뮤니티 합의 (또는 여기에 특정 불일치)가 있습니까? 그것이 전에 와서 (그리고 쉽게 간과 될 것입니다) 확실하지 않지만 그것은 나의 전략을 여기에서 극적으로
바꿉니다

@brhfl 내가 알지 못한다-유일한 규범은 후행 줄 바꿈이 일반적으로 허용된다는 것입니다. 채팅에서 요청할 수 있습니다
Stephen

답변:


6

SOGL V0.12 , 89 75 68 바이트

z{}xxxx≥x≥x≥xXUqXxq≤qq≤q *R_IIRq  q *R_I0II*IRqxXq≤qxqxq CR_0II÷Rq0*

여기 사용해보십시오!
참고 : q또는 출력이 여기에 언급 될 때마다 팝업 출력 ( oOpP)을 사용할 수 없거나 앞에 새 줄을 출력하는 것으로 나타나지 않습니다 .

설명 (오래된, 변경된 것은 "H"가 알파벳 문자를 사용하여 인쇄된다는 것입니다) :

 $             push "$"
  R_           convert to an array of ordinals, then push all the contents to the stack
    0II        push 0+1+1 = 2
       *       multiply by that
        R      convert to character
         q     output
          z    push the lowercase alphabet
           {}  iterate over it, pushing each char, and do nothing. Stack: ["H","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
stack manipulation:
 xxxx ["H","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r"]
 ≥    ["r","H","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q"]
 x    ["r","H","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o"]
 ≥    ["o","r","H","a","b","c","d","e","f","g","h","i","j","k","l","m","n"]
 x    ["o","r","H","a","b","c","d","e","f","g","h","i","j","k","l"]
 ≥    ["l","o","r","H","a","b","c","d","e","f","g","h","i","j","k"]
 xxx  ["l","o","r","H","a","b","c","d","e"]
 q    output the "e"
 ≤    ["o","r","H","a","b","c","d","e","l"]
 qq   output the "l" twice
 ≤    ["r","H","a","b","c","d","e","l","o"]
 q    output the "o"

*                       push "*",
 R_                     convert to an array of ordinals, then push all to stack
   II                   increase by 2
     R                  convert back to character
      q                 output
         q              push a space, then output
           *            push "*"
            R_          convert to an array of ordinals, then push all to stack
              I         increase that
               0II      push 0+1+1 = 2
                  *     multiply
                   I    increase
                    Rq  output as character
stack manipulation: (starting stack: ["r","H","a","b","c","d","e","l","o",","," ","W"])
 x  ["r","H","a","b","c","d","e","l","o",","]
 X  ["r","H","a","b","c","d","e","l","o"]
 q  output the "o"
 ≤  ["H","a","b","c","d","e","l","o","r"]
 q  output the "r"
 x  ["H","a","b","c","d","e","l"]
 q  output the "l"
 x  ["H","a","b","c","d"]
 q  output the "d"

C            push "C"
 R_          convert to ordinal as before
   0II÷      floor divide by 2
       Rq    output as character
         0*  multiply by 0 so nothing extra would be outputted

재미있는 사실 : 허용 된 문자의 모든 문자는 SOGL 코드 페이지에 있습니다 : D


그래서 ... 당신은 전문 개발자로서 안정된 직업을 가지고 있습니까? 댕, 왜냐하면 이것은 멋진 언어입니다 ... 또한 멋진 JS 인터프리터, 당신은 어젯밤에 끝냈습니다 :)? 일부 언어에 대한 문서를 게시 할 수 있습니까? 아니면 개인 채팅 메시지가 그러한 문서의 위치를 ​​알려줍니까? SOGL이 그것을 죽입니다.
매직 문어 Urn

@MagicOctopusUrn 1) no lol I 'm 15 2) 내가 만든 방식이 내가 만든 가장 멋진 일이기 때문에 개인적으로 그것을 좋아하지 않는다. 3) JS 인터프리터는 오랫동안 거기에 있었다. SOGL (당신이 그것들을 부를 수 있다면)이 여기 있으며, (여러분 과 같은 palenChars.txt) 어떤 것들이 여기에
dzaima

바이트 수를 다시 줄인 것을 축하합니다! 나는 솔직히 내가 더 낮은 것을 얻을 수 있다고 생각하지 않습니다!
Dom Hastings

23

펄 5 , 76 바이트

}{${$_=$`x?B?}{?\w$?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G

이것은 더 이상 사용되지 않는 기능을 사용하지만 터미널에서 로컬로 작동합니다 (표시된대로 버전 5.18.2). 이전 버전의 Perl ?\w?/\w/정규식 일치에 액세스 할 수 있는 동의어 이며 $&(마지막 일치) 및 $`(마지막 일치 이전의 텍스트 )에 대해 충분한 문자가 있습니다. 나는 이것을 얻을 수 있어야합니다 O. 이 glob참조를 생성하여 생성합니다 ( $_=\*G스칼라로 캐스팅 된 것과 같습니다GLOB(0x7ffb728028d0) ). 그에의하면 $_, ?B?일치합니다 B$`포함 GLO에 대해, 나는 다음과 일치 할 수 \w$있는 저장하는 것 O$&stringwise-AND로 실행중인 문자열에 삽입되어 나머지 텍스트를 만들면 문자열 본문이을 사용하여 소문자로 표시됩니다 \L.

온라인으로 사용해보십시오! -TIO의 Perl 버전이 너무 새롭기 때문에 /\w/대신 사용합니다 ?\w?.


펄 5 , 65 바이트

이것은 TIO ()의 파일 이름을 사용하기 때문에 조금 더 유쾌합니다. .code.tio그래서 나는 이것이 경쟁하고 있다고 생각하지 않지만 결과에 만족했습니다!

}{${$_=$0}{?\w$?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}

온라인으로 사용해보십시오!


I didn't say anything about the content of flags, so -p is fine. Good job, this is what I was hoping for when I asked this :)
Stephen

1
how... what... the...
Okx

@StepHen I'm glad to have obliged! I did honestly really enjoy this. I'm glad you aren't penalising the flag too, I'll update my post. Thanks!
Dom Hastings

@Okx I'm glad to have had that effect!
Dom Hastings

You sure you don't need to add 15 bytes <3?
Magic Octopus Urn

10

Unary, 7*10182 bytes

Unary is Brainfuck converted to binary converted to unary using 0 as the counter. Essentially, it condenses a Brainfuck program into a number and the output is that number of 0s. They are usually very large programs.

I won't paste the program here because I don't know how much text SE allows but I bet it's less than this. Instead, I'll paste the precise number of zeroes in this answer:

708184005756841022918598670049178934705323143517361395031673227349803938380119378597780037353721967636097362645175347036417214959141923667629285233360306016978751166690464736541968556

As this is a fairly cheap answer, guaranteed to not be the shortest, and I simply copied it, I'm making this a wiki post.


2
"I don't know how much text SE allows" at least it's not 7*10¹⁸² which is waaaaaay larger than 65536.
Erik the Outgolfer

9

05AB1E, 137 106 95 bytes

X00X00DXX00DXX00XX0X0X00D0XXXX0X00X00XXX00XXX0XXXXXX00XXXXX0XXXX00D0X000DD00XXJC000gDD0000g***B

Try it online!

-31 thanks to @Adnan for pointing out I could use base 108.

-?? thanks to @Riley for pointing out some things wrong.


Old version (different method):

05AB1E, 211 186 166 bytes

0g00g000000000gUX000000gXX00000g000g00g000gD0000g0 000g00000gX00000gX00000g0 00000g00000000g0000000g00g00000000gD000000gX0000000g0g00000gUXJX00000000000000000g000g**B

Try it online!


Haha! AND HERE I THOUGHT ESOLANGS STOOD NO PLAUSIBLE CHANCE!


First we get 255 stored in X:

00g               # Push 2 (length of 00).
   00000g         # Push 5 (length of 00000).
         00000g   # Push 5.
               JU # Join to 255 and store in X.

Then, using the same length trick we push: 1296995323340359595058728869715

0g00g000000000g000000g000000000g000000000g00000g000g00g000g000g0000g0 000g00000g000000000g00000g000000000g00000g0 00000g00000000g0000000g00g00000000g00000000g000000g000000000g0000000g0g00000gJ

Where we just use 0<space> instead of the length trick for the zeros.

Then, finally, we push the 255 we stored and convert from 255 to base 10:

X  # Push stored 255.
 B # Convert to base 255.

Still golfing using the other allowed chars, and duplication, it will be a minute.


8

Beatnik, 148 bytes

K QQQQQQQG ZD XA K QQJA KD ZD XA K KG KD ZD ZD ZD XA XA K B KD ZD XA K QQQQF ZD ZD XA K QQQD XA K A Z KD XA ZD XA K B KD XA ZD XA K J Z XA K QQQB XA

Try it online!

Explanation

Beatnik bases the instruction executed based on the scrabble score of the word. Here's a shortened explanation:

Code         Scrabble Score   Explanation

K            5                push the scrabble score of the next word
QQQQQQQG     72               72 ['H']
ZD           12               pop a value; push it back twice
XA           9                pop a value; print its ASCII character
KD           7                pop two values; push their sum
Z            10               pop two values; push their difference

8

Moorhens (v2.0), 3423 983 923 866 749 716 bytes

I think this can be golfed a bit, Moorhens is not an easy language to work with.

xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU KA xU xU xU xU xU xU xU xU xU xU xU xU KA AA xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU KA xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU KA xU xU xU xU xU xU xU KA KA xU xU xU AA AA AA AA AA KA xU AA KA xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU KA xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU xU KA xU xU xU KA XI XI XI XI XI XI KA XI XI XI XI XI XI XI XI AA AA AA AA AA AA AA AA AA AA AA AA

Explanation

Moorhens is a language based of of dictionary words. Each word corresponds to an operation based on its hash. The five operations used here are xU, ER, XI, KA, and AA

  • xU increments the TOS
  • ER puts a new zero on the stack.
  • XI decrements the TOS
  • KA duplicates the TOS
  • AA rolls the TOS to the bottom

We push each letter with sucessive applications of these operations.


5
'The two operations' - I'm not well versed in esolangs but surely those are five operations?
boboquack

@boboquack fixed
Wheat Wizard

1
link to language?
Leaky Nun


5

Glypho, 480 bytes

AABCABABABBAABABAABCABBAABABABBCABBAABABABABABABABBAABBAABABABABABABABBAABBAAABCABBAABABAABCAABCABBAABABABBCABABABBAABBAABABAABCAABCABBAAABCABBAABABABBAABBAABABAABCABCAABABABABABBAABBAABBAABABAABCABAAABABAABAABBAABCAABABABBAABBAAABCAABCABBAABABABBCABABABBCABABABBAABAAABABAABAABABABBAABABABBAABABABAAABABAABAABBAABABABBAAABCABBAABABAABCABCAABABABABABBAABBAABBAABABAABCABCAABAAABABAABAABBAABABABBCAABCABBAAABCAABCABBAAABCABBAABABABBAABABABBCABABABBAABAAABABABCAABBAAABAABACABBBABCB

Try it online!


4

Headsecks, 78 bytes

yyzyzzxNxNzx{yyy{y{y{yzzz_{_zzyy\zxxxxxx\zzy\\zz\zx\{{\{{\zzz\xxx\{{\{{y\zzzx\

4

Double JavaScript, 318 bytes

I'm not sure if that's allowed, I couldn't do it using the JavaScript interpreter once. It's similar to use eval() but instead I'm using the interpreter twice: (Try it in the console to get the result printed back)

`\`\\x${0xA*0xA&0xC}${0xA&0xC}\\x${0xA*0xF&0xF}${0xB*0xF&0xF}\\x${0xA*0xF&0xF}C\\x${0xA*0xF&0xF}C\\x${0xA*0xF&0xF}F\\x${0xE*0xF&0xF}C\\x${0xE*0xF&0xF}${0}\\x${0xB*0xF&0xF}${0xB*0xB*0xF&0xF}\\x${0xA*0xF&0xF}F\\x${0xB*0xB*0xF&0xF}${0xE*0xF&0xF}\\x${0xA*0xF&0xF}C\\x${0xA*0xF&0xF}${0xA*0xA&0xC}\\x${0xE*0xF&0xF}${0**0}\``

Try it online!

Evaluates to:

`\x48\x65\x6C\x6C\x6F\x2C\x20\x57\x6F\x72\x6C\x64\x21`

Try it online!

Which evaluates to Hello, World!


3

Smallf**k, 266 bytes:

zJ$NJ`ZZx*gQYQQ{zqyKKUkUR?AS`zB`JB&UCKCIxQ_G0*000FzzJ&?YwkC\qqgZ`xYQyC}DgY_&_S}KPZ\&?SGAE&{Gw_w} GAgA{qT{gC&`qI?xwCNQwgR}?{*QEwQUj&BT&jR__IJJIqUqAPF0yICXESL?AYR QIAFU& yYwE&$\Njj B0T*F j$?kCzQk*}U}UgI$}Ew_yDL`qYI*E_G}SCjXDFNJKGNIGyIwA\BzLP`*zCILGCNqyYZyq? GwN{q{gKSj

Actually, the characters are kinda irrelevant. It's just a matter of whether or not each character has an even codepoint or an odd codepoint. Thus, I've made an effort to use every character available (except the multibyte characters) (though since it was randomised, I didn't make an effort to guarantee that).


1
@totallyhuman You're right; I will change that. I'll just remove the multibyte characters. It doesn't have a codepage really; it just needs to be stored as 1s and 0s (1 for odd ord and 0 for even ord) so you could say this is 33.25 bytes xD
HyperNeutrino

Your usage of the character should be based on its appearance in a normal program, not based on its code point or byte value.
KSmarts

@KSmarts I will ask the OP about that.
HyperNeutrino

@KSmarts What that means is that if a language has a different codepage and for example '5' occupies the codepoint of regular 'A', you're not allowed to use '5'.
HyperNeutrino

@KSmarts that just means that if you have a non-standard codepage, these characters move around on that codepage. You can still use their codepoint as part of your program.
Stephen

3

Pyke, 133 144 bytes

? BXKKKKRKRKRK\CkJ00q}}}XEjTX}G_E\E\L\LkJjRT}}XRGREkJjR 00q}R? B_RE\ \wkJjRT}}XRGRE\R\L\DkJjRZ0q}}R? B_RER? JR? KREZjZ0q}AREkJjRT}}RG_RE00q}}RAA

Try it online!

A horrible mess of code that can almost certainly be shortened... Constructs it one character at a time.

? BXKKKKRKRKRK\CkJ - ".C" - A string that when evaled, gets the character at the point
00q}}}XEj - Construct 64 by doing `((0==0)*2*2*2)**2` and then eval, getting the "@" character and store it in `j`
TX}G_E - Get "h" using `@` by looking it up in the alphabet
\E\L\LkJ - "hELL"
jRT}}XRGREkJ - "hELLo"
jR 00q}R? B_RE  - ","
\ \wkJ - "hELLo, w"
jRT}}XRGRE\R\L\DkJ - "hELLo, woRLD"
jRZ0q}}R? B_RER? JR? KREZjZ0q}AREkJ - "hELLo, woRLD!"
jRT}}RG_RE00q}}RAA - "Hello, World!"

2

dc, 164 162 bytes

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzS zzS?zzzzzzzzzzzzS$zzzzzzzzzzzzzzzzzzzzzzzzzzzzzPzzzzzzzzzzzzzzzzSwzzzzzzzzzzzzzzzPzzzzzzzzSLzPzPzzzzPL$PL PLwPzPzzzzPLLPAI*PL?P

Try it online!

There's likely a better/more interesting approach. I tried using the ASCII+256 trick that dc has, but that outputs additional characters as well (even if they're non-printing), and once I got to 'o', the wonderfully prime 111, I ran into trouble even getting a value of 111+(multiple of 256) that factored cleanly. So here's a fairly straightforward (albeit golfed where possible) solution:

In dc, z is a command that pushes the stack depth onto the stack. That means we can use it as an increment. This is how I create most of my ASCII values for this challenge (printed with P), which I push onto named stacks with S and pop back onto the main stack with L.

dc lets you use the hex values A-F even when the input radix is decimal (default). Luckily, our first letter, 72, is a multiple of 12, so I save a byte or two here by multiplying 6*12 and printing immediately (zzzzzzzC*P). My 164-byte version used multiplication early on to get 72 ('H'), which was mildly clever but a holdover from an earlier attempt, and a waste of bytes. Now, I start by incrementing and saving the space, the exclamation point, and the comma, which are out of order, and therefore can't be printed yet. Next, I come to the 'H', which I print immediately, before I get to 'W', which I must save for later.

I simply print when I hit the 'e', then I increment up to 'l'. I print two of those and save one. When I make it to 'o', I first thought I'd have to save one of those for later, but everything is kind of in order at this point. I print an 'o', retrieve my comma, space, and 'W' from earlier, and now I'm right back to 'o'. I print this, and increment a few up to the highest necessary value, 'r' (114), which I print before loading and printing the 'l' I tucked away earlier.

Almost done! 'd' is ASCII value 100, which is easily made by multiplying 10*10 (fewer bytes than having stored it earlier and loading it now). Hex value A is 10, as is our input radix which we can retrieve with the command I. Multiply those, print, and then load and print our exclamation point from earlier. Hello, World!

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.