12
\$\begingroup\$

Construct a full program which outputs Hello, World!. The score of your submission will be equal to the sum of all of the ASCII values of the distinct characters. The lowest score wins!

Rules

  • It must be a full program which takes no input
  • It must only print to STDOUT, nothing else
  • It must be strictly less than 1000 bytes long
  • It may only include printable ASCII (meaning no \n allowed)
  • The objective is to find the lowest score for every language, so no answer will be marked "accepted"

Example

Here is an example submission in Python, which has a score of 1279:

print"Hello, World!"

Finally, here is a TIO link to score your submission.

asked Mar 24, 2020 at 3:50
\$\endgroup\$
7
  • 2
    \$\begingroup\$ This answer shows how to write any Python program using only exc="% (which would have a score of 452), but it would be insanely long without newline. \$\endgroup\$ Commented Mar 24, 2020 at 4:00
  • 1
    \$\begingroup\$ On further thought, the above scheme is impossible without newline :( \$\endgroup\$ Commented Mar 24, 2020 at 4:06
  • 1
    \$\begingroup\$ @SurculoseSputum This one uses 9 chars exc%'(1+), no newline. CJam can do it in just 3: ')~. \$\endgroup\$ Commented Mar 24, 2020 at 4:12
  • \$\begingroup\$ Would it then be preferrable to include newlines, or maybe add a penalty for solutions which are too long? \$\endgroup\$ Commented Mar 24, 2020 at 4:15
  • 5
    \$\begingroup\$ And if you won't change the text "Hello, World!", Stuck will win as always. \$\endgroup\$ Commented Mar 24, 2020 at 4:31

45 Answers 45

1
2
14
\$\begingroup\$

C (gcc) -zexecstack -Wl,-e$ -nostartfiles on Linux x86-64, (削除) 876 (削除ここまで) 914 bytes, score (削除) 798 (削除ここまで) 293

$=1111+1111+1111+111+111-11-11-11-11+1+1+1;$$=1111111111+111111111-11111111+1111111+1111111-111111+1111+1111+111+111+111+111+111-11-11-11-11+1+1+1+1+1;$$$=111111+111111-11111-1111+111+111+111-11-1-1-1-1-1;$$$$=111111111+111111111+11111111+11111111+11111111+1111111+1111111+111111-1111-1111-1111-1111-111-111-111+11+11+11+11+1+1+1+1+1;$$$$$=1111111111+1111111111-111111111-111111111-111111111-111111111+11111111+11111111+11111111+11111111-1111111-1111111-1111111-111111-111111-111111+11111+11111-1111+111+111+11+1;$$$$$$=111111111+111111111+111111111+111111111+111111111-11111111-1111111-1111111-1111111-1111111-111111-111111+1111+1111+1111+1111+1111-111-111-111+11+11-1-1;$$$$$$$=1111111111+1111111111-111111111-111111111-111111111-111111111+11111111+11111111+11111111+11111111-1111111-1111111-111111-111111-111111-111111-111111-1111-1111-1111-1111-1111+11+11+11+11+1;$$$$$$$$=11111-1111-1111-111-111-111-11+1+1+1;

Try it online!

Charset: (削除) A[]={+,-1}; (削除ここまで) 1+-$=;

Same method as the previous answer, with even more hacking to supply a custom entry point named $ (which has the smallest ASCII value among a-zA-Z_$). Credit to this SO answer for identifying the flags and assembly setup to make this work. Also got a hint from ceilingcat's awesome linker hack to remove []{} from the code.

Assembly: (NASM syntax)

bits 64
global _start
_start:
 mov edx, 13
 pop rax
 push rax
 lea rsi, [rel s]
 pop rdi
 syscall
s: db "Hello, World!"

Uses the argc=1 set up on the stack to load the value 1 to rax and rdi. The instructions are slightly mixed up in order to get the minimal code length in C.

Here is the Python script that generates the "ones decomposition" from the xxd -i output (C include-style hex output) of the compiled binary.


C (gcc) -zexecstack on Linux x86-64, 891 bytes, score 1154

main[]={1111+1111+1111+111+111-11-11-11-11+1+1+1,1111111111-111111111-111111111+11111111-1111111-111111-111111-111111-111111+11111-1111-1111-1111-1111+111+111+111+11,1+1+1+1,111111111-11111111-11111111-1111111-1111111-1111111-1111111+111111+111111+111111+111111+11111+11111+11111+11111-111-111-111-111-111-11-11-11,1111111111+1111111111-111111111-111111111-111111111-111111111+11111111+11111111+11111111+11111111-1111111-1111111-1111111+111111+11111+11111+11111+11111-1111-111-111+11+11+11,1111111111+111111111+111111111+111111111+11111111+11111111-1111111-1111111-1111111-1111111-111111-111111-111111-111111-11111-11111-11111-11111-11111+1111+1111+1111+1111-111-111-111-11-1-1-1-1,1111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111-1111111-1111111-1111111-1111111+111111+111111+111111+11111+11111+11111+11111+11111-1111-1111-1111-1111-111+11-1-1-1-1-1,11+11+11};

Try it online!

Uses ceilingcat's minimal Turing-complete charset main[]={1+,};, plus - to meet the code length limit.

Assembly: (NASM syntax)

bits 64
global _start
_start:
 mov edx, 13
 lea rsi, [rel s]
 mov eax, edi
 syscall
s: db "Hello, World!"

Essentially calls write syscall once, and goes into arbitrary instructions formed by the string literal, causing segfault.

answered Mar 25, 2020 at 8:08
\$\endgroup\$
11
  • 1
    \$\begingroup\$ This is a brilliant solution (I’ve upvoted it). But I think the language should be "C (gcc)/x86". It won’t work using gcc on a non-x86 machine. \$\endgroup\$ Commented Mar 25, 2020 at 13:33
  • \$\begingroup\$ In fact, I just tried it on two x86 machines (one Linux and one OS X), and it failed to print "Hello, World!" on both. I don't know what the difference is between these and TIO, where it worked. \$\endgroup\$ Commented Mar 25, 2020 at 14:15
  • \$\begingroup\$ One more comment: This program writes an error message to stderr (when it crashes), which I understood wasn't allowed in OP's specs ("It must only print to STDOUT, nothing else"). I could reduce my dc score, for instance, if spurious output to stderr was allowed, and that's probably true of some of the other solutions as well. \$\endgroup\$ Commented Mar 25, 2020 at 14:29
  • \$\begingroup\$ @MitchellSpector This code is supposed to work in x86-64, with executable stack (-zexecstack flag in the compiler/linker). And as pointed out in the linked answer, you might need const in some environments. The error messages are printed by the OS, not the program. \$\endgroup\$ Commented Mar 26, 2020 at 0:58
  • \$\begingroup\$ Thanks -- I missed that flag because it wasn't included with the language name in the answer heading, but it's clearly needed. That got it to work correctly on my Linux system. But I still can't get it to work under OS X, where I believe the equivalent compiler option is -Wl,-allow_stack_execute -- but even with that option, it doesn't print "Hello, World!". I tried it with and without the const keyword before main. If you know how to get this to work under OS X, I'd be interested. \$\endgroup\$ Commented Mar 26, 2020 at 1:54
6
\$\begingroup\$

CJam, 652 bytes, score 120

'))))))))))))))))))))))))))))))))')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))''(((((((')))))))))))))))))))))))))))))))))))))))))))))))')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))''((((((

Try it online!

Uses ')(.

answered Mar 24, 2020 at 4:30
\$\endgroup\$
5
\$\begingroup\$

HQ9+, 1 byte, score 72

H

There is no TIO implementation for HQ9+.

answered Mar 24, 2020 at 12:07
\$\endgroup\$
5
\$\begingroup\$

Malbolge, 71 bytes, 3963 points

(=<`#9]=}5YXy1Uvv-Q+q)Mn&Jk#j!EC$dc.?}_<)L'8%oXW2qj|Q@yx+iba'Hd]\E!YX|z

Try it online!

Uses the following unique characters

!#$%&'()+-.12589<=?@CEHJLMQUWXY\]_`abcdijknoqvxyz|}
answered Mar 24, 2020 at 20:50
\$\endgroup\$
5
\$\begingroup\$

Wolfram Language (Mathematica), 321 bytes, score 399

charset: 013456円

043円1333311円05313311円0531133円135円133円043円13311円0534011円0534031円135円133円043円1331343円05311354円135円13331円05341円054101円0544円053104円0544円053104円054111円05444円0541円05331円05443円05344円054111円054114円0544円053104円054100円05433円135円135円135円046円1330円133円1330円0540円135円135円133円116円141円155円145円163円133円135円133円133円043円135円135円135円046円135円

Try it online!

I feel it's best to try to explain this one. First, Mathematica allows character inputs with octal triplets (From this point on, I'll be using my local copy), after decoding, looks like so

#[1000+31111][#[3304+11135][#[10000+13003][31+41,101,4+104,4+104,111,44,1+31,43+44,111,114,4+104,100,33]]]&[0[[0,0]][Names[][[#]]]&]

All of the addition is just to avoid getting a 2, 7, 8, or 9, which in octal have 2s and 7s, which are trivially avoidable, all the other characters are the minimum needed to get Names[]. When the actual functions are shown,

Print[FromCharacterCode[List[72,101,108,108,111,44,32,87,111,114,108,100,33]]]

Where all the functions are hidden inside a Names[][[1234]] so that they can all be numerically decided, but Names[], at minimum, needs 13456円 to derive everything else, the 0 is needed to turn Names's string output into Functions, as 0[[0,0]] returns Symbol.

I know that after making this whole thing it can be golfed to do without 0, as the only time it comes up is in addition, inside the octal for the + symbol, and getting the symbol header, meaning that if 0 can be derived elsewhere then in the charset 0 can be switched to +, lowering the score by 5. All it would need is to not use commas inside list. The only function that I recall that can do this is the Append family, but calling Append instead of each comma makes the program over 2k in size.

In case you want to see how it was generated, I will put most of my code here

answered Dec 15, 2020 at 8:25
\$\endgroup\$
4
\$\begingroup\$

brainfuck, 134 score

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++.+++.------.--------.-------------------------------------------------------------------.

Try it online!

Alas, could have scored 89 if not for the 1000 character limit.

Boolfuck, 102 score

;;;+;+;;+;+;+;+;+;+;;+;;+;;;+;;+;+;;+;;;+;;+;+;;+;+;;;;+;+;;+;;;+;;+;+;+;;;;;;;+;+;;+;;;+;+;+;+;+;+;;;;+;+;;+;;+;+;;+;;;+;;;+;;+;+;;+;;;+;+;;+;;+;+;+;;;;+;

Try it online!

"Standard".

answered Mar 24, 2020 at 5:27
\$\endgroup\$
1
  • \$\begingroup\$ I was going to make a brainf*** solution (generated with Python) and it was exactly your solution, so I upvoted it. Nice going! :) \$\endgroup\$ Commented Jun 7, 2021 at 21:25
4
\$\begingroup\$

Knight, (削除) 460 (削除ここまで) (削除) 383 (削除ここまで) 442 bytes, score (削除) 268 (削除ここまで) (削除) 236 (削除ここまで) 226

-32 score thanks to @Adam by utilizing A1

-10 score thanks to @emanresu A and @UnrelatedString by using E to EVAL O"Hello, World" instead of using O directly

E+++++++++++++++A+11+11+11+11+11+11+11+1+1A1A+11+11+11+1A1A+11+11+11+11+11+11+1+1+1+1+1+1A1A+11+11+11+11+11+11+11+11+11+1+1A1A+11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1A1A+11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1A1A+111A1A+11+11+11+11A1A+11+11+1+1+1+1+1+1+1+1+1+1A1A+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1A1A+111A1A+111+1+1+1A1A+11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1A1A+11+11+11+11+11+11+11+11+11+1A1A+11+11+11A1A+11+11+11+1A1

Characters used: E+A1

Try It Online!

(Code used to generate this Knight code: Try It Online!)

answered Aug 7, 2022 at 9:57
\$\endgroup\$
6
  • \$\begingroup\$ You can actually do this without spaces, e.g. controlc.com/d04bd5eb. You can probably modify your code to get rid of spaces as well. \$\endgroup\$ Commented Aug 7, 2022 at 23:02
  • \$\begingroup\$ Here's the equivalent for your code: controlc.com/8ce83f01 \$\endgroup\$ Commented Aug 7, 2022 at 23:09
  • \$\begingroup\$ @Adam Wow doing A1 is actually super smart, editing my answer now. \$\endgroup\$ Commented Aug 8, 2022 at 6:23
  • 1
    \$\begingroup\$ If you have the willpower, E has a lower charcode than O. \$\endgroup\$ Commented Aug 8, 2022 at 6:44
  • 1
    \$\begingroup\$ @UnrelatedString Bro that's actually big brain, wowow \$\endgroup\$ Commented Aug 8, 2022 at 7:25
4
\$\begingroup\$

Grass, score 324, 623 bytes

wvwwWWwWWWwvWwwwwWWwWWWwWWWWwWWWWWwWWWWWWwWWWWWWWwWwwwwwwwwwwwwWWWWwWWWWWWWwWWWWWWWWWWWWWWwWWWWWWWWWWWwwWWWWWWWWWWwwWWWWWWWWWWWWwWWWWWWWWWWwwWWWWWWWWWWwwwwwwwWWWWWWWWWWWWWWwWWWWWWWWWWWWWWWWwWWWWWWWWWWWWWWWWWWWWWWwWWWWWWWWWWWWWWWWWWWwwWWWWWWWWWWWWWWWWWWwwWWWWWWWWWWWWWWWWWWwwwwwWWWWWWWWWWWWWWWWWWWWWwwWWWWWWWWWWWWWWWWWWWWWWWwWWWWWWWWWWWWWWWWWWWWWWWWWWwwwwwwwwwwwwwwwwwwwwwwwwwwwWwwwwwwwwwwwWWwwwwwwwWWWwwwwwwwWWWWwWWWWWwwwwwwwwWWWWWWwwwwwwwwwwwwwwwwwWWWWWWWwwwwwwwwwwwwwwwwwwwwwWWWWWWWWwwwwwwwwwwwwwwwwwWWWWWWWWWwwwwWWWWWWWWWWwwwwwwwwwwwWWWWWWWWWWWwwwwwwwWWWWWWWWWWWWwwwwwwwwwwwwwwwwwwWWWWWWWWWWWWWwwwwwwwwwwwwwwwwwwwwwwwwww
answered Nov 7, 2022 at 20:29
\$\endgroup\$
3
\$\begingroup\$

Stuck, 0 bytes, score 0

An empty program prints "Hello, World!"

Just as suggested in the comments, Stuck wins!

answered Mar 24, 2020 at 4:36
\$\endgroup\$
2
  • 6
    \$\begingroup\$ Can we please stop the low-effort stuff? 1+ though. \$\endgroup\$ Commented Sep 10, 2020 at 5:22
  • \$\begingroup\$ Also 0-byte: BrainCrash (2008) \$\endgroup\$ Commented Sep 23, 2024 at 5:53
3
\$\begingroup\$

dc, (削除) 106 (削除ここまで) (削除) 652 (削除ここまで) (削除) 192 (削除ここまで) 428 bytes, score (削除) 332 (削除ここまで) (削除) 272 (削除ここまで) (削除) 272 (削除ここまで) 204

11 11+11+11+11+11+1+1+1+1+1+1+P11 11+11+11+11+11+11+11+11+1+1+P11 11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+P11 11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+P11 11+11+11+11+11+11+11+11+11+1+P11 11+11+11+P11 11+1+1+1+1+1+1+1+1+1+1+P11 11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1+P11 11+11+11+11+11+11+11+11+11+1+P11 11+11+11+11+11+11+11+11+11+1+1+1+1+P11 11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+P11 11+11+11+11+11+11+11+11+1+P11 11+11+P

Try it online!

4 characters used: +1P and the space character.

answered Mar 24, 2020 at 5:24
\$\endgroup\$
4
  • \$\begingroup\$ You need to sum the codepoints of all characters you use in your program. \$\endgroup\$ Commented Mar 24, 2020 at 5:25
  • \$\begingroup\$ @a'_' You're right - I misread the scoring in the challenge. It's fixed. \$\endgroup\$ Commented Mar 24, 2020 at 5:29
  • \$\begingroup\$ You may be interested in the bounty to codegolf.stackexchange.com/q/11336 for the dc solution with the lowest number of unique characters \$\endgroup\$ Commented Feb 6, 2021 at 11:59
  • \$\begingroup\$ @user41805 Thanks, I hadn’t seen the bounty. (I haven’t had time to do any code golf for a while.) \$\endgroup\$ Commented Feb 7, 2021 at 2:17
3
\$\begingroup\$

C (gcc), (削除) 344 (削除ここまで) \$\cdots\$ (削除) 254 (削除ここまで) 242 bytes, score (削除) 1624 (削除ここまで) 1575

Lowered score by 49 thanks to Arnauld!!!

Saved 12 bytes thanks to ceilingcat!!!

h;t;u;i;a;main(c){u+=u=i+=i=a=c+c+c;t=u+u+u;putchar(putchar(t+t)+u+u+a+c+c);putchar(putchar(putchar(h=t+t+t))+a);putchar(t+i+c+c);putchar(u+u+i+c+c);putchar(t+t+u+a);putchar(h+a);putchar(h+i);putchar(h);putchar(t+t+u+u+a+c);putchar(u+u+i+a);}

Try it online!

Uses characters: ()+;=achimnprtu{}

answered Mar 24, 2020 at 13:30
\$\endgroup\$
9
  • \$\begingroup\$ You can get rid of 1 by retrieving it from argc, leading to 1575 points. \$\endgroup\$ Commented Mar 24, 2020 at 17:17
  • \$\begingroup\$ @Arnauld Very clever - thanks! :-) \$\endgroup\$ Commented Mar 24, 2020 at 17:24
  • \$\begingroup\$ @Arnauld Why not? Thanks! :-) \$\endgroup\$ Commented Mar 24, 2020 at 17:37
  • \$\begingroup\$ @Arnauld Knocked down to a quarter K - thanks! :-) \$\endgroup\$ Commented Mar 24, 2020 at 17:50
  • \$\begingroup\$ Yeah, that's a nice round figure. And that's why I didn't submit the 254-byte version. ;) \$\endgroup\$ Commented Mar 24, 2020 at 17:55
3
\$\begingroup\$

Go, (削除) 61 (削除ここまで) 48 bytes, score (削除) 2527 (削除ここまで) 2401

package main;func main(){print("Hello, World!")}

Attempt This Online!

The boilerplate hello world, compressed onto 1 line.

  • -13 bytes and -126 score from printing to STDERR instead.
answered Nov 4, 2022 at 17:06
\$\endgroup\$
1
  • \$\begingroup\$ 48 bytes \$\endgroup\$ Commented Sep 23, 2024 at 5:56
2
\$\begingroup\$

Brain-Flak, 618 bytes, score 265

((((((()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())()()()()()()()())()()()()()())[()()()])[()()()()()()()()()()()()()()()()()()()()()()()()])(((((((()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())()()()()()()()()()()()())()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())[()()()]))[()()()()()()()])[()()()()()()()()()()()()()()()()()()()()()()()()()()()()()])

Try it online!

Used characters: ()[]

Uses () (one), (...) (sum and push), [...] (negate). Can definitely be shorter by using [] (stack height) but it's not the point of the challenge (as long as the code is under 1000 bytes). Looks like the program can't fit into 1000 bytes using only () and (...).

answered Mar 24, 2020 at 5:52
\$\endgroup\$
2
\$\begingroup\$

Python 2, 574 bytes, score 564

exec"%c"%(111+1)+"%c"%(111+1+1+1)+"%c"%(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+"%c"%(11+11+11+11+11+11+11+11+11+11)+"%c"%(111+1+1+1+1+1)+"%c"%(11+11+11+1+1+1+1+1+1)+"%c"%(11+11+11+11+11+11+1+1+1+1+1+1)+"e%c"%(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+"%c"%(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+"%c"%111+"%c"%(11+11+11+11)+"%c"%(11+11+1+1+1+1+1+1+1+1+1+1)+"%c"%(11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+"%c"%111+"%c"%(111+1+1+1)+"%c"%(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+"%c"%(11+11+11+11+11+11+11+11+11+1)+"%c"%(11+11+11)+"%c"%(11+11+11+1+1+1+1+1+1)

Try it online!

Used characters: exc"%(1+)

Constructs the string print'Hello, World!' using the characters "%c(1+), then execs it. Using the raw print with any single extra character costs more than this.

answered Mar 24, 2020 at 6:11
\$\endgroup\$
0
2
\$\begingroup\$

05AB1E, score: 282 (251 bytes)

0>>>0>>>>>>>>>0>0>>>0>>>>>>>>0>>>>>0>>>0 0>>>>>>0>>>>>>>>0>>>>>>>>0>>>>0>>>>>>>0>>0 0>>>>>>>0>>>0 0>>>>>0>>>>>>>>>0>>0>>>0>0>>>>>>0 0>>>>>>>J 0>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>B

Try it online.

Five characters used: 0> JB

Explanation:

  1. First we construct the number 39138530688472073059231607. We do this per digit, by pushing a 0 and increasing it by 1 per >, after which the entire stack of digits is joined together with J.
  2. Then it pushes another 0 with 107 >s to get the number 107.
  3. After which it will convert 39138530688472073059231607 to base-107 with B, which is "Hello, World!".
answered Mar 24, 2020 at 8:12
\$\endgroup\$
2
\$\begingroup\$

C (gcc), 540 bytes, score 1563

main(){putchar(11+11+11+11+11+11+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+1+1);putchar(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+11+1);putchar(11+11+11+11);putchar(11+11+1+1+1+1+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+11+1);putchar(11+11+11+11+11+11+11+11+11+11+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1);putchar(11+11+11+11+11+11+11+11+11+1);putchar(11+11+11);}

Try it online!

This is just a straightforward solution that prints the ASCII code of each character in turn, like some of the other solutions here. I'm not aware of any tricky way to reduce the score in C.

answered Mar 25, 2020 at 6:54
\$\endgroup\$
1
2
\$\begingroup\$

Help, WarDoq!, 1 byte, Score: 72

H

Try It Online!

The Fifth Marshal
6,2631 gold badge26 silver badges46 bronze badges
answered Mar 25, 2020 at 11:49
\$\endgroup\$
2
\$\begingroup\$

H🌍, 2 bytes, score 223

hw

Try it online!

answered May 18, 2020 at 19:09
\$\endgroup\$
2
\$\begingroup\$

Nim, 387 bytes, score 601

ecHO cHR 11+11+11+11+11+11+1+1+1+1+1+1,cHR 11+11+11+11+11+11+11+11+11+1+1,cHR 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,cHR 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,cHR 111,cHR 11+11+11+11,cHR 11+11+1+1+1+1+1+1+1+1+1+1,cHR 11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1,cHR 111,cHR 111+1+1+1,cHR 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,cHR 11+11+11+11+11+11+11+11+11+1,cHR 11+11+11

Try it online!

Chars: ecHRO, +1

answered Feb 26, 2021 at 19:37
\$\endgroup\$
2
\$\begingroup\$

Bits, score: 97

There are only 2 distinct characters in Bits, 0 and 1. These have ASCII values of \48ドル\$ and \49ドル\$, so the score is \97ドル\$.

If you're interested, this is actually only 10 bytes (80 bits).

10010000001010011000011000011110111000111111010111001111010010001100000100011101

Explanation

1001000 // H
000101 // e
001100 // l
001100 // l
001111 // o
011100 // ,
011111 // 
1010111 // W
001111 // o
010010 // r
001100 // l
000100 // d
011101 // !
 // [implicitly joined and output]
answered Nov 4, 2022 at 17:02
\$\endgroup\$
1
\$\begingroup\$

Gol><>, 234 bytes, score 259

llllllll+++l+++++lllllllllllll+++++l++++++++llllllllllll+++++l+l+++++++llllllllllll+++l+++++++++lllllllllll+++l++++++++lllllll++ll++l+++++llll+++l+l+lll++l+$llllllll++++++l++l+llllll+++lll+++++llllllll+++++++lll++l+l+l+llllll++++l++$H

Try it online!

Used characters: l (length of stack), + (add top two numbers), $ (swap top two numbers), H.

$ was needed because some characters (space, H) were impossible to create at that specific stack height; it is cheaper than any number literal (minimum being 0).


Gol><>, 182 bytes, score 315

ssP0ssssssPPPP0ssssssPPPPPPPPPPPP0sssssssPP0ssssssPPPPPPPPPPPPPPP0sssssPPPPPPP0ss0ssPPPPPPPPPPPP0ssssssPPPPPPPPPPPPPPP0ssssssPPPPPPPPPPPP0ssssssPPPPPPPPPPPP0ssssssPPPPP0ssssPPPPPPPPH

Try it online!

Used characters: 0 (push zero to the stack), s (add 16 to top), P (increment top), H (halt and print everything on the stack as characters).

answered Mar 24, 2020 at 6:42
\$\endgroup\$
1
\$\begingroup\$

Rust, 35 bytes, Score: 1916

fn main(){print!("Hello, World!")}

I don't know if you can get any shorter in Rust.

answered Apr 1, 2020 at 14:17
\$\endgroup\$
1
\$\begingroup\$

Bash, 18 bytes, score 1005

echo Hello, World!

Try it online!

answered Apr 7, 2020 at 18:40
\$\endgroup\$
1
\$\begingroup\$

PHP, 13 bytes, score 802

Hello, World!

Try it online!

answered May 27, 2020 at 14:35
\$\endgroup\$
1
\$\begingroup\$

naz, 732 bytes, score 372

1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1o1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1o1a1a1a1a1a1a1a1o1o1a1a1a1o1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1o1s1s1s1s1s1s1s1s1s1s1s1s1o1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1o1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1o1a1a1a1o1s1s1s1s1s1s1o1s1s1s1s1s1s1s1s1o1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1s1o

Uses 1, a, s and o.

Without the size restriction, naz -u could achieve a theoretical score of 257 by foregoing s.

answered Sep 10, 2020 at 1:51
\$\endgroup\$
1
\$\begingroup\$

2/9 of an esolang, 1 byte, score = 64

@
answered Dec 12, 2020 at 1:06
\$\endgroup\$
1
  • 2
    \$\begingroup\$ But the article says "Every line of code must be exactly 21 characters" \$\endgroup\$ Commented Mar 30, 2021 at 13:46
1
\$\begingroup\$

G*, 15 bytes, score = 914

p Hello, World!
answered Dec 12, 2020 at 0:56
\$\endgroup\$
1
\$\begingroup\$

Perl 5, 386 bytes, score = 818

say chr 11+11+11+11+11+11+1+1+1+1+1+1,chr 11+11+11+11+11+11+11+11+11+1+1,chr 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,chr 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,chr 111,chr 11+11+11+11,chr 1+1+1+1+1+1+1+1+1+1+11+11,chr 11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1,chr 111,chr 111+1+1+1,chr 11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1,chr 11+11+11+11+11+11+11+11+11+1,chr 11+11+11

Try it online!

answered Dec 13, 2020 at 5:20
\$\endgroup\$
1
\$\begingroup\$

Pyth, 430 bytes, score 191

++++++++++++C+++++++++++11 11 11 11 11 11 1 1 1 1 1 1C++++++++++11 11 11 11 11 11 11 11 11 1 1C+++++++++++++++++11 11 11 11 11 11 11 11 11 1 1 1 1 1 1 1 1 1C+++++++++++++++++11 11 11 11 11 11 11 11 11 1 1 1 1 1 1 1 1 1C111C+++11 11 11 11C+++++++++++11 11 1 1 1 1 1 1 1 1 1 1C++++++++111 1 1 1 1 1 1 1 1C111C+++111 1 1 1C+++++++++++++++++11 11 11 11 11 11 11 11 11 1 1 1 1 1 1 1 1 1C+++++++++11 11 11 11 11 11 11 11 11 1C++11 11 11

Try it online!

answered Feb 27, 2021 at 0:39
\$\endgroup\$
1
\$\begingroup\$

Deadfish~, 1 byte, score 119

w

Try it online!

Not so interesting

\$\endgroup\$
1
  • 2
    \$\begingroup\$ As this is code challenge and has special scoring, please also specify "score 119". \$\endgroup\$ Commented Mar 31, 2021 at 1:57
1
2

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.