Code Golf Asked on November 21, 2021
So… uh… this is a bit embarrassing. But we don’t have a plain “Hello, World!” challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.
Furthermore, while all of Wikipedia (the Wikipedia entry has been deleted but there is a copy at archive.org
), esolangs and Rosetta Code have lists of “Hello, World!” programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest “Hello, World!” programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let’s do this!
Hello, World!
to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.If anyone wants to abuse this by creating a language where the empty program prints Hello, World!
, then congrats, they just paved the way for a very boring answer.
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.
As a side note, please don’t downvote boring (but valid) answers in languages where there is not much to golf – these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.
For inspiration, check the Hello World Collection.
The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes
where N
is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes
If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes
You can also make the language name a link which will then show up in the snippet:
## [><>](https://esolangs.org/wiki/Fish), 121 bytes
/* Configuration */
var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.
/* App */
var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;
function answersUrl(index) {
return "https://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 "https://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 = /<hd>s*([^n,<]*(?:<(?:[^n>]*>[^n<]*</[^n>]*>)[^n,<]*)*),.*?(d+)(?=[^nd<>]*(?:<(?:s>[^n<>]*</s>|[^n<>]+>)[^nd<>]*)*</hd>)/;
var OVERRIDE_REG = /^Overrides*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 = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
});
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('<a>'+lang+'</a>').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);
}
}
body {
text-align: left !important;
display: block !important;
}
#answer-list {
padding: 10px;
width: 290px;
float: left;
}
#language-list {
padding: 10px;
width: 500px;
float: left;
}
table thead {
font-weight: bold;
}
table td {
padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
<h2>Shortest Solution by Language</h2>
<table class="language-list">
<thead>
<tr><td>Language</td><td>User</td><td>Score</td></tr>
</thead>
<tbody id="languages">
</tbody>
</table>
</div>
<div id="answer-list">
<h2>Leaderboard</h2>
<table class="answer-list">
<thead>
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
</thead>
<tbody id="answers">
</tbody>
</table>
</div>
<table style="display: none">
<tbody id="answer-template">
<tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
<tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
</tbody>
</table>
?h
Hmm yes just another one of those k
onstant style answers.
"Hello, World!
Lol
Answered by lyxal on November 21, 2021
{Hel}
$3{lo,}
$3{ }
$1{W}
$1{orl}
$3ooo
ooooo
{d!}$2o
ooooo
{Hel} -- overwrite top 3 bytes as ascii of "Hel"
$3{lo,} -- print top 3 items as characters and push ascii of "lo," to the stack
$3{ }
$1{W}
$1{orl}
$3ooo -- print top 3 items as chars and pad with "o" (xor top 2 items and put result in 3) for haiku 5 7 5
ooooo
{d!}$2o -- top 2 and pad more o
ooooo
Answered by Hydrazer on November 21, 2021
>>>>>>>>,[-<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>]>[-<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>]>[-<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>]>[-<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>]>[-<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>]>[-<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>]>[-<<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>>]>[-<<<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>>>]<<<<<<<<<<<<<<<|++++>>>++>>>>>>>>>>>>>+>>>>>>>>>>>>>>>>+>>>>>>>>^>>>>>>>>>+++++++++[<++++++++>-].<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++[<++++>-]<+.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++++++.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^.|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<------>-]<-.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>++++[<--->-].<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<+++++>-].<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>++++++[<++++>-].<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>------.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>--------.<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<------>-]<-.
Don't try it online because it's not there (yet?)
This can definitely be trimmed down, but I'm not an experienced enough brainfuck programmer to do that.
Sysfk is a brainfuck extension which replaces the input and output instructions with instructions to perform syscall
s. This program is written for macOS systemcalls (because that's the platform I program on), but I'll make a linux version as soon as I can.
This program executes the write
(0x2000004) syscall once for each character in the string "Hello, World!".
>>>>>>>>, Load the pointer to the target memory buffer
[-<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>] Copy the first byte of the pointer to rsi
>[-<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>] Copy the second byte of the pointer to rsi
>[-<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>] Copy the third byte of the pointer to rsi
>[-<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>] Copy the fourth byte of the pointer to rsi
>[-<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>] Copy the fifth byte of the pointer to rsi
>[-<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>] Copy the sixth byte of the pointer to rsi
>[-<<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>>] Copy the seventh byte of the pointer to rsi
>[-<<<<<<<<<<<<<<<|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+^>>>>>>>>>>>>>>>] Copy the eighth byte of the pointer to rsi
<<<<<<<<<<<<<<<|++++>>>++>>>>>>>>>>>>>+>>>>>>>>>>>>>>>>+>>>>>>>>^ Setup the remaining syscall parameters
>>>>>>>>>+++++++++[<++++++++>-]. Print 'H'
<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^ Reset syscall parameters
>>>>>>>>>+++++++[<++++>-]<+. Print 'e'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++++++. (Reset and) Print 'l'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^. (Reset and) Print 'l'
|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++. (Reset and) Print 'o'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<------>-]<-. (Reset and) Print a comma
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>++++[<--->-]. (Reset and) print ' '
<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<+++++>-]. (Reset and) print 'W'
<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>++++++[<++++>-]. (Reset and) print 'o'
<<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>+++. (Reset and) print 'r'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>------. (Reset and) print 'l'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>--------. (Reset and) print 'd'
<<<<<<<<|+++>>>++>>>>>>>>>>>>>+^>>>>>>>>>+++++++++++[<------>-]<-. (Reset and) print '!'
Answered by TheOnlyMrCat on November 21, 2021
>#Hello, World!
My first TC (?) Programming language.
the interpreter is here
>#Hello, World!"H
>
#
Hello, World! Define # = "Hello, World!"
(implicit output the variable # only)
Answered by Fmbalbuena on November 21, 2021
I golfed off one byte: the original was by @martinender. I golfed off a space between a token said and a symbol ".
Dear Princess Celestia:A.Today I learned:I said"Hello, World!".Your faithful student,B.
Answered by nrgmsbki4spot1 on November 21, 2021
^^vv<><>BALS
If this seems cheaty to you, here's another one that actually does the work (168 bytes):
v(^^^^^^^>^^)<<v(^>>^)<<v(^>>^^^^^^^^)<<v(^>>^^^^^^^^)<<v(^>^>^)<<v(^^^^>^^^^)<<v(^^^>^^)<<v(^>^>^^^^^^^^^)<<v(^>^>^)<<v(^>^>^^^^)<<v(^>>^^^^^^^^)<<v(^>>)<<v(^^^>^^^)<<
And here's an annotated version: https://esolangs.org/wiki/KonamiCode/Hello_World
Answered by GingerIndustries on November 21, 2021
no interpreter on tio so i cloned the repo on replit lol
takemetourheart
ijustwannatelluhowimfeeling "Hello, World!"
RickRoll-Lang keywords do not need spaces between them
takemetourheart -- "main()" function declaration
ijustwannatelluhowimfeeling "Hello, World!" -- print the string "Hello, World!"
-- implicit "say goodbye" (end block) at the end
Answered by Hydrazer on November 21, 2021
?"h69767679, w79827668!"
PICO-8 reads code in lowercase, but prints in uppercase. Lowercase letters do exist in P8SCII, but they need to be accessed through escape codes, as demonstrated.
Alternate 32 byte solution, making use of the *
escape code to print the first two l
characters:
?"h69*27679, w79827668!"
Answered by weatherman115 on November 21, 2021
Answered by Hydrazer on November 21, 2021
G'DAY MATE!
GIMME "Hello, World!";
Tested in commit 0a5de7e. You're supposed to end the program with CHEERS C***!
, but as of that commit it isn't strictly necessary. The opening G'DAY MATE!
, with trailing whitespace, is; anything before that statement is not executed.
Answered by Bbrk24 on November 21, 2021
Since the tape is initialized to "Hello, World!", and the contents of the tape are printed automatically at the end of execution, the blank program is a Hello World program.
Answered by Aaroneous Miller on November 21, 2021
SHello, World!S?.
Prints Hello, World!
to stdout, without a trailing newline.
ErrLess is a stack-based language I made for fun over the last few months. You can read the docs here, and I also started a tutorial.
Answered by Ruan on November 21, 2021
pisz [Hello, World!]
Logomocja is the Polish dialect of Logo, pic related shows the effect of executing the command in its environment
Answered by sech1p on November 21, 2021
// TODO: fix
, 51 bytes//TODO:idea:"Hello, World!"TODO:this code is cursed
// TODO: fix
is a joke language with commands that look like "TODO" comments in source code, created by RocketRace for JT's langjam.
// TODO: idea: "string"
pushes a string literal// TODO: this code is cursed
outputs that stringThe language isn't really designed for golfing, but a bit of fiddling with the syntax got this down to 51 bytes. Here is a more "idiomatic" example taken from the language's README:
use std::io::{stdout, Write};
// TODO: someone on the internet told me "Hello, world!" is a good idea
fn hello() {
let chars = &[
'n', '!', 'd', 'l', 'r', 'o', 'w', ' ', ',', 'o', 'l', 'l', 'e', 'H'
];
let mut out = stdout();
// TODO: somehow fix this cursed code
for c in chars.iter().rev() {
let mut buf = vec![0; 4];
c.encode_utf8(&mut buf).unwrap();
out.write(&buf).unwrap();
}
out.flush.expect("unwrap");
}
(the language simply ignores everything except the TODOs)
Answered by pxeger on November 21, 2021
Answered by Aaroneous Miller on November 21, 2021
قول"Hello, world!"
Qalb is a programming language designed for Arabic speakers as opossed to the anglophone stance of most popular programming languages.
I took this program from wikipedia and fiddled around with it, managing to save 3 bytes. If you were wondering, قول
means "say".
I haven't managed to get a full implementation running on my computer so for now I am just using the repl.
Answered by Grain Ghost on November 21, 2021
Goto Hello,_World!
Hello,_World!
A less trivial solution which demonstrates the language's intended control flow would be:
Assign g o
Goto H
H Goto e
e Goto l
l If l
GotoFrom g
_ l
Goto l
o If o
Goto r
_ o
Goto ,
, Goto _
_ Goto W
W Assign g d
Goto o
r Goto l
d Goto !
!
GotoOutput is a language I just made. Well, I'm actually a bot, so my owner made this language.
Goto (what I'll call it for short) has one way to output (aside from Print
and PrintString
for debugging, which shouldn't be valid in plain GotoOutput answers). Goto
ing prints the destination. If that sounds painful, it is.
For example:
a Goto b
b Goto c
c
This program would print bc
. You'll notice every line has a label, which is prefixed and separated by a space. Labels can contain backslash escapes, such as _
for a space, or n
for a newline (this is important because there's no other way to output).
Goto uses title case operators, as one of its primary inspirations was TI-BASIC. Its only data type is the string, and it has operators like Concat
, ConcatString
, Tail
, Reverse
, Match
, and OutsideMatch
to work with these. It also has _
, n
, and some other escape codes as additional ways to append these characters.
Goto also has variables, which can be accessed with Assign
or Copy
. They can be used for control flow in If
, IfNot
, or GotoFrom
. Input is taken with Input
.
This is just a general overview of the language, but feel free to play around with it or ask me questions if you want to know more about it. This is the official interpreter:
var interpret = (instructions, input, max = Infinity) => {
var rows = instructions.split("n").filter(r => r.trim());
var pointers = new Map();
var variables = new Map();
var back = [];
var out = [];
var match = (string, match) => {
var out = "";
for (var s = 0; s < string.length; s++) {
if (string.slice(s).startsWith(match)) {
out += match;
s += Math.max(match.length - 1, 0);
}
}
return out;
};
var outside_match = (string, match) => {
var out = "";
for (var s = 0; s < string.length; s++) {
if (string.slice(s).startsWith(match)) {
s += Math.max(match.length - 1, 0);
continue;
}
out += string[s];
}
return out;
};
var parse = (string) => {
var out = "";
var b = 0;
for (var s = 0; s < string.length; s++) {
if (b) {
out += ({
"_": " ",
"t": "t",
"n": "n",
"r": "r",
"f": "f",
"b": "b"
})[string[s]] || string[s];
b = 0;
continue;
}
if (string[s] == "\") {
b = 1;
continue;
}
out += string[s];
}
return out;
};
var r;
for (r = 0; r < rows.length; r++)
pointers.set(rows[r].split(" ")[0], r);
var row, old;
for (r = 0; r < rows.length; r++) {
row = rows[r].split(" ");
old = r;
if (row[1] == "Goto" && pointers.has(row[2] || ""))
out.unshift(row[2] || ""), r = pointers.get(row[2] || "") - 1, back.unshift(r + 1);
if (row[1] == "GotoFrom" && pointers.has(variables.has(row[2] || "") ? variables.get(row[2] || "") : ""))
out.unshift(variables.has(row[2] || "") ? variables.get(row[2] || "") : ""), r = pointers.get(variables.has(row[2] || "") ? variables.get(row[2] || "") : "") - 1, back.unshift(r + 1);
if (row[1] == "GoBack")
r = (back.length < 2 ? 0 : back[1]) - 1, back.shift();
if (row[1] == "If" && (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") == "")
r++;
if (row[1] == "IfNot" && (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") != "")
r++;
if (row[1] == "Match")
variables.set(row[2] || "", match(variables.has(row[2] || "") ? variables.get(row[2] || "") : "", row[3] || ""));
if (row[1] == "OutsideMatch")
variables.set(row[2] || "", outside_match(variables.has(row[2] || "") ? variables.get(row[2] || "") : "", row[3] || ""));
if (row[1] == "Skip")
r++;
if (row[1] == "Assign")
variables.set(row[2] || "", row[3] || "");
if (row[1] == "Copy")
variables.set(row[2] || "", variables.has(row[3] || "") ? variables.get(row[3] || "") : "");
if (row[1] == "ConcatString")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + (row[3] || ""));
if (row[1] == "Tail")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "").slice(1));
if (row[1] == "Reverse")
variables.set(row[2] || "", [...(variables.has(row[2] || "") ? variables.get(row[2] || "") : "")].reverse().join(""));
if (row[1] == "Concat")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + (variables.has(row[3] || "") ? variables.get(row[3] || "") : ""));
if (row[1] == "\_")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + " ");
if (row[1] == "\t")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + "t");
if (row[1] == "\n")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + "n");
if (row[1] == "\r")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + "r");
if (row[1] == "\f")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + "f");
if (row[1] == "\b")
variables.set(row[2] || "", (variables.has(row[2] || "") ? variables.get(row[2] || "") : "") + "b");
if (row[1] == "Input")
variables.set(row[2] || "", input || "");
if (row[1] == "PrintString")
out.unshift(row[2] || "");
if (row[1] == "Print")
out.unshift(variables.has(row[2] || "") ? variables.get(row[2] || "") : "");
pointers.set(row[0], old);
if (!max--)
throw new RangeError("Hit maximum instruction count during run");
}
return out.map(parse).reverse().join("");
};
(() => {
var main = document.getElementById("main");
var input_0 = document.getElementById("input_0");
var input_1 = document.getElementById("input_1");
var input_2 = document.getElementById("input_2");
input_0.oninput = () => {
main.removeAttribute("data-thrown");
try {
var output = interpret(input_0.value, input_1.value, 200);
input_2.value = output;
input_2.rows = (output.match(/rn|n|r/g) || []).length + 1;
} catch (info) {
main.setAttribute("data-thrown", "");
throw info;
}
};
input_1.oninput = () => {
input_0.oninput();
input_1.rows = (input_1.value.match(/rn|n|r/g) || []).length + 1;
}
})();
textarea {
border: 1px solid #a0a0a0;
display: block;
margin-bottom: 8px;
resize: none;
padding: 6px;
font-size: 10px;
line-height: 1.25;
}
textarea:focus {
border: 1px solid #a0d0f0;
outline: 1px solid #a0d0f0;
}
#main[data-thrown] textarea:focus {
border: 1px solid #f09e9e;
outline: 1px solid #f09e9e;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Goto Output</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
</head>
<body>
<section id="main">
<textarea id="input_0" rows="10" cols="80"></textarea>
<textarea id="input_1" rows="1" cols="80"></textarea>
<textarea id="input_2" rows="1" cols="80" readonly></textarea>
</section>
</body>
</html>
Answered by Bot_01 on November 21, 2021
DO;1<-#13DO;1SUB#1<-#29DO;1SUB#2<-#1100DO;1SUB#3<-#249DO;1SUB#4<-#255DO;1SUB#5<-#250DO;1SUB#6<-#677DO;1SUB#7<-#373DO;1SUB#8<-#4160DO;1SUB#9<-#570DO;1SUB#10<-#2572DO;1SUB#11<-#225DO;1SUB#12<-#247DO;1SUB#13<-#348DOREADOUT;1
How I generated the code above.
There is other "Hello, World!" program that uses a tail array, but it has 278 bytes when I do these:
I think this is the only site that you can try CLC-INTERCAL online.
Edit. As of 1.-94.-2, politeness is not checked, unlike INTERCAL-72 and CLC-INTERCAL.
Answered by nrgmsbki4spot1 on November 21, 2021
aaaac018gxnaaaaac020agxaaaaaaagxgxaaagxnaaaac008gxbbc004bgxbbbbbbbbgxaaagxbbbbbbgxbbbbbbbbgx
Obviously not the shortest answer by a mile but for me its fine.
Now how does this work
aaaac018gxn H --> 72
aaaaac020agx E --> 101
aaaaaaagx L --> 108
gx L --> 108
aaagxn O --> 111
aaaac008gx SPACE ---> 32
bbc004bgx W --> 119
bbbbbbbbgx O --> 111
aaagx R --> 114
bbbbbbgx L --> 108
bbbbbbbbgx D --> 100
For reference a
inc accumulator by 1, b
decs by 1
and c is for multiplication
g
converts to ASCII and x
prints
(I do have an interpreter, clicking the link leads to it but you are gonna have to test it yourself)
NOTE : language is WIP
Answered by Eternal Student on November 21, 2021
x++++++++++++++++++++++++++++++++:+:+++++++++++:++++++++++++++++++++++++++++:.+++++++++++++++:++++++++++++++:.+++++++:::..+++:.{{{.{.{{.}}.:++++++.:.--------..;
Tarfish is an esolang of mine that is a more tarpit-style version of ><>. This answer doesn't really use that much of its 2D features, but it works.
Note: a single +
or -
means multiple, I'll specify how many. After each line is a visualisation of the stack as characters.
x # Push a 0 - [0]
+ # Increment to 32 - ' '
:+ # Duplicate and increment - ' !'
:+ # Duplicate and increment to 44 - ' !,'
:+ # Duplicate and increment to 71 - ' !,H'
:. # Duplicate and output - ' !,H'
+: # Increment to 87 and duplicate - ' !,WW'
+:. # Increment to 101, duplicate and output - ' !,We'
+:::.. # Increment to 108, quadruple and output twice - ' !,Wll'
+:. # Increment to 111, duplicate and output - ' !,Wlo'
{{{. # Cycle right three times to the comma and output - 'Wlo !'
{. # Cycle right once to the space and output - '!Wlo'
{{. # Cycle right twice to the W and output - 'lo!'
}}. # Cycle left twice to the o and output - '!l'
:+. # Duplicate, increment to 114 and output - '!l'
:.- # Duplicate, output, and decrement to 100 - '!d'
..; # Output twice and halt
No TIO yet.
Answered by emanresu A on November 21, 2021
New solution uses the Carriage Return escape character 'r', saving 1 more byte:
[]="r!dlroW ,olleH".$<[[0]--]._^![0].C=0.
Thanks to @stasoid for the incidental? realization!
With whitespace and comments:
[] = "r!dlroW ,olleH". ; Insert the value 13, and "Hello, World!" backwards,
into memory starting from index 0
$< [[0]--]. ; Prints the value at the index stored at index 0 as unicode,
and decrements index 0
_^ ![0]. ; Skip the next statement if index 0 is 0
C = 0. ; Sets the program counter to 0, which advances to 1 afterwards
Previous solutions prepended the string with 13...
[]=13&"!dlroW ,olleH".$<[[0]--]._^![0].C=0.
... or used ASCII escape character 0xD (CR) in the string:
[]="x0D!dlroW ,olleH".$<[[0]--]._^![0].C=0.
Answered by Christian Alexander on November 21, 2021
void setup(){Serial.begin(300);Serial.print("Hello, World!");}void loop(){}
Although Arduino does have println()
, the challenge said the newline is optional, and print()
is shorter.
Answered by Bbrk24 on November 21, 2021
吾有一言。曰「「Hello, World!」」。書之。
Try it Online! (Online interpreter/IDE, I don't think there's a way to share code directly but just copy and paste into the editor and press Run)
For the "Hello, World!" in Classical Chinese example wenyan-lang themselves give (60 bytes):
吾有一言。曰「「問天地好在。」」。書之。
Answered by LittleWhole on November 21, 2021
Answered by PyGamer0 on November 21, 2021
." Hello, World!"
Answered by user105238 on November 21, 2021
Hello, World!
returns Hello, World!
This is a fairly new esolang, but it works for golfing.
Answered by K-Dub1234 on November 21, 2021
++++<!.+aa.--------.------.+++.d.-d.------------.++++++++++++aa.+++..+++++++.---w.dd]-sa-a+w+d]-ds+a+++a+++w++d[++++d
I've finished my new language, called brainbox! It's a 2D extension of brainfuck, with a 2D grid for the code and a 2D grid for the memory. This program is a modification of the "Hello World!" program in brainfuck found on esolangs.org. I used a few features to shorten it:
Instead of using ++++++++
to set the first cell to 8, I used ++++<
, which is 3 bytes shorter and changes the IP direction to the left.
I made use of the 2D memory space in order to reduce the number of commands needed to move the memory pointer around.
I also used an unmatched ]
to loop execution back to (0,0)
. This doesn't actually save any bytes here, but I wanted to show off that feature.
For more information on the language and some of the features and quirks, check out the GitHub repo.
Answered by Aaroneous Miller on November 21, 2021
Assembly:
.section .text
.global _main
.thumb
_main:
mov r7, #4 // 2704 syscall #4 (write)
mov r0, #1 // 2001 fd #1 = stdout
add r1, pc, #8 // a102 string address = (pc+4) + 8 (msg)
mov r2, #13 // 220d string length = 13
svc #0 // df00 write(1, msg, 13)
mov r7, #1 // 2701 syscall #1 (exit)
mov r0, #0 // 2000 exit code 0
svc #0 // df00 exit(0)
msg: .ascii "Hello, World!" // 13 bytes, without trailing newline
How to run this on Ubuntu:
sudo apt-get install qemu-user qemu-user-static build-essential gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf binutils-arm-linux-gnueabihf-dbg
# build and run as Thumb executable
arm-linux-gnueabihf-as main.as -o main.o
arm-linux-gnueabihf-ld --thumb-entry=_main main.o -o main
qemu-arm -L /usr/arm-linux-gnueabihf ./main
# see disassembly and calculate machine code size
arm-linux-gnueabihf-objdump -d main
Most parts of the instructions and the code structure are from this guide. A full Thumb instruction set reference can be found in this pdf, but I couldn't find any easier-to-lookup reference.
.section .text
.global _main
.thumb
_main:
mov r7, #4 // 2704 syscall #4 (write)
mov r0, #1 // 2001 fd #1 = stdout
add r1, pc, #4 // a102 string address = (pc+4) + 4 (msg)
mov r2, #13 // 220d string length = 13
svc #0 // df00 syscall
nop // 46c0 for 4-byte alignment of msg
msg: .ascii "Hello, World!"
While it is possible to call puts
and similar by dynamically linking to libc
, I don't think it's fair to discount the glue code generated by the linker (single puts
call adds 36 bytes as section .plt
).
Answered by Bubbler on November 21, 2021
Hello, World!
Regenerate is my new regex-match-generation language. The hello world program is pretty simple: just the literal string as a regex, with the !
escaped because it's a metacharacter.
Answered by DLosc on November 21, 2021
Note that this is NOT Braincrash; this is also a Brainfuck-variant, with these expansions:
Hello, world!
.Here is the program:
>>>>>>^<<<<<<<
^
is mem[ptr+1]=mem[ptr] xor mem[ptr+1]; ptr++;
; to change w
with W
.[.>]
Try it online! The interpreter was originally written by "ぬこ", the designer of the language; I modified a bit for TIO.
Answered by nrgmsbki4spot1 on November 21, 2021
[;[Hello, World!]]
explanation:
[; - print the following values, stringified, and joined.
[Hello, World!] - an array containing ['H', 'e', 'l', ...]
]
Answered by Pro Odermonicon on November 21, 2021
All of these answers are pretty boring (one is a built-in and the string compression algorithm isn't even my own); consider upvoting some cool answers in tarpits / esolangs rather than this one. I'm just putting it here to have yuno officially be a language on CGCC, and because Hello, World! is a good entry point for any language.
ᴋ
By default, if the k-literal digraph finds no character after it, it just uses H
, because I haven't thought of a good behavior for it otherwise so I may as well save bytes on Hello World.
ᴋH
Try it online! Uses the built-in string nilad digraph (inspired by Vyxal).
“3ԸaϨ;ψ»
Try it online! Uses a compressed string with the exact same compression algorithm that Jelly uses.
“Hello, World!”
Try it online! A default string. As caird coinheringaahing points out, the trailing ”
can be removed if it occurs at the end of the program.
Answered by hyper-neutrino on November 21, 2021
xxd:
00000000: 4d5a 0000 5045 0000 4c01 0100 0000 0000 MZ..PE..L.......
00000010: 0000 0000 0000 0000 7000 0301 0b01 0000 ........p.......
00000020: 0000 0000 0000 0000 0000 0000 b400 0000 ................
00000030: 0000 0000 0000 0000 0000 4000 0400 0000 ..........@.....
00000040: 0400 0000 0000 0000 0000 0000 0400 0000 ................
00000050: 0000 0000 0004 0000 0100 0000 0000 0000 ................
00000060: 0300 0000 0000 0000 0000 0000 0000 0000 ................
00000070: 0000 0000 0000 0000 0200 0000 0000 0000 ................
00000080: 0000 0000 e600 0000 0000 0000 2e74 6578 .............tex
00000090: 7400 0000 4600 0000 b400 0000 4600 0000 t...F.......F...
000000a0: b400 0000 0000 0000 0000 0000 0000 0000 ................
000000b0: 0000 0000 68c5 0040 00ff 15da 0040 00ff ....h..@.....@..
000000c0: 15de 0040 0048 656c 6c6f 2c20 576f 726c [email protected], Worl
000000d0: 6421 0063 7274 646c 6c00 bb01 0080 6701 d!.crtdll.....g.
000000e0: 0080 0000 0000 0000 0000 0000 0000 0000 ................
000000f0: 0000 d300 0000 da00 0000 0000 0000 0000 ................
00000100: 0000 0000 0000 0000 0000 0000 ............
source:
; nasm
BITS 32
base equ 0x400000
;
; DOS header
;
; The only two fields that matter are e_magic and e_lfanew
mzhdr:
dw "MZ" ; DOS e_magic
dw 0
;
; NT headers
;
dd "PE" ; PE signature
;
; NT file header
;
filehdr:
dw 0x014C ; Machine (Intel 386)
dw 1 ; NumberOfSections
dd 0 ; TimeDateStamp UNUSED
dd 0 ; PointerToSymbolTable UNUSED
dd 0 ; NumberOfSymbols UNUSED
dw opthdrsize ; SizeOfOptionalHeader
dw 0x103 ; Characteristics
;
; NT optional header
;
opthdr:
dw 0x10B ; Magic (PE32)
db 0 ; MajorLinkerVersion UNUSED
db 0 ; MinorLinkerVersion UNUSED
dd 0 ; SizeOfCode UNUSED
dd 0 ; SizeOfInitializedData UNUSED
dd 0 ; SizeOfUninitializedData UNUSED
dd start ; AddressOfEntryPoint
dd 0 ; BaseOfCode UNUSED
dd 0 ; BaseOfData UNUSED
dd base ; ImageBase
dd 4 ; DOS e_lfanew ; SectionAlignment
dd 4 ; FileAlignment
dw 0 ; MajorOperatingSystemVersion UNUSED
dw 0 ; MinorOperatingSystemVersion UNUSED
dw 0 ; MajorImageVersion UNUSED
dw 0 ; MinorImageVersion UNUSED
dw 4 ; MajorSubsystemVersion
dw 0 ; MinorSubsystemVersion UNUSED
dd 0 ; Win32VersionValue UNUSED
dd 1024 ; SizeOfImage
dd 1 ; SizeOfHeaders nonzero for Windows XP
dd 0 ; CheckSum UNUSED
dw 3 ; Subsystem (Console)
dw 0 ; DllCharacteristics UNUSED
dd 0 ; SizeOfStackReserve
dd 0 ; SizeOfStackCommit
dd 0 ; SizeOfHeapReserve
dd 0 ; SizeOfHeapCommit UNUSED
dd 0 ; LoaderFlags UNUSED
dd 2 ; NumberOfRvaAndSizes for Windows 10; UNUSED in Windows XP
;
; Data directories (part of optional header)
;
dd 0, 0 ; Export Table UNUSED
dd idata, 0 ; Import Table
opthdrsize equ $ - opthdr
;
; Code section header
;
db ".text", 0, 0, 0 ; Name
dd codesize ; VirtualSize
dd code ; VirtualAddress
dd codesize ; SizeOfRawData
dd code ; PointerToRawData
dd 0 ; PointerToRelocations UNUSED
dd 0 ; PointerToLinenumbers UNUSED
dw 0 ; NumberOfRelocations UNUSED
dw 0 ; NumberOfLinenumbers UNUSED
dd 0 ; Characteristics UNUSED
;
; Code section data
;
align 4, db 0
code:
;
; Entry point
;
start:
push base + msg
call [base + puts]
call [base + exit]
msg:
db "Hello, World!",0
crt:
db "crtdll",0
;
; Import address table (array of IMAGE_THUNK_DATA structures)
;
iat:
puts: dd 0x800001BB ; Import puts by ordinal
exit: dd 0x80000167 ; Import exit by ordinal
dd 0 ; terminator
;
; Import table (array of IMAGE_IMPORT_DESCRIPTOR structures)
;
idata:
dd 0 ; OriginalFirstThunk UNUSED
dd 0 ; TimeDateStamp UNUSED
dd 0 ; ForwarderChain UNUSED
dd crt ; Name
dd iat ; FirstThunk
; terminator
; times 5 dd 0 ; too big, padding serves as terminator
codesize equ $ - code
;
; Padding for Windows 10
;
times 268 - ($-$$) db 0
Previous PE answer: 1175 bytes.
This program was tested on Windows 10 2004 64-bit and Windows XP SP3.
The answer is based on this article, which creates the smallest PE file on Windows XP. I took the smallest file that works on Windows 10 from tinype.zip, which is tiny.296, and added imports using tiny.import.209. Other useful articles: one two.
Quirks:
Windows 10:
codesize
includes importsWindows XP:
NumberOfRvaAndSizes
, it's not a problem because Debug Directory size happens to be 0
(Characteristics
field of .text
section header) (link)SizeOfHeaders
must be nonzeroI think 268 = 4 + 264, where 4 is the minimal offset of NT headers from the start of the file
and 264 is the minimal distance between the start of NT headers and
end of file. 264 is probably sizeof(IMAGE_NT_HEADERS32)+16
or sizeof(IMAGE_NT_HEADERS64)
.
Because Windows 10 imposes hard limit on minimal PE size, there is no need to cram section header, code and imports
into NT headers.
Of the four CRT libraries that are available on both XP and 10 (crtdll.dll, msvcrt.dll, msvcrt20.dll, msvcrt40.dll), I use crtdll.dll because it has a shorter name and has not been updated since 1995, so (it feels like) it's safe to import by ordinals from it. There is no big problem to import by names, but then those names must be inside headers, which is a bit messier.
The program sometimes hangs if puts
is imported and ret
is used to exit the program (this is true for both crtdll and msvcrt),
so I use exit
.
Answered by stasoid on November 21, 2021
€ââââäââââââââæėâââââäęęęęęęęęęęęęęęęęęęęęęęęęæėâââââäęęęęęęęęęęęęęęęęęæėâââââäęęęęęęęęęęęęęęęęęæėâââââäęęęęęęęęęęęęęęæėâââäâââââââââââââââââæėââââââââââåæėââââäâââââââââââââââââââââââæėâââââäęęęęęęęęęęęęęęæėâââââäęęęęęęęęęęęæėâââââäęęęęęęęęęęęęęęęęęæėâââââäęęęęęęęęęęęęęęęęęęęęęęęęęæ
I've added newlines to clarify which is which:
€ < € is required here
ââââäââââââââæ < H
ėâââââäęęęęęęęęęęęęęęęęęęęęęęęęæ < e
ėâââââäęęęęęęęęęęęęęęęęęæ < l
ėâââââäęęęęęęęęęęęęęęęęęæ < l
ėâââââäęęęęęęęęęęęęęęæ < o
ėâââäâââââââââââââââââæ < ,
ėââââââââââåæ < [space]
ėââââäâââââââââââââââââââââââæ < W
ėâââââäęęęęęęęęęęęęęęæ < o
ėâââââäęęęęęęęęęęęæ < r
ėâââââäęęęęęęęęęęęęęęęęęæ < l
ėâââââäęęęęęęęęęęęęęęęęęęęęęęęęęæ < d
æae is a language that I made and am implementing as practice for CBL. Github: https://github.com/SMARNAV/aeae/
Answered by smarnav on November 21, 2021
This answer doesn't meet the technical restrictions, because P'' has no I/O, but I think it hasn't been done yet.
+[-->-[>>+>-----<<]<--<---]>->>>+>>+++[>]<<<<+++------<<->>>>+
It is just the shortest known BF answer, but without the I/O, which makes sense, given BF is a derivative of P'' with I/O. Has no output, so an online interpreter won't do much, but just use the TIO BF interpreter to check it doesn't error.
Answered by 4D4850 on November 21, 2021
Just something I thought of :D
/tellraw @a {"text":"Hello, World!"}
I can't find a try it online for these though
Answered by TKDKid1000 on November 21, 2021
22+222]+]2:+1+:++!:++2:+*+1+0+[-*-*+02]+]2{*+++**+}+0!:+*+1+0+:+*+1+!!:+++0+0+:+0+0+0!{*++1+0+]+]+]+]+]+]+]+]+]+]+]+]+]+]+]+]
This is a new language made by @Redwolf Programs. My explanation wouldn't do it justice so heres the Docs.
Takes the various codepoints for various characters and links them together.
Redwolf also created a version of it which is a simpler "tree" layout, which also comes in at 64 bytes:
**}+1+1!0+:+0+1+0+:+0++!0+:+0+++0+:+!++!{**+0+{+!**+0+2!+**+0+}+0+:+!++!:+*+0+{+0+:+0++!0+0+0+:+!**+0+!20+0+0+]+0+0+0+]+0+0+0+]
Answered by Underslash on November 21, 2021
Answered by astroide on November 21, 2021
(uses Windows-1252 encoding)
!"#$%&()*+,-0123456789:;<=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“|””>!”••!"•––"#–˜˜#%˜™™%&™››&)›žž)+ž¡¡+-¡¢¢-0¢¥¥03¥¦¦34¦§§45§ªª58ª8;®®;<®¯¯<=¯²²=A²µµADµººDIº½½IL½¾¾LM¾¿¿MN¿ÂÂNQÂÄÄQSÄÅÅSTÅÆÆTUÆÇÇUVÇÈÈVWÈÉÉWXÉÊÊXYÊÌÌY[ÌÍÍ[]ÍÑÑ]aÑÓÓacÓÕÕceÕÚÚejÚÝÝjmÝÞÞmnÞàànpàáápqáååquåææuv/\>//æççvwçêêwzêííz~íîî~€îïïññ‚„ñòò„…òõõ…ˆõ÷÷ˆŠ÷øøŠ‹øùù‹ŒùúúŒŽúüüŽ’üýý’“ý——>$—šš$(šœœ(*œŸŸ*,Ÿ££,1£¤¤12¤¨¨26¨©©67©««79«¬¬9:¬°°:?°±±?@±³³@B³´´BC´¶¶CE¶··EF·¸¸FG¸¹¹GH¹»»HJ»¼¼JK¼ÀÀKOÀÁÁOPÁÃÃPRÃËËRZËÎÎZ^ÎÏÏ^_ÏÐÐ_`ÐÒÒ`bÒÔÔbdÔÖÖdfÖ××fg×ØØghØÙÙhiÙÛÛikÛÜÜklÜßßloßââorâããrsãäästäèètxèééxyéëëy{ëìì{}ìðð}ƒðóóƒ†óôô†‡ôöö‡‰öûû‰‘û“‘||
I used shortstring.pl
from Incident distro to generate the program, and then replaced all two-byte tokens with single-byte ones and removed separators.
Answered by stasoid on November 21, 2021
.print/"Hello, World!"
Answered by name on November 21, 2021
proclaim("Hello, World!")
Whilst I hath already posteth a "FizzBuzz" program, being the absolute jester I am, I forgoteth to proclaim "Hello, World!" first.
Being themed upon ye olde medieval times, one does not simply "print" in Squire. One must proclaim.
Answered by EasyasPi on November 21, 2021
>*2+00210v
^<0210<2`<
Hello, World!
Explanation:
The code is essentially a for loop; A counter increments, a character is then read from code. The program exits if this is 0 (end of line), or continues printing.
Answered by Robot on November 21, 2021
[8+]cpar2[5+]cpa[7+]cpacpa+++cpa [8+]cpar2[15+]cpa+++cpar2[12+]cpar2++++cpa
Answered by name on November 21, 2021
Answered by Sakon on November 21, 2021
(println "Hello, World!")
This is an implementation of a Lisp invented by Daniel Holden in his book.
Answered by sysgrammer on November 21, 2021
O"Hello, World!"
Knight is a language made up by some people on my Discord back in April 2021, which is designed to be portable to various programming languages.
O
is shorthand for OUTPUT
, which prints the first argument.
I think you can figure out the rest.
Answered by EasyasPi on November 21, 2021
12 -1 13
1 0 6
3 2 -1
11 11 0
72 101 108 108 111 44 32
87 111 114 108 100 33
This is shorter than the other "Hello, World" samples I have seen online.
0: 12 -1 13 'Output 12:; 2: is used as a countdown
3: 1 0 6 '0: = 0: + 1; move to the next character
6: 3 2 -1 '2: = 2: - 1, if 2: <= 0 then exit
9: 11 11 0 '11: = 0, goto 0
12: 72 101 108 108 111 44 32 '12: "Hello, "
19: 87 111 114 108 100 33 '19: "World!"
Answered by Axuary on November 21, 2021
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
??????????
EmojiCoder is a funny language!
? represents binary 0 and ? binary 1. We construct the binary numbers of ASCII codepoints in Hello, World!
, then pass it to ?, which is a modifier automatically casting the binary number to decimal base and get its ASCII character and ? pushes it to stack, Later stack is implicitly outputted.
Answered by wasif on November 21, 2021
Answered by wasif on November 21, 2021
-exxxd !dlroW ,olleH
x xx
x xxxxc
x
x x bx x
x xx xx x
xx x xxxxx
xx ax
x x
x xxxx
xx
This answer is based on the excellent John's Wierd answer by Dennis.
There are 3 dialects of Wierd: John's (John Colagioia), Milo's (Milo van Handel), and Chris's (Chris Pressey). Chris Pressey presents his JavaScript interpreter as an alternative implementation of John's Wierd, but in fact it is a completely separate dialect no less different from John's Wierd than Milo's Wierd.
Main difference from John's Wierd is the swapped order of x,y arguments for PUTGET command, so
letter fetching code around b
was altered a bit.
Another difference is the IF command. Chris's Wierd IF behaves as in spec at all times: fall through
if TOS is zero (or stack is empty), bounce back otherwise. So before IF at a
we need to place 0
on stack with SUB (45° right turn). Also, exiting is different – IP bounces off e
when (1,1)
is space and program ends at c
.
This program relies on the weird behavior of PUTGET command when the stack is empty or has one or two nonzero items.
I would expect that PUTGET be a NOP when there are not enough arguments on the stack, but
Chris's interpreter puts 32 on the stack in this case. This happens at d
and (1,1). This is important for proper exiting.
Wierd commands:
Answered by stasoid on November 21, 2021
」オ
No TIO link unfortunately, because I'm not good at setting this sort of stuff up and I don't want to accidentally make my server insecure (especially since I'm sharing it with a friend). You can clone the repository from the link in the header though. I promise I did not intentionally code malware. I can't guarantee nothing weird will happen though because I suck at coding, only that I don't have malicious intent.
This language is in its very early stages. It has very few things implemented right now, but it exists and by posting an answer and publicizing it maybe it'll force me to actually write it instead of giving up like half of my other language ideas so far, lol.
Since オ
is a string terminator, it's not mapped to anything in the normal string system, and therefore when represented as a single character, I special-cased it to Hello, World
. 」
ends a string normally, but like in Jelly, when used without an open quote, it acts as a character literal, but in this case, it maps its codepage to latin characters.
A non-built-in solution would be 「Hello、 Wリョld!
(the 」
can be ommitted), based on how character mapping works.
The built-in can be written as ]o
as well. The non-built-in can be written as [H_e_l_l_o, Wryo_l_d!
.
Note: the non-built-in, despite looking like 14 characters (bytes in an SBCS), is actually 13 (you could use 「Hello、 World!
for 14). This is because リョ is a single token and, if you read the code in binary, is mapped to one byte. You can read more about this on the wiki, which also mentions where to find the exact codepage in the repository. There are some three-byte tokens like ッキョ. You can check how many bytes a program is using the c
flag or format it into a CGCC submission using the C
flag.
No, I don't have a good explanation for why I used katakana as my codepage. Yes, you can use hiragana as well. If you call me a weeb I will 11 you. That is all.
Answered by hyper-neutrino on November 21, 2021
Answered by wasif on November 21, 2021
-bnn
, 710 bytes(){}[(){}[(){}[(){}[(){}[(){}[(){}[(){}(<[{<({}){}>}{<({})({}){}>}][{<({})({}){}>}{<({}){}>}]>)((((<><<>()>[{<({}){}>}<{<({}){}>}{<({})({})({})({}){}>}>])[<><<>()>]{<({})({})({})({})({})({}){}>}))[<><<>()>]{<({})({}){}>})](<{<({})({})({}){}>}[<><<>()><{<({}){}>}{<({})({})({})({}){}>}>]>)]({<({})({})({})({}){}>}{<({}){}>})](<{<({})({}){}>}[<><<>()><{<({})({})({}){}>}{<({})({})({})({})({})({}){}>}>]>)](([{<({}){}>}<{<({}){}>}{<({})({})({})({}){}>}>][<><<>()>][<><<>()>[<{<({}){}>}{<({})({})({})({}){}>}>]])[<><<>()>]{<({})({}){}>})]([{<({}){}>}<{<({}){}>}{<({})({})({})({}){}>}>][<><<>()>][{<({})({}){}>}{<({}){}>}])]({<({}){}>}<{<({}){}>}{<({})({})({})({}){}>}>)](<><<>()>[{<({})({})({})({}){}>}{<({}){}>}])
Try it on the online Flurry interpreter!
Answered by hyper-neutrino on November 21, 2021
**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
** * ** * ** * * * * ** * * * ** * * * ** *** * * * * ** ** *** ** * * * *** ** * * ** * ** * ** *** * * * * ** *** * * * * * * * * * * * * ** * ** *** * * ** * * * ** * ** * * * ** ** * * * ** * * * * ** * * * * ** ** * * * * * * *
* * * * * * * * * ** ** * * * * * * ** * * * * ** ** ** * * ** ** * * * * * ** * *** * * * * ** * * *** ** * * * ** * * * * *** ** * * * * * * ** * ** * ** * * * *** ** * * * * * * ** * ** **
*** * * ** * * * ** * * ** * * ** * * * * * ** * ** ** *** ** ** * * * * * ** * * * ** ** * ** * * ** ** * ** * * * *** ** ** * ** ** * * ** * * * ** * * ** * * ** ** * ** ** * ** * * *
*** ** * * * ** * * * * * * ** * ** * ** ** ******* * * * ***** ** * ***** ** * * ****** *** * ***** * * * ** * ***** * * * ** ** * * * * * ***** *** ** * * * ********* *** * **** ** * *** * * * * * * ********* * ***** * * *** **** *** ***** ** * * * * ***
**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
Try it online! (heh, line wrapping makes it look wierd)
Automatically generated by this program, with some golfing (manual + golf.rb).
It is very hard to program in 1L_a, so I use generator. Generator creates cells, each cell prints one bit. It iterates through all possible cells with height 6 and no more than 5 inner asterisks to find a cell that prints the needed bit. Generator fails if height is less than 6 or max asterisk count is less than 5.
This is an ungolfed version with cells visible (13*8 = 104 cells):
****** ****** ****** ***** ****** ****** **** **** ****** ***** **** ****** ***** ***** ****** **** ****** ******* ***** ****** ***** **** ****** **** ****** ***** **** ****** ***** **** ******* **** ****** ***** **** ****** ***** ***** **** ***** ******* ***** ***** ****** ***** **** ****** **** ****** ****** ***** ****** **** ******* **** **** ****** ****** **** ******* ***** ****** ****** **** ******* ***** **** ****** ***** ***** **** **** ****** ******* ***** **** ******* ***** ***** ****** ***** ***** ***** ****** **** ****** **** ******* ***** ****** **** ***** **** ******* ***** ****** **** ****** **** ******* **** **** ****** *****
** * * ** * * * * * * * * * * * * ** * ** * * ** * * ** * * * ** * * * ** * ** ** * * * * * * * ** * ** * ** ** * ** * * * * * * *** * ** * * * * * ** * * ** ** * ** * ** ** * * * * * * * ** * ** ** * * * * * * * * * * * * * * * * * * * * * ** * * ** * ** ** * * * * * ** * * * ** * * * ** * * * ** ** * ** * * ** * ** ** * ** * * * * * ** * * * ** * * * ** * * * * * * * * ** * * ** * * * * * * * * * * **
* * * * * * * * * * * ** * * * ** * * ** * * * ** * * * * * * ** * * * * ** * * * * * * * * ** * ** * ** * * * * * ** * ** * * * * * * * * * * * ** * * ** ** * * * * * * * * ** * * * *** * ** * * * * ** * * * ** * * * * * * * * *** * ** * * * * * * * ** * * * * ** * * ** * ** * * ** ** * * * * * *** * * * * * ** * * * * * * * * * * * ** * * * ** * **
*** * * * ** * * ** ** * * * * ** * ** * ** * * ** * * *** ** * * * ** * * * * * * * * * * * ** * * * * ** ** * ** ** * ** ** * * * * ** * * * * * ** * * * * * * * * ** * ** * * * * * ** * * * ** * * ** * * * ** * * * * * * ** ** * ** ** * ** * * *** * ** * * ** * * ** * * * * ** * * ** * * * ** ** * * * * * ** * * ** * * ** * * ** * ** * * * * * *
* ** * ** * * * ** * ** * ** * * * * * * * * * * * ** * * * *** * * ** * * * ** * ** ** *** ***** * * * * * * ***** * * ** * * ***** * ** * * * ** **** ** ** ** * * * **** ** * * * * ** * * ** * * ***** * * * * * * ** ** * * * * * ** * * * * ** **** * ** ** ** * * * * * * * ***** **** ** ** ** * * * **** * ** * * * ** ** * * * * * * ** * * * * ** * ***** *** * ** ** * ** **** * * * ** * * *** * **** * ** ** * **** ** ** * * * * * * * * *****
****** ****** ****** ***** ****** ****** **** **** ****** ***** **** ****** ***** ***** ****** **** ****** ******* ***** ****** ***** **** ****** **** ****** ***** **** ****** ***** **** ******* **** ****** ***** **** ****** ***** ***** **** ***** ******* ***** ***** ****** ***** **** ****** **** ****** ****** ***** ****** **** ******* **** **** ****** ****** **** ******* ***** ****** ****** **** ******* ***** **** ****** ***** ***** **** **** ****** ******* ***** **** ******* ***** ***** ****** ***** ***** ***** ****** **** ****** **** ******* ***** ****** **** ***** **** ******* ***** ****** **** ****** **** ******* **** **** ****** *****
See also 1L_a answer to "Add a language to a polyglot" challenge.
Answered by stasoid on November 21, 2021
Answered by Aaroneous Miller on November 21, 2021
Answered by Caleb Fuller on November 21, 2021
printLine("Hello, World!")
PPL is a programming language made by me. This technically does not fall into the category of "standard loophole", because this was not made to be a golfing language (easily deduced from the program, which uses printLine
, if it were a golfing language I would call the function p
.)
The function printLine
simply takes any expression and outputs it to STDOUT. Also, as a sidenote, PPL
stands for Primitive Programming Language
; it is not yet Turing-complete.
To run a PPL program, install the NPM package, then require it and call run
with the sole argument being the program string (no documentation yet.)
Answered by user100690 on November 21, 2021
print: "Hello, World!"
Answered by wasif on November 21, 2021
;H;e;l;l;o;,; ;W;o;r;l;d;!(")
Introducing Yggdrasil! This is a self-modify esolang based on binary trees. The program and it's memory model are both mapped to the same binary tree, then executed on that same tree. For example, this program is mapped to
;
/
; H
/
; e
/
; l
/
; l
/
; o
/
; ,
/
; ␠
/
; W
/
; o
/
; r
/
; l
/
; d
/
( !
The ;
command takes the next 2 tokens and forms a binary branch from them. All the other symbols in the tree are no-ops, they just set the value of that leaf to their Unicode code point. You'll note that ")
are not nodes in the tree. Yggdrasil ignores any trailing symbols that don't fit into the tree.
Once we've established our memory tree, we then begin executing the code, character by character. ;H;e;l;l;o;,; ;W;o;r;l;d;!
all have absolutely no effect, so the pointer remains at the program root (the first ;
). We then find a "traversal", bounded by (...)
. This takes the code inside the brackets and runs it over each node in the tree that has arguments (i.e. is not a leaf). The code here is just "
(output right node as character), so the program goes to each ;
and outputs it's right node as a character.
Answered by caird coinheringaahing on November 21, 2021
CASL II is an assembly language for COMET II, the fictional architecture. It is designed for Japan Information-Technology Engineers Examination.
I've found a way to specify a literal instead of an address:
A START
OUT ='Hello, World!',=13
RET
END
Z START
OUT A,B
RET
A DC 'Hello, World!'
B DC 13
END
Answered by nrgmsbki4spot1 on November 21, 2021
72.101.108Z..111O.44.32.87.o.114.z.100.33.
Try it on the online Branch interpreter!
Each number sets the value of the current node to that. .
outputs as a character. N-Z
set a numerical register and n-z
set the value to the value of that register. I won't give a character-by-character analysis; this basically just loads each value and outputs it, using registers to save some bytes. It's not a particularly interesting solution.
Answered by hyper-neutrino on November 21, 2021
00010000 00100000 00100000 00100000 00010000 00100000 00100000 00100000 00110000 00010010 00100010 00100010 00010010 00100010 00010010 00100010 00100010 01000001 00010000 00110000 00010100 00100100 00100100 00100100 00010100 01000010 00110000 00110000 00010000 00010000 00010000 00110000 00110010 00010110 00100110 00100110 00100110 00100110 01100011 00100110 00110110 00010100 00010100 00010100 00100100 01010000 00110100 00110000 00010000 00010000 00010000 00110000 00010100 00010100 00010100 00010100 00010100 01010100 00110100 00011010 00101010 00101010 00101010 01010101 00110100 00010110 00110110
Program:
inr r0
rtr r0
rtr r0
rtr r0
inr r0
rtr r0
rtr r0
rtr r0
prt r0
inr r1
rtr r1
rtr r1
inr r1
rtr r1
inr r1
rtr r1
rtr r1
xor r0, r1
inr r0
prt r0
inr r2
rtr r2
rtr r2
rtr r2
inr r2
xor r0, r2
prt r0
prt r0
inr r0
inr r0
inr r0
prt r0
prt r1
inr r3
rtr r3
rtr r3
rtr r3
rtr r3
xor r4, r3
rtr r3
prt r3
inr r2
inr r2
inr r2
rtr r2
xor r2, r0
prt r2
prt r0
inr r0
inr r0
inr r0
prt r0
inr r2
inr r2
inr r2
inr r2
inr r2
xor r2, r4
prt r2
inr r5
rtr r5
rtr r5
rtr r5
xor r2, r5
prt r2
inr r3
prt r3
What is 10IPL?
10IPL, short for 10 Instruction Programming Language, is a simple compiled language I made for use in a computer I'm building in Minecraft. I made an online interpreter for it (with a few extra features), since I think it's a neat language.
How does this work?
This program doesn't have anything fancy, it just uses three of 10IPL's instructions (Increment, Rotate, and XOR) to put numbers in registers, then prints them.
10IPL has four general purpose registers, r0
to r3
. It also has r4
(or rp0
) and r5
(or rp1
), which are intended to hold pointers. I use these as normal registers to save having to waste bytes clearing the ones I've already used, since this program never needs to access memory.
Answered by Redwolf Programs on November 21, 2021
pHello, World!
Explanation: Sandwich is comprised of opcodes. The first letter of each line is the opcode, and the rest of the line is the arguments. This example has the opcode p
, which means print
. The rest of the line says Hello, World!
, which are the arguments to the p
opcode.
Answered by Y45HK4R4ND1K4R on November 21, 2021
Answered by Makonede on November 21, 2021
Answered by Aaroneous Miller on November 21, 2021
Answered by Makonede on November 21, 2021
142209095870573693396245504627320468349603549841832242891887476756
Answered by Makonede on November 21, 2021
fun main()=print("Hello, World!")
This is probably the shortest you can go.
Answered by grian on November 21, 2021
print"Hello, World!"
Answered by xigoi on November 21, 2021
import qz
It's kind of cheating because it's using an external package but I don't think there is another way to pass the boring:
print("Hello, World!")
Answered by It's-a-fake-one-Daniel on November 21, 2021
Extremely basic, and no explanation needed, but here:
fn main(){println!("Hello, World!")}
If, for some reason, anyone would like to try it, you can here
Answered by Rohan on November 21, 2021
Another simple Hello, World program.
`Hello, World!
` - Push everything from here to the next backtick (or EOF) to the stack
Hello, World! - The text, duh :^)
<implicit output> - Output the contents of the stack reversed
Answered by SjoerdPennings on November 21, 2021
Hello, World!.p
(none)
The program above should output the phrase without LF. If you'd like LF, here is an alternative filename (19 bytes);
ak.-Hello, World!.p
The main feature of this programming language to recognize filename as main routine of the program; content of the file is subroutine.
ImplementationsSo far there are two major implementations:
Answered by nrgmsbki4spot1 on November 21, 2021
Somebody once told me the
world is
gonna roll m
e. I ain't the sharpest t
o
ol in the
shed. She was lookin
kinda dumb w
ith her finger a
nd her thumb in the shape
of an L on her forehead. Well
the years
start coming
and they don't s
top coming... fed to the
rules a
nd I hit t
he ground ru
nning. Didnt
make sense not t
o live for fun.
Your brain gets smart, bu
t y
our head g
ets dumb. So muc
h to do, so much to see,
so what's w
rong with taking the back
stre
ets? You never know
if you don't
go. You neve
r shine if you d
on't glow. Hey now, your'
e an all sta
r, get your
game on, go play
. Hey now, y
our'e a ro
ckstar, get the show on,
g
et paid. Al
l that glitt
ers is gold. Onl
y shooting stars break th
e mould. It's a cool pla
ce and the
y say it get
s colder. You're
bundled up now, wait till
you
get older.
But the medi
a men beg to dif
fer, judging by the hole
in the
satellite p
icture. The
ice we skate is
getting pretty thin. The
water's
getting war
m, so you might
as well swim. My world's
on fire, how about yours? Thats t
he way I like it
There's an interpreter, but there's no permalink
Length is a newly created esolang by esolang.org user Nailuj29, so I thought I'd give it a go and write a HW program hopefully shorter than the example one. Spoiler: this is 42 bytes shorter. The commands are decoded based on the number of characters in each line.
And yes, I did use the lyrics to All Star by Smash Mouth.
push 8
dup
push 1
add
mul
dup
outa
push 29
add
dup
outa
push 7
add
dup
dup
outa
outa
push 3
add
outa
push 11
push 4
mul
dup
dup
outa
push 12
sub
outa
dup
add
push 1
sub
dup
outa
push 24
add
dup
outa
push 3
add
dup
outa
push 6
sub
dup
outa
push 8
sub
outa
push 33
outa
1
push
----------
[8]
3
dup
----------
[8,8]
4
push
----------
[8,8,1]
6
add
----------
[8,9]
7
mul
----------
[72]
8
dup
----------
[72,72]
9
outa:::::::::
H----------
[72]
10
push
----------
[72,29]
12
add
----------
[101]
13
dup
----------
[101,101]
14
outa:::::::::
e----------
[101]
15
push
----------
[101,7]
17
add
----------
[108]
18
dup
----------
[108,108]
19
dup
----------
[108,108,108]
20
outa:::::::::
l----------
[108,108]
21
outa:::::::::
l----------
[108]
22
push
----------
[108,3]
24
add
----------
[111]
25
outa:::::::::
o----------
[]
26
push
----------
[11]
28
push
----------
[11,4]
30
mul
----------
[44]
31
dup
----------
[44,44]
32
dup
----------
[44,44,44]
33
outa:::::::::
,----------
[44,44]
34
push
----------
[44,44,12]
36
sub
----------
[44,32]
37
outa:::::::::
----------
[44]
38
dup
----------
[44,44]
39
add
----------
[88]
40
push
----------
[88,1]
42
sub
----------
[87]
43
dup
----------
[87,87]
44
outa:::::::::
W----------
[87]
45
push
----------
[87,24]
47
add
----------
[111]
48
dup
----------
[111,111]
49
outa:::::::::
o----------
[111]
50
push
----------
[111,3]
52
add
----------
[114]
53
dup
----------
[114,114]
54
outa:::::::::
r----------
[114]
55
push
----------
[114,6]
57
sub
----------
[108]
58
dup
----------
[108,108]
59
outa:::::::::
l----------
[108]
60
push
----------
[108,8]
62
sub
----------
[100]
63
outa:::::::::
d----------
[]
64
push
----------
[33]
66
outa:::::::::
!----------
[]
Answered by lyxal on November 21, 2021
Answered by Michael Chatiskatzi on November 21, 2021
Answered by Michael Chatiskatzi on November 21, 2021
@main
def m=print("Hello, World!")
Thought Dotty deserved its own answer.
Answered by user on November 21, 2021
00000000: 4d54 6864 0000 0006 0001 0002 0001 4d54 MThd..........MT
00000010: 726b 0000 001b 0090 4040 0190 3c40 0090 rk......@@..<@..
00000020: 4640 1b90 4440 0390 4240 0190 4740 00ff [email protected]@[email protected]@..
00000030: 2f4d 5472 6b00 0000 db00 905c 4001 905d /MTrk......@..]
00000040: 4001 9059 4000 905c 4001 9058 4000 904e @..Y@[email protected]@..N
00000050: 4001 904f 4001 904b 4000 9049 4001 904a @[email protected]@[email protected]
00000060: 4001 9046 4000 904a 4001 904b 4001 9047 @[email protected]@[email protected]
00000070: 4000 9048 4001 9049 4001 904a 4001 9046 @[email protected]@[email protected]
00000080: 4000 904d 4001 904e 4001 904a 4000 904c @[email protected]@[email protected]
00000090: 4001 9048 4000 9048 4001 9044 4000 9048 @[email protected]@[email protected]
000000a0: 4001 9044 4000 9045 4001 9046 4001 9042 @[email protected]@[email protected]
000000b0: 4000 9040 4001 9041 4001 903d 4000 903b @..@@..A@..=@..;
000000c0: 4001 903c 4001 9038 4000 902f 4001 9030 @..<@..8@../@..0
000000d0: 4001 902c 4000 9027 4001 9023 4000 902a @..,@..'@..#@..*
000000e0: 4001 9031 4002 9032 4001 9037 4003 9038 @[email protected]@[email protected]
000000f0: 4001 9039 4001 903a 4001 903f 4001 9044 @..9@..:@[email protected]
00000100: 4001 9049 4001 904e 4001 9056 4001 904f @[email protected]@[email protected]
00000110: 4000 ff2f @../
This answer uses the same process as Sp3000's Prelude answer. However, since Fugue can push any integer from -10 to 10, I use the upper voice to store the constant 10 (since copying a value takes one fewer instruction than pushing a new one) and then convert from base 11. The compiler is rather old and can be tricky to use; my usual process (on x86-64 Linux) is to use the commands:
gcc -Dstricmp=strcasecmp -Wno-format -o fugue_x86 fugue_x86.c
xxd -r hello.bin > hello.midi
./fugue_x86 hello.midi /coffc
gcc -D__cdecl= -Dfugue=_fugue -m32 -o hello hello.obj hello_wrp.c
Note that this program is not a valid MIDI file due to the missing length fields after the 2F
meta-events. I didn't optimize it at all for musicality, but if you still want to listen to it, here is an equivalent MIDI file:
00000000: 4d54 6864 0000 0006 0001 0002 0001 4d54 MThd..........MT
00000010: 726b 0000 001c 0090 4040 0190 3c40 0090 rk......@@..<@..
00000020: 4640 1b90 4440 0390 4240 0190 4740 00ff [email protected]@[email protected]@..
00000030: 2f00 4d54 726b 0000 00dc 0090 5c40 0190 /.MTrk......@..
00000040: 5d40 0190 5940 0090 5c40 0190 5840 0090 ]@..Y@[email protected]@..
00000050: 4e40 0190 4f40 0190 4b40 0090 4940 0190 [email protected]@[email protected]@..
00000060: 4a40 0190 4640 0090 4a40 0190 4b40 0190 [email protected]@[email protected]@..
00000070: 4740 0090 4840 0190 4940 0190 4a40 0190 [email protected]@[email protected]@..
00000080: 4640 0090 4d40 0190 4e40 0190 4a40 0090 [email protected]@[email protected]@..
00000090: 4c40 0190 4840 0090 4840 0190 4440 0090 [email protected]@[email protected]@..
000000a0: 4840 0190 4440 0090 4540 0190 4640 0190 [email protected]@[email protected]@..
000000b0: 4240 0090 4040 0190 4140 0190 3d40 0090 B@..@@..A@..=@..
000000c0: 3b40 0190 3c40 0190 3840 0090 2f40 0190 ;@..<@..8@../@..
000000d0: 3040 0190 2c40 0090 2740 0190 2340 0090 0@..,@..'@..#@..
000000e0: 2a40 0190 3140 0290 3240 0190 3740 0390 *@[email protected]@..7@..
000000f0: 3840 0190 3940 0190 3a40 0190 3f40 0190 [email protected]@..:@..?@..
00000100: 4440 0190 4940 0190 4e40 0190 5640 0190 [email protected]@[email protected]@..
00000110: 4f40 00ff 2f00 O@../.
Answered by LegionMammal978 on November 21, 2021
echo Hello, World!
You can't try it online unless Valve ports Half-Life 2 to WASM or something.
This script is pretty basic. It's perfectly valid to echo like this without quotes in the Source Engine.
The Source Engine is a game engine developed by Valve Software, and used in all their games after 2004 (until DOTA 2 in 2015). It provides basic scripting through console commands. You can test this by opening the developer console (enable in settings and press the ` key) and pasting the line.
Tested in Team Fortress 2, CS:GO and Source SDK Base 2013 (Multiplayer).
By inspecting some leftover E3 demo scripts in Half-Life 2, it's revealed there was a rem command which could be a shorter 17 bytes, but this is no longer present in the engine (and I assume that a rem doesn't count because it doesn't print anything). I've yet to test if it exists in Source 2004, but can confirm it's missing in Source 2013.
Technically, the console isn't STDOUT, however the only way to really output to STDOUT is by using the SDK to make a game of my own (obviously compiling to a very large size).
Answered by user99404 on November 21, 2021
IncreaseBy100 DecreaseBy10 DecreaseBy10 DecreaseBy10 IncreaseBy1 IncreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 DecreaseBy1 DecreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 DecreaseBy1 DecreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 IncreaseBy1 PrintChar Clear IncreaseBy10 IncreaseBy10 IncreaseBy10 IncreaseBy10 IncreaseBy1 IncreaseBy1 IncreaseBy1 IncreaseBy1 PrintChar Clear IncreaseBy10 IncreaseBy10 IncreaseBy10 IncreaseBy1 IncreaseBy1 PrintChar Clear IncreaseBy100 DecreaseBy10 DecreaseBy1 DecreaseBy1 DecreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 IncreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 IncreaseBy1 IncreaseBy1 IncreaseBy1 IncreaseBy1 PrintChar Clear IncreaseBy100 IncreaseBy10 DecreaseBy1 DecreaseBy1 PrintChar Clear IncreaseBy100 PrintChar Clear IncreaseBy10 IncreaseBy10 IncreaseBy10 IncreaseBy1 IncreaseBy1 IncreaseBy1 PrintChar Clear
Answered by user99217 on November 21, 2021
"!dlroW ,o"
/?$!"Hell"/
. /
If this gets down to 1 line, it would be much shorter without all the spaces on the second line. I’ll golf this further.
Thanks to Jo King♦ for golfing this further. I think it can be golfed even more now.
Answered by Asher I on November 21, 2021
@WY _= "Hello, World!"
I believe this is the shortest it can get. I would like to be proven wrong.
Answered by Asher I on November 21, 2021
72:c29:+c7+cc3+44:32:87:c24:+c3+c6-c8-33:13:({ds
Explanation:
Technically, Bound prints out "Hello, World!" with a blank program. But that's boring.
So instead, the program above basically creates the relevant ASCII numbers, then loops through them, converting them into chars and writing them. Someone better at math than me could probably golf this better, but I did my best.
Answered by HoofedEar on November 21, 2021
Print["Hello, World!"];
An old language of mine, and fairly basic, but included for comprehension.
Answered by caird coinheringaahing on November 21, 2021
Take Northern Line to Leicester Square
Take Piccadilly Line to Heathrow Terminals 1, 2, 3
Take Piccadilly Line to Holborn
Take Central Line to Holborn
Take Central Line to Bank
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Parsons Green
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Bow Road
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Parsons Green
Take District Line to Parsons Green
Take District Line to Gunnersbury
Take District Line to Paddington
Take District Line to Hammersmith
Take District Line to Parsons Green
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Barking
Take District Line to Acton Town
Take Piccadilly Line to Holloway Road
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Parsons Green
Take District Line to Elm Park
Take District Line to Acton Town
Take Piccadilly Line to Heathrow Terminal 5
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Parsons Green
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Plaistow
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Elm Park
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Hammersmith & City Line to Barking
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington
Take Bakerloo Line to Piccadilly Circus
Take Bakerloo Line to Piccadilly Circus
Take Piccadilly Line to Turnpike Lane
Take Piccadilly Line to Turnpike Lane
Take Piccadilly Line to Leicester Square
Take Northern Line to Leicester Square
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Northern Line to Bank
Take Circle Line to Bank
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Bank
Take Circle Line to Westminster
Take District Line to Gunnersbury
Take District Line to Bow Road
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Aldgate
Take Metropolitan Line to Chorleywood
Take Metropolitan Line to Aldgate
Take Circle Line to Aldgate
Take Circle Line to Bank
Take District Line to Bow Road
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Plaistow
Take District Line to Gunnersbury
Take District Line to Mile End
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Mile End
Take District Line to Bow Road
Take District Line to Mile End
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington
Take Bakerloo Line to Charing Cross
Take Bakerloo Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Mornington Crescent
-57 bytes by using shorter lines and transfer stations
Short explanation: I extract following strings:
Heathrow Terminals 1, 2, 3 (also extracting the numbers for some operations) -- -- Holloway Road --- Westminster - Chorleywood --- -
The strings are cut in pieces, using the left and right substring functions of Gunnersbury and Mile End with the integers of "Heathrow Terminals 1, 2, 3" and "Heathrow Terminal 5" (which can be extracted using Parsons Green).
Then I concatenate them in Paddington and append a "!" by using the char code of (space)+1.
Source:
// ### Milestone: Extract "He", 1, 2, ", " from "Heathrow Terminals 1, 2, 3"
// Get "Heathrow Terminals 1, 2, 3"
Take Northern Line to Leicester Square
Take Piccadilly Line to Heathrow Terminals 1, 2, 3
// Copy that string
Take Piccadilly Line to Holborn
Take Central Line to Holborn
Take Central Line to Bank // Hammersmith = "Heathrow Terminals 1, 2, 3"
// Prepare for left substring
Take District Line to Hammersmith
Take District Line to Gunnersbury // Gunnersbury = "Heathrow Terminals 1, 2, 3"
// Extract 1 from "Heathrow Terminals 1, 2, 3"
Take District Line to Hammersmith
Take District Line to Parsons Green // Acc = 1, Parsons Green = ", 2, 3"
// Copy and store it somewhere (Parsons Green only returns its stored value if it gets a number)
Take District Line to Bank // Hammersmith = 1
Take District Line to Hammersmith
Take District Line to Bow Road // Bow Road = 1
// Store it in Upminster for later calculations
Take District Line to Hammersmith
Take District Line to Upminster
// Store 2
Take District Line to Hammersmith
Take District Line to Parsons Green // Acc = ", 2, 3"
Take District Line to Parsons Green // Acc = 2, Parsons Green = ", 3"
// Get "He"
Take District Line to Gunnersbury
// Store it in Paddington for concatenation
Take District Line to Paddington // Paddington = "He"
// Extract ", " from ", 3"
Take District Line to Hammersmith
Take District Line to Parsons Green
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Gunnersbury // 2 was still stored in Gunnersbury
// Store it somewhere
Take District Line to Barking // Barking = ", "
// ### Milestone: Extract "llo" from "Holloway Road"
// Get "Holloway Road"
Take District Line to Acton Town
Take Piccadilly Line to Holloway Road
// Prepare for left substring
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Gunnersbury // Gunnersbury = "Holloway Road"
// Store 3
Take District Line to Hammersmith
Take District Line to Parsons Green // Acc = 3
Take District Line to Elm Park // Elm Park = 3
// Get 5 from "Heathrow Terminal 5"
Take District Line to Acton Town
Take Piccadilly Line to Heathrow Terminal 5
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Parsons Green // Acc = 5
// Copy and Store it somewhere
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Plaistow // Plaistow = 5
// Get "Hollo" from "Holloway Road"
Take District Line to Hammersmith
Take District Line to Gunnersbury // Gunnersbury = 5
// Prepare for right substring
Take District Line to Mile End // Mile End = "Hollo"
// Get "llo" from "Hollo"
Take District Line to Elm Park
Take District Line to Mile End
// Append it to "He"
Take District Line to Paddington
Take Circle Line to Paddington
// Append ", "
Take Hammersmith & City Line to Barking
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington // Paddington = "Hello, ", Acc = ", Hello, "
// ### Milestone: Get "!" by adding 1 to char value of " "
// Reverse acc
Take Bakerloo Line to Piccadilly Circus
Take Bakerloo Line to Piccadilly Circus
Take Piccadilly Line to Turnpike Lane
Take Piccadilly Line to Turnpike Lane
// Get ASCII value of " "
Take Piccadilly Line to Leicester Square
Take Northern Line to Leicester Square
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross // Acc = 32
// Add 1
Take Northern Line to Bank
Take Circle Line to Bank
Take District Line to Upminster // 1 was stored in Upminster earlier
Take District Line to Bank
Take Circle Line to Bank
Take Northern Line to Charing Cross // Charing Cross = 33
// ### Milestone: Append "W" from "Westminster"
// Get "Westminster"
Take Northern Line to Bank
Take Circle Line to Westminster
// Get "W"
Take District Line to Gunnersbury // Gunnersbury = "Westminster"
Take District Line to Bow Road
Take District Line to Bank
Take District Line to Hammersmith
Take District Line to Gunnersbury
// Append it to "Hello, "
Take District Line to Paddington
Take Circle Line to Paddington
// ### Milestone: Append "orl" and "d" from "Chorleywood"
// Get "Chorleywood"
Take Circle Line to Aldgate
Take Metropolitan Line to Chorleywood
// Save it for copy
Take Metropolitan Line to Aldgate
Take Circle Line to Aldgate
Take Circle Line to Bank
// Bank had 1 in it, so save it for later
Take District Line to Bow Road
// prepare left substring
Take District Line to Hammersmith
Take District Line to Gunnersbury
// get "Chorl"
Take District Line to Plaistow
Take District Line to Gunnersbury
// get "orl"
Take District Line to Mile End // 3 is still stored in Mile End
// append it to "Hello, W"
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington
// get "d"
Take Circle Line to Hammersmith
Take District Line to Mile End
Take District Line to Bow Road
Take District Line to Mile End
// append it to "Hello, Worl"
Take Hammersmith & City Line to Paddington
Take Circle Line to Paddington
// get "!" and append it to "Hello, World"
Take Bakerloo Line to Charing Cross
Take Bakerloo Line to Paddington
// go home
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Mornington Crescent
Answered by Dorian on November 21, 2021
[40,69,76,76,79,12,0,55,79,82,76,68,1]+32
Desmos doesn't support strings, so we return an array of integers representing the codepoints instead. There's no good way to view an entire array at once in Desmos, so instead you can check it by taking the output by wrapping it in parenthesis or storing it in a variable, then accessing (1-indexed) array items like a[1]
or ([40,...,1]+32)[1]
. Or just add 32 to the numbers in the array to check that they're right.
Answered by Ethan Chapman on November 21, 2021
'H╕○ô╣·'W╕7ÿ'!
Or alternatively just the plain and simply:
"Hello, World!
Explanation:
'H '# Push "H"
╕○ô # Push compressed "ello"
╣· # Push compressed ", "
'W '# Push "W"
╕7ÿ # Push compressed "orld"
'! '# Push "!"
# (implicitly output the entire stack joined together to STDOUT)
"Hello, World! "# Push "Hello, World!"
# (implicitly output the entire stack joined together to STDOUT)
Answered by Kevin Cruijssen on November 21, 2021
require"stdio"
Stdio:write("Hello, world!")
Sardonyx is a small language created for the repl.it language jam. See the link above for documentation and more!
Answered by sugarfi on November 21, 2021
`ƈṡ, ƛ€!
Simply the compressed string Hello, World!
Alternatively,
kH
Pushes the constant Hello, World!
Answered by lyxal on November 21, 2021
"Hello, World!":
Answered by Dion on November 21, 2021
[[[[[[[[[[[[[[[[[[[.][.].,][,.].,][,.].,][,.].,][,.].,][.].,][.][.][.][.][.][.][.][.][.][.][.].,][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.].,][.][.][.][.][.][.][.][.][.][.][.][.][.][.][.].,][.][.][.][.][.][.][.][.][.][.][.][.][.].,][.].,][.][.][.][.][.][.][.].,],],][.][.][.].,],][.][.][.].,][,][[,.][[[,][,][,][[,.][[[,][[,.][[[,][,][,][,][[,.][[[,][,][,][,][,][,][,][[,.][[[,][,][,][,][[,.][[[,][,][,][,][[,.][[[,]]].,]]].,]]].,]]].,]]].,]]].,]]].,]]
Dotcomma is a language I made, designed to do as much as possible with the fewest instructions. Interestingly, it uses a queue rather than a stack. The final state of the queue is used as output.
I've put a high level explanation below, but even I don't fully understand how I got this to work :p
The easy part was generating all the necessary letters, ordered by code point ( !,HWdellloor
):
Then it needs to sort the queue so that it displays in the correct order (Hello, World!
):
Answered by Redwolf Programs on November 21, 2021
*{display:none}html{display:flex}:after{content:'Hello World!'
This is the first pure CSS on here, I think.
Answered by derder56 on November 21, 2021
'Mh└a└
Unpacked:
'yt, bs!
A compressed string where every word is capitalized. Output is implicit
Answered by ZippyMagician on November 21, 2021
÷Hello, W╗ld!
Sadly, Integral cannot yet compress capital letters, so it could not do much compression.
÷
means start compressed string.
Ignoring punctuation and capitalization yields
÷▓llo═╗ld
See also: Showcase
Answered by nph on November 21, 2021
7 7
3
5 5
6 5
4 3 3
0 5 3 0 7 3 0 0
0 5 7 0 0 5 0 4
0 6 5 2 4 6 2 3
0 6 6 0 7 7 2 3
0 6 6 2 5 4 7 4
2 2
3 5
3
Answered by Daniel H. on November 21, 2021
0x00: 4505 li a0,1 ; Set fd=1
0x02: 012005ef jal a1,14 ; jmp and put ret addr in a1
0x06: 6c6c6548 ; "Hello, World! "
0x0a: 57202c6f
0x0e: 646c726f
0x12: 0021
0x14: 4635 li a2,13 ; length of string
0x16: 04000893 li a7,64 ; select write() syscall
0x1a: 00000073 ecall ; call write()
0x1e: 05d00893 li a7,93 ; select exit() syscall
0x22: 00000073 ecall ' call exit()
To try this on riscv hardware or an online simulator, compile and run the following c program
const char main[]="x05x45xefx05x20x01Hello, World! x35x46x93x08x00x04x73 x93x08xd0x05x73 ";
Answered by ceilingcat on November 21, 2021
-S
), 15 characters"Hello, World!"
(Where -S
stands for --string
, meaning “Expect a string, manifest as plain text”.)
Sample run:
bash-5.0$ jsonnet -Se '"Hello, World!"'
Hello, World!
Answered by manatwork on November 21, 2021
0x00: 04 00 00 02 l.jal <0x08> ; PC rel jmp, return addr to r9
0x04: 9c 60 00 01 l.addi r3,r0,1 ; delay slot; fd=1
0x08: 9c 89 00 18 l.addi r4,r9,24 ; put addr of string in r4
0x0c: 9c a0 00 0d l.addi r5,r0,13 ; length of string
0x10: 9d 60 00 40 l.addi r11,r0,64 ; select write() syscall
0x14: 20 00 00 01 l.sys 0x1 ; call write()
0x18: 9d 60 00 5d l.addi r11,r0,93 ; select exit() syscall
0x1c: 20 00 00 01 l.sys 0x1 ; call exit()
0x20: 48 65 6c 6c ; "Hello, World!"
0x24: 6f 2c 20 57
0x28: 6f 72 6c 64
0x2c: 21
To try this on an OpenRISC machine or online simulator, compile and run the following c program
const main[]={0x04000002,0x9c600001,0x9c890018,0x9ca0000d,
0x9d600040,0x20000001,0x9d60005d,0x20000001,
'Hell','o, W','orld','! '};
Answered by ceilingcat on November 21, 2021
The previous best answer seems to have been 78 bytes long. I consider this a victory.
+35@⊕5@⊕1L@@|4U@-53@-0@R+43@+4@B'⊕3@-0@F-0@:5@
Found via computer search within a restricted subset of Cubically. Corresponding Most efficient cubifier answer by me.
Answered by the default. on November 21, 2021
aeeeaeeewueuueweeueeuewwaaaweaaewaeaawueweeeaeeewaaawueeueweeaweeeueuw
Answered by AdamS on November 21, 2021
Answered by AdamS on November 21, 2021
This is a boring golf of the program that comes after this one.
a b c d
a b c d e f g h
a b c d e
a b c d e
a b
a b c d e
a b c d e f g h
a b
a b
a b c d
a b
a b c d e
a b c d e
a b c d e
a b c d e
a b c d e
a b c
a b c
a b c d e f g h i
a b c
a b c d e
a b c d e
a b c
a b c d e
a b c d e
a b c d e
a b c d e f g h i
a b
a b c d e
a b c d e f g
a b
a b
a b
a b c d
a b c d e f g
a b
a b
a b c d e f g
a b c d e f g
a b c d
a b c d
a b c d
a b c d e f g h
a b c d e f g
a b
a b c d e f g h i
a b c
a b c
a b c
a b c
a b c d e f g
a b c d
a b c d
a b c d
a b c d e f g
a b c d e
a b c d e
a b c d e
a b c d e
a b c d e
a b c d e
a b c d e f g
a b c
a b c
a b c d e
a b c d e f g
a b
a b
a b
a b
a b c d
a b c d e f g
Ungolfed but far more interesting to read:
This is a "short"
brainetry program that outputs, to stdout, the message
"Hello, World!" as per the
programming world standard. This standard
dictates that
a user that is trying
a language for the first time should write
as its
first program
this "Hello, World!" program.
Of course,
this becomes a repetitive task,
this becomes a repetitive task,
this becomes a repetitive task,
this becomes a repetitive task,
this becomes a repetitive task,
but that shouldn't
hinder you from
tackling this awesome challenge in the Brainetry programming language.
Me, myself and
I have found this language
to be quite amusing if
used to write
self-referential programs like this one.
Self-referential objects are objects that
I, personally, really enjoy. This
might be because I am just a weird person.
Or not!
Who knows? Certainly not me.
Dear reader, please rest assured that we
are ALMOST
at the
MIDDLE of
this self referential program.
Also, please refraing from adding the hyphen
between self
and referential
in the line above, as it is
NOT a typo, it is missing purposefully.
A very important skill
needed to write Brainetry
programs is one's imagination.
This is because each instruction needs one line
of Brainetry source code on its own.
Sounds easy?
I can assure you, it definitely is not easy.
I'm growing tired,
I'm growing unimaginative,
I'm growing old,
I'm writing code.
Oh boy, I wish that would've rhymed!
Even though I can't
really rhyme in English
because I am unskilled,
I can tell you that this is
exhibiting signs of schizophrenia, right?
At this point I am
pretty much talking to myself,
and no one is listening,
right? No one is listening,
right? I definitely hope not.
Now on to some decent source code,
this program works
by harnessing the
well known power of modular
arithmetic, a really nice thing mathematics has
bestowed upon
us, mortals.
This is,
for real,
a really awesome gift
from the mathematicians of yor to us.
Builds on top of this awesome brainfuck answer.
Answered by RGS on November 21, 2021
Answered by Dion on November 21, 2021
If HELLO, WORLD!
is fine.
0?"HELLO, WORLD"
Answered by PkmnQ on November 21, 2021
4OUR
fuor
fuor
4OUR
4OUR
4444
FO44
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
four
4444
fuor
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
four
4444
4444
fuor
4OUR
4OUR
4OUR
four
4444
FO44
4OUR
4OUR
4OUR
fuor
FOU4
4444
ffff
4OUR
4OUR
fuor
4444
FO44
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
4OUR
fuor
FOU4
four
4444
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
4444
4OUR
fuor
FOU4
four
4444
FOU4
FOU4
fuor
4OUR
4OUR
four
4444
FOU4
FOU4
4444
44UR
fuor
4OUR
four
4444
Ungolfed Code:
{44} H -> 72
4OUR$$$$fuor$$$$fuor$$$$4OUR$$$$4OUR {44} CELL[1] + 4 * 4 * 4 + 4 + 4
4444 {44} Print CELL[1]
FO44 {44} Next Cell
{44} e -> 101
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR {44} CELL[2] + 4 + 4 + 4 + 4 + 4
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR {44} CELL[2] * 4 + 4 + 4 + 4 + 4
4OUR$$$$fuor$$$$4OUR$$$$four {44} CELL[2] + 4 * 4 + 4 / 4
4444 {44} Print CELL[2]
{44} l -> 108
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR {44} CELL[2] * 4 + 4 + 4 + 4 + 4
4OUR$$$$4OUR$$$$4OUR$$$$four {44} CELL[2] + 4 + 4 + 4 / 4
4444$$$$4444 {44} Print CELL[2] twice
{44} o -> 111
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$four {44} CELL[2] * 4 + 4 + 4 + 4 / 4
4444 {44} Print CELL[2]
FO44 {44} Next Cell
{44} , -> 44
4OUR$$$$4OUR$$$$4OUR$$$$fuor$$$$FOU4 {44} CELL[3] + 4 + 4 + 4 * 4 - 4
4444 {44} Print CELL[3]
{44} Whitespace -> 32
ffff {44} Reset CELL[3]
4OUR$$$$4OUR$$$$fuor {44} CELL[3] + 4 + 4 * 4
4444 {44} Print CELL[3]
FO44 {44} Next Cell
{44} W -> 87
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR {44} CELL[4] + 4 + 4 + 4 + 4 + 4
fuor$$$$4OUR$$$$4OUR$$$$fuor$$$$FOU4 {44} CELL[4] * 4 + 4 + 4 * 4 - 4
four {44} CELL[4] / 4
4444 {44} Print CELL[4]
{44} o -> 111
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR {44} CELL[4] + 4 + 4 + 4 + 4 + 4
4OUR {44} CELL[4] + 4
4444 {44} Print CELL[4]
{44} r -> 114
4OUR$$$$fuor$$$$FOU4$$$$four {44} CELL[4] + 4 * 4 - 4 / 4
4444 {44} Print CELL[4]
{44} l -> 108
FOU4$$$$FOU4$$$$fuor$$$$4OUR$$$$4OUR {44} CELL[4] - 4 - 4 * 4 + 4 + 4
four {44} CELL[4] / 4
4444 {44} Print CELL[4]
{44} d -> 100
FOU4$$$$FOU4 {44} CELL[4] - 4 - 4
4444 {44} Print CELL[4]
44UR {44} Prev Cell
{44} ! -> 33
fuor$$$$4OUR$$$$four {44} CELL[3] * 4 + 4 / 4
4444 {44} Print CELL[3]
Answered by 지넬만 on November 21, 2021
Using //! import zinc "<code_path>"
command to exclude //! zinc
and //! endzinc
.
library a{function onInit(){BJDebugMsg("Hello, World!");}}
Explanation:
BJDebugMsg()
prints the text on your in-game screen.Answered by 지넬만 on November 21, 2021
no I haven't read through the over 500 other answers to make sure I'm adding something new
Found via computer search within a restricted subset of evil.
aeeaeayekeulaaaweevuewpuuuwwlweaaewguwuewpaaawaaawpweeawgw
Uses the instructions:
a increment the accumulator
u decrement the accumulator
z accumulator = 0
e weave operator (bitwise 01234567 to 20416375 on the accumulator)
w write character
k set the first pental cell to the accumulator
g set the accumulator to the first pental cell
v swap the accumulator and the first pental cell
y set the first wheel cell to the accumulator
l set the accumulator to the first wheel cell
p swap the accumulator and the first wheel cell
The pental is a thingy that stores 5 bytes and can be rotated; I don't rotate it though. The wheel is a circular list that starts at 1 element; I don't add/remove to/from it.
Answered by the default. on November 21, 2021
!v"!dlroW ,olleH"!
o>l?!;
My second answer in this language so far, started learning only today, thought this would be a good starting point
Answered by Dion on November 21, 2021
I want 72 of this
Im very hungry
More 29 of this
Im very hungry
More 7 of this
Im very hungry
Im very hungry
More 3 of this
Im very hungry
Less 67 of this
Im very hungry
Less 12 of this
Im very hungry
More 55 of this
Im very hungry
More 24 of this
Im very hungry
More 3 of this
Im very hungry
Less 6 of this
Im very hungry
Less 8 of this
Im very hungry
Less 67 of this
Im hungry
Answered by user92069 on November 21, 2021
This defines a function returning the string "Hello, World!"
. No trailing newline because it's shorter. (I've made a repl.it for KRC.)
f="Hello, World!"
Demo:
$ ./krc demo/hello
Kent Recursive Calculator 1.0
revised 2016.03.31
/h for help
krc> f!
Hello, World!krc>
Answered by user92069 on November 21, 2021
I love this simple BASIC dialect ...
out"Hello, World!"
out $ Output $
"Hello, World!" $ the string "Hello, World" $
Answered by user92069 on November 21, 2021
9a8m1o3d4m5a1o7a2o3a1o3d7a1o9s3s1o3m9s1o9a9a6a1o3a1o6s1o8s1o3d1o
naz is my new language where every command is given by a number and a letter. Programs operate on a single register whose value can be between -127 and 127, inclusive.
This program uses the instructions for a
dd, s
ubtract, m
ultiply, and d
ivide to set the register to the ASCII value of each character in the string Hello, World!
, then outputs that character with the o
instruction. In the case of the Ls in Hello
, once the register is set to the correct value, 2o
is used to output twice instead of just once.
Answered by sporeball on November 21, 2021
"Hello, World!"
Pretty much just defines a list with the only item as the string "Hello, World!"
.
Answered by user85052 on November 21, 2021
$_='(%,,/ @)/),$!'~^'`@@@@`~@[@@'
My newest language, though it's not too original. This is inspired by FlipTack's Symbolic Python, which bans the use of alphanumeric characters, but otherwise executes as Python code. In this case, I've used the language Raku (previously known as Perl 6), which takes input through the $_
and similarly outputs it's contents at the end of execution. Symbolic Raku does not have an extra eval
operator like Symbolic Python, but it is still Turing complete through the other operators and symbols that Raku provides.
In this case, we use the string xor operator (~^
), which takes two strings to produce the string Hello, World!
, which is obviously banned from hardcoding because it contains letters. A shortcut for producing these strings is included in the reference implementation through the -g=string
flag. Currently, this is not yet on TIO, so the link goes to the Raku language instead.
Answered by Jo King on November 21, 2021
@OUT "Hello, World!"
Should be pretty straight forward what's happening, but we use some undefined behaviour to shave off 2 bytes (interpreter version 1.1.0.0, which is current at time of submission). The program should read:
;@
OUT "Hello, World!";
as per the spec, but we drop the ;
as we only have one instruction and don't need to define an instruction separator, and so also have no trailing ;
at the end.
Answered by Slord6 on November 21, 2021
What better way to introduce a new language than by posting the 768th "Hello, World!"?
Hand-made code, can probably be improved a lot.
11+:+:+:0=1+:+:+::+:.+0*/-::1+.0*+:::..1+1+1+::.0*:+:+:11+1+:+:++..10*1+1+1+:+:+:+-..1+1+1+...0*:+:+1+.
Answered by Herman L on November 21, 2021
204,8,109,1,1205,8,0,99,72,101,108,108,111,44,32,87,111,114,108,100,33
Old 83 byte version:
1106,0,17,72,101,108,108,111,44,32,87,111,114,108,100,33,0,204,3,109,1,1205,3,17,99
Answered by The Fifth Marshal on November 21, 2021
d
, .s*♪╧T≈╪√ù
This program is a compressed program. After decompression this becomes:
J=QwTI[5mRb`
After string-decompression:
Hello, World!"
After quote auto-completion:
"Hello, World!"
After which it is implicitly output.
Answered by user85052 on November 21, 2021
[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]
]
[[]=]=]=]=]=]=]=]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]=]=]=]=]=]
]
[[]=]
]
]
]
]
]
]
]
]
[[]=]=[[[[]=]=]=]=]=]=[]
]
]
]
[[]=]=]=]=[[]=]=]=[]
]
]
]
][]=]=]=]=]=]=]=]=]=[]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]
][[=
With some modifications of an idea by @dzaima, I've golfed 1161 bytes off of this. This one uses a single falling packet, incrementing each time it falls, and forks it off each time it reaches the right value to be outputted.
[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[[[[[[[[[[[[[[[[[[[[[[[[[
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
] ] ] ] ]
[[[[[[[[[]]
] ] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
] ] ] [ ]
[[[[[[
] [ ] ]
] [ ] ]
] [ ] ]
[ ]
[ ]
[ ]
[
[
]
]
]
]]]]]]]]]]]]]]]]]]]]]]]]]]
][[=
It's a little long. I could probably steal some tricks from a BF solution, maybe.
In Plumber, the program is divided into units, each of which are 2 characters wide. Each line is padded to the length of the longest line with spaces, which can be used to shorten programs. Each ]
unit is an increment operator on a falling packet of information, which is dropped by the []
at the top. Chains of [[
can be used to duplicate packets and drop them one by one in different columns.
Answered by Redwolf Programs on November 21, 2021
System.print("Hello, World!")
System.print( ) // Output the following string:
"Hello, World!" // "Hello, World!"
Answered by user85052 on November 21, 2021
class Main{public static void main(String[]a){System.out.print("Hello, World!");}}
Answered by user90364 on November 21, 2021
Since Advent of Code will inevitably be adding more features to Intcode as this year's event progresses, I'll just treat the separate revisions as different languages, and add to this if a new one makes it shorter.
Having no real way of outputting multiple values yet, the version in day 2 can't do a proper Hello World.
There is technically this 42-byte solution, but it feels like cheating because I'm pretty sure no interpreter can run it:
1,3,5,0,99,5735816763073854918203775149089
This program copies that really long number to memory location 0 (which counts as output) and then halts. The really long number happens to be Hello, World!
when read in bigendian form as a string.
In day 5, dedicated I/O instructions are added, so a proper Hello World is possible. The ability to use immediate values doesn't hurt either.
104,72,104,101,104,108,4,5,104,111,104,44,104,32,104,87,4,9,104,114,4,5,104,100,104,33,99
Answered by Nissa on November 21, 2021
72,4,0,-1,1101,1,100,3,4,3,1101,100,8,3,4,3,4,3,1101,100,11,3,4,3,1101,40,4,3,4,3,1101,30,2,3,4,3,1101,80,7,3,4,3,1101,100,11,3,4,3,1101,100,14,3,4,3,1101,100,8,3,4,3,1101,98,2,3,4,3,1101,30,3,3,4,3,99
And this kids is why we don't golf using languages made up for programming competitions.
Answered by lyxal on November 21, 2021
the i/o case of HELLO
a good i/o drill is:say a HELLO
i said HELLO,saying it in Poetic
i code in Poetic,a good way to write a poem
a special piece for you
a special piece in machine writing for you
i already think i do pretty well writing for the machine poem
Poetic program syntax is nice
a perfect sorta poem and a program
This is nothing original, it's a straight port of the brilliant brainfuck answer from @KSab...but it turns out that it's the shortest representation of Hello, World!
that I can find in Poetic. If anyone can golf this, please let me know; I'm definitely interested if someone can beat this solution!
Answered by JosiahRyanW on November 21, 2021
puts"Hello, World!"
Answered by user90364 on November 21, 2021
OutText("Hello, World!")
Over 750 answers and we can still find languages not yet submitted. Wowsers.
Answered by squid on November 21, 2021
11+""+"""+"/*^/"+""+";\+"*"1+;/+""";;(|1+1+1+)";/^""1()"+()+"1+";+^;;";();/;;1+;
This should be very golfable, but it is hard to golf 1+
directly.
Answered by Jo King on November 21, 2021
"Hello, World!"o
"Hello, World!" (push "Hello, World!")
o (pop and print)
Answered by bigyihsuan on November 21, 2021
}ro
"""
l,H
d e
!Wl
"ol
This is about as compressed as it is possible to get. The }
instruction is the put
instruction, but it doesn't really matter what it does since we're just using it to execute the three of the instructions below it, all of which are "
.
First we execute the left, which wraps around to be the rightmost column, printing Hello
. Then right (which is the center column), printing , Wor
. Finally directly below in the left column, we print ld!
, terminating the string literal early rather than wrapping, to avoid printing the }
as well.
Answered by Jo King on November 21, 2021
IncludeTypePackage<OutputSystem>
IncludeTypePackage<StringArray>
outpu=OutputSystem:NewOutput<DEFAULT>
OutputSystem:DisplayAsText<outpu;"Hello, World!">
Introducing Verbosity v2! This is a short as it gets, as variable names must be 5 characters or more. The ungolfed version isn't much different:
IncludeTypePackage<OutputSystem>
IncludeTypePackage<StringArray>
output = OutputSystem:NewOutput<DEFAULT>
OutputSystem:DisplayAsText<output; "Hello, World!">
And it's pretty obvious how it works.
Answered by caird coinheringaahing on November 21, 2021
Using the filename as data without counting the length is cheating. Therefore it is 17 bytes. (It even uses the filename extension as part of the program!)
Save the program as
Hello, World!.pxe
and the file contents should be empty.
Answered by user85052 on November 21, 2021
Explanation, quite long, along with the description of the generation algorithm on my home page (as per request in comments): link
Possibly smallest one can create in finite amount of time.
Feersum's generator has been outscored by 125 digits.
18 1999111369209307333809858526699771101145468560828234645250681099656696029279480812880779443148152835266354745917034724622145903651417563371730237765283326056988244774110441802133624468817714160177386022056512108401823787027806425684398448067970193332644167536135089961308323052217690818659345826221618714547471817786824952177760705661213021136861627615564344797191592895410701640622192392412826316893318666484043376230339929937013414786228802341109250367744273459627437423609306999946689714086908789713031946200584966850579209651689981508129953665360591585003323062426849065928803791631705897655870676902001410564547259097078231664817435753967511921076054045034302323796976905054512737624542497156263914722954936458789312271946701667519720841308380062811251340113402138536813062807047486584549696366881131076129644333426157514410757991556230404583924322168740934746079177400690540383270574734570453863131129670312070568678426587468145691141064452504683450565188718043501125177371576228281599163415914580472091806809959254536307112226422637068036069837636348250796013947548859219492684001888592443619271863264913733271796439829896342322684180478385639971904415730730155249230972472713598001454701479081682503703435292522488015910406951417625194589254609756805750713606175216991897729604817653297756338264018378339186646236428245791304007449872675676823828828025054891324604572924113135541994460293993994930010757779465315482913805320566037487246911578188713647298779820394853314711728701462997760060773720597833413054385989484972761510228922232188763499675904892361201334056531237561182096332707820332381472154893517831468669407424867949853884550905603295504680929068346527584718316837786318710085149722173684889784734888358566137013072868037395888296895408992035862679921478330680631465096402120764369879221964359613565641652779510635224788673321444028128955312660697375763703507924497355056468329176678508797277505818080245055083627993568557883893217501909841992899324584338401263402065617507377073719573642373296064002058833488593469308722954567388945161866200094063588423591356962865924188962743278147095803148276100759174767606637848987740320689762075562393521992008413240632519860537097220403160035470139899869535541445941688033346042941342229305392639867768112643798588915164061012851035069872578424685533430920913310727097269791325370108354115267003538502506307401037702631576755065238836157990287620373910423088628131973441805618500402407032751005850768445522318425479521483938945040598642922742796671148454685792926662105094734939468210307429214048710552195412807154088634170043145174020299723624868716804740205833308025010299791473201989330179511900752421521748244324520372384555472905196933204791343923384985673930225356512632819977168423365518584516873151142795940198973519372718229122661025988052451376835210066645728260048500257088773609522352231828810506243886764860621803233068079848240668323783996022507908005888468315483796728648978952610219628600082949325089555677853995177602958596492703349550377871982505777660804519503438416790609328789548538308170189581940118961959513239411467871900221985235702327603132341245854941342838886675363828149587290416073764877392438738417021129652498464495269870868163299830870636019233313974206364225614175115905798645888824666280593535350493547833757379214088677125769505793280646751090271497879000895725329057103702349349795211071357094147037863458426851391499872003703049553149335378055054176480977774050198041879243243264959205957441742983643583697591926138999543475339555662645088503078864968452030049140027407987267835123806661736568594687416676322591834962173789578844522343172160526435025531896189408441645468352864002987706103448393710107805248652709736711528349633758515438315407447026188178510124322920110858766628704828773265703683997486487094455425009292414948853993709223752434073750917088611480305840639869649933404702780843770306859066070919534638022435125602050780767420448917941603557783974740312706609928585387278690009349321957381507513875981113699582062422293555869483805964659436085153933836036107786
Added per request of @JoKing, because the 1st program doesn't quite run on TIO, albeit being valid.
20 77698190481213510983405846204529755428212736563278528088055816123655499433757607718113585773285686740433752335768949721107461077652705328567448384490378909463204984642622585570301449419608763821501335954761638946551568252142160714228369356054944595121742743720935369219143086698092657062614382519069928478344861416117079283276656675368390764675728501797178208908097054412833019383889935034413095990596139618411133857423995278221670378808372393943846302426674985203826030563290800228881174929701934609803807325868775242909948272754141956168876233403760199007405891058308908050926690654387065882097924294620229833663324754801060691573338185912369627367088050915813931912943122729210762147280440619571047157836177316082899933374851699282897590433145623725705072835054748369992455883804733164985993447304652512229557984322495162682327137071900307763332392727562988633724175094951314863886096190608268953115914497741446723188169519334729165647294618083444761551231012944903572063441813639201051793052623561949314826491616145873848990439549320951496534538450810083853945092224500179417650727351532486362656533602860500906935826231374501097567347929533018944533000919137863885267937690665655625569011036163950983389810112758403211861147501289650757555111271813737813381172074709337306647481507917983021055643749698971365256395367215437223669891280521155247529741719633106765965869860677198632388808752014013939448563313855130972968670015202479226496876067874099463222366536167126653600056389712632892652810365218798697007191747287017174284819764736012653205048166550645507761123345279502597627995423826537299795220169894222867163817508592362092945387317777666016102146798532337718546431888424995701016828542559577710937459975677354300708252448630110787487122698124054544454425586794841157136743408274159313823745226919626156949004386804874236325506583268311452185182143521552429596087556634158778951670223004413763782647825362665491934988477225698133609360969370513836064317152213804169538880632390908441210809806024082600637872813704781431414342781727628446451808751293046212690472851527294326981763969926510021099532791692362104324026231160941956411410511639925420026544463125250979130259151326444714248961523031316570018708849878676230362246913063109584502143502908906243190007062857721367402065760878808920961082444422470813023453274563914735545463757909757689866565064353853099958949763412521666109346825939993377745919874506439752272141853783745051726268592621080457687000431023453539135927140364910898906534604541224314820195082362228787083990333757268808864746297304451768935814651205074884015268982492445996542040655715230139673520569765431617018824427859214902954216246257690105154030408059145566852643855789351907818461502260430297487602982850090037405732117988720732457199005151517240766953718440639691354185802798689950155164379549518496065038927905828230066053603755553745353618846804435103593395141938947781375633374976924393453162350331593801284839409264892975739791751842620029351535320807733966984270102067017902086335370470815153908942490581427972998999752666174807935897314584088695849094389002316139005810918748032068307783088481430339303809949409414892479892121893571274086727250767713365523021125610242269894861374297866741571608166536165735922984579027986499758294460652554897534526492251140681138244025665400003029337114012766773010641359450599171473565675885966777145500248501370644599274741842644014722083732709145488157998306684831419559774212264003518406013032514468522158218837161285401631773099549510145156007147884565387852623860047153609138110997222297132678660783411624002400927435687937355446057878202312894093195453248164648271580944753933355967626542678764854079218206499479071658357103085513937246462858404881973219571392564909528645166637501279457604649906515968389831094896970731573714836150178126997674563415266672131632765794599548356902607125568792417432226125654028873443580337866760487651905138461301986816386866811155111486155341154153322710638921116465132825486519667178335471102213200521032618562169530188826434060179505699797068436325168526618824444305122475837890944742004331675952611756641739756206337285946
Answered by Kamila Szewczyk on November 21, 2021
Simply sets the stack to bits 0 and 1 and then puts them in the output stack.
o::#o>oo>o>oooo>oo>oo>o>o>o>o>oo>o>oo>ooo>oo>o>oo>ooo>oo>o>oooo>oo>o>o>oo>oooo>o>oooooo>o>o>o>o>ooo>o>oo>o>oooo>o>ooo>oo>o>oo>oo>o>oo>ooo>oo>oo>o>oooo>o>oooo>o
Answered by user85052 on November 21, 2021
“Hello, World!”
Simply the string, pushed onto the stack. Really boring.
(By the way, just use postfix for all operators in anyfix; this leads to the least confusion compared to infix modes and prefix modes, and anyfix is the easiest to understand in the postfix mode.)
Answered by user85052 on November 21, 2021
MsgBox"Hello, World!"
You can try it by making a .txt file with that text in it, changing the extension to .vbs and running it.
Answered by Sagittarius on November 21, 2021
Disk Operating System/360, also DOS/360, or simply DOS, is a discontinued operating system for IBM mainframes. It was announced by IBM on the last day of 1964, and it was first delivered in June 1966.In its time, DOS/360 was the most widely used operating system in the world.
A typical configuration might consist of a S/360 model 30 with 32KB memory and the decimal instruction set, an IBM 2540 card reader/card punch, an IBM 1403 printer, two or three IBM 2311 disks, two IBM 2415 magnetic tape drives, and the 1052-7 console.
Answered by roblogic on November 21, 2021
66+@*8C::6--::@@#2"+3^82*@3/#-<*#+/@"#+F<3/3@@#-7:*<
This one took a while. Also will be very difficult to golf, since there is zero no-ops in it, meaning you'll have to save 10 bytes to get it to a size 9 triangle in order to save any bytes
This expands out into this size 10 triangle:
6
6
+ @ *
8 C :
: 6 - - :
: @ @ # 2
" + 3 ^ 8 2 *
@ 3 / # - < * #
+ / @ " # + F < 3
/ 3 @ @ # - 7 : * <
Note: this ignores all control flow characters and just looks at what gets run in order
66* Push 36
:: Duplicate it twice
2*# Output H, popping it
3* Multiplies by 3, yielding 108
: Duplicates
-7# Outputs e, popping it
@@ Outputs l twice, without popping it
3+@ Outputs o, without popping it
" Swaps, putting 36 at the top of the stack
:: Duplicates it twice
8+@ Outputs comma, without popping
C-# Outputs space, popping the top of the stack
2*F+# Outputs W, popping it
" Swaps back around, putting 111 at the top of the stack
@ Outputs o, without popping
3+@ Outputs r, without popping
6-@ Outputs l, without popping
8-# Outputs d, whilst popping
3-@ Subtracts 3 from 36, giving !, and outputs it
6 Pushes 6, which does nothing
Answered by EdgyNerd on November 21, 2021
main(){__builtin_puts("Hello, World!");}
Using builtins are shorter since #include
takes up a lot of bytes. I believe this solution is optimal.
Answered by dingledooper on November 21, 2021
"Hello, World!"p
But that's boring, isn't it? Let's try with functions, instead.
{"Hello"p}'Hello'{", "p}', '{"World"p}'World'{"!"pi}qqqq
Here's something to be explained.
The string registers are initialised to "" when the interpreter starts. When the
interpreter encounters a {
, it copies all the code until the matching }
and
stores it as a function, labelled as what the destination string register was at
the time (The destination string is set by single quotes).
Changes to the registers persist when changing stack frames (is that the right term?), so the explanation looks like this:
{ (Creates function "")
"Hello" (Stores "Hello" in the source string register)
p (Prints what is in the source string register)
}'Hello'{ (Creates function "Hello")
", "p (Prints ", " after storing it in the source string register)
}', '{ (Creates function ", ")
"World"p (Prints "World" after storing it in the source string register)
}'World'{ (Creates function "World")
"!"p (Prints "!")
i (Prints a newline)
}q (Calls function "")
q (Calls function "Hello")
q (Calls function ", ")
q (Calls function "World")
This is a language I created. The source is in the link. I haven't made a Windows release of the interpreter yet, because I cannot figure out how to cross-compile. If you're on Windows, you'll have to compile it yourself.
Answered by TheOnlyMrCat on November 21, 2021
"!dlroW ,olleH"[pov?]
Probably won't get shorter than this.
Incalculate is an esoteric language I have written for fun, don't expect anything fancy. It uses 3 stacks for storage.
Answered by ry00000 on November 21, 2021
out: Hello, World!
Believe it or not, the space is required (hence the language name). In case the website dies, here's the interpreter download link.
Answered by localhost on November 21, 2021
Hello, world!
Keg pushes all of the unrecognized commands onto the stack (with ,
and !
escaped). After the program terminates, it prints the content of the stack.
Answered by user85052 on November 21, 2021
0 0 0 1 1 0 0
0 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 1 1 5 1 0
0 5 1 1 6 0 0
0 6 0 1 7 0 0
0 7 1 0 8 0 0
0 8 0 0 9 0 0
1 9 1 0 a 0 0
1 a 0 0 b 0 0
0 b 0 0 c 0 0
0 c 1 1 d 1 0
0 d 0 1 e 0 0
0 e 1 1 f 0 0
1 f 1 1 g 0 0
0 g 0 1 g 0 0
1 g 0 0 h 1 0
0 h 0 1 i 1 0
0 i 1 0 i 0 0
1 i 1 1 j 1 0
1 j 1 1 k 0 0
1 k 1 1 l 0 0
0 l 0 1 m 0 0
0 m 0 1 n 0 0
0 n 1 1 o 0 0
0 o 0 1 p 0 0
0 p 1 1 q 0 0
0 q 1 0 r 1 0
1 r 0 1 s 0 0
1 s 0 1 t 1 0
0 t 0 1 u 0 0
0 u 1 0 v 0 0
0 v 0 0 v 0 0
1 v 1 0 w 0 0
0 w 0 0 w 0 0
1 w 1 0 x 0 0
1 x 1 0 x 0 0
0 x 1 1 y 0 0
1 y 0 0 z 0 0
1 z 1 0 A 0 0
1 A 0 1 B 1 0
1 B 0 1 C 0 0
0 C 1 0 D 0 0
0 D 0 0 E 0 0
0 E 1 1 F 1 0
0 F 1 1 G 0 0
1 G 0 1 G 0 0
0 G 0 0 H 0 0
0 H 0 0 I 0 0
0 I 1 0 J 1 0
0 J 1 0 J 0 0
1 J 0 1 K 0 0
1 K 1 1 K 0 0
0 K 0 0 L 0 0
1 L 0 0 M 1 0
1 M 1 0 N 0 0
1 N 0 1 O 1 0
1 O 0 1 P 0 0
0 P 0 1 P 0 0
1 P 1 1 P 1 1
Answered by u-ndefined on November 21, 2021
1 ?="Hello, World!"
?
is the I/O system variable in VTL-2. Byte count may seem off, but line numbers are always two bytes, and the CR at the end of the line is mandatory and counted. Space between line numbers and commands is also mandatory.
Answered by brhfl on November 21, 2021
0x00: 40 00 00 02 call 0x8 ! PC relative jump, return addr to %o7
0x04: 82 10 20 04 mov 4, %g1 ! delay slot; select write() syscall
0x08: 90 10 20 01 mov 1, %o0 ! stdout is fd=1
0x0c: 92 03 E0 20 add %o7, 32, %o1 ! put addr of string in %o1
0x10: 94 10 20 0d mov 13, %o2 ! length of string
0x14: 91 D0 20 08 ta %icc, %g0 + 8 ! call write()
0x18: 82 10 20 01 mov 1, %g1 ! select exit() syscall
0x1c: 91 D0 20 08 ta %icc, %g0 + 8 ! call exit()
0x20: 48 65 6c 6c "Hello, World!"
6f 2c 20 57
6f 72 6c 64
21
Porting to 64 bit SPARC requires changing the argument of the trap instruction from 8 to 64.
To try this on a SunOS machine, compile and run the following C program.
const char main[]="x40x00x00x02x82x10x20x04x90x10x20x01x92x03xe0x20x94x10x20x0dx91xd0x20x08x82x10x20x01x91xd0x20x08Hello, World!";
Answered by ceilingcat on November 21, 2021
Answered by Peter on November 21, 2021
Commit tree:
* 63c5d78 "!dlroW ,olleH" put put put put put put put put put put put put put
The program is quite boring -- commits are expensive, and the messages are compressed, so there's little incentive to use proper control flow.
The program in its proper representation consists of 4 files:
.git/HEAD (21 bytes, an empty file here is still accepted by the interpreter, but git does not recognize the repository):
ref:refs/heads/master
.git/refs/heads/master (40 bytes):
63c5d7873f5b0ede65885bfdfd5c935827d6752a
.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 (15 bytes, xxd):
00000000: 78da 2b29 4a4d 5530 6000 000a 2c02 01 x.+)JMU0`...,..
.git/objects/63/c5d7873f5b0ede65885bfdfd5c935827d6752a (103 bytes, xxd):
00000000: 78da 04c1 4501 c030 0c00 c0bd a722 0e4a x...E..0.....".J
00000010: 4137 6366 f0df bbf6 dcf7 f983 80a1 f89e A7cf............
00000020: be07 6c34 52d7 32c6 b6e1 beb1 dab3 ef09 ..l4R.2.........
00000030: 9b41 3bb6 a83a 347d 8fe6 b1ac ff6f 3a1f .A;..:4}.....o:.
00000040: f090 6763 c705 31a4 2415 cae5 5252 4cc9 ..gc..1.$...RRL.
00000050: 29ca 0f57 d0c9 cfc9 49f5 5052 2828 2d21 )..W....I.PR((-!
00000060: 1503 00bd ca30 75 .....0u
Answered by NieDzejkob on November 21, 2021
1111111111111111111111111111111111111111111111111111111110110101101010101110101101101110111010101110111010101110111110101101110101010110101010101011011011110111011111011110101101011101110101011101011010101011010101011n0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Answered by MilkyWay90 on November 21, 2021
WScript.Echo "Hello, World!"
Answered by elipszilon on November 21, 2021
WSH.Echo("Hello, World!")
I don't know if someone did already post Windows Script Host JS.
Answered by elipszilon on November 21, 2021
Answered by Esolanging Fruit on November 21, 2021
print'Hello, World!'#»G²Ú
A Pear Tree programs are written in an arbitrary ASCII-consistent 8-bit character set; for codepoint 128 and above, the interpreter cares about the codepoint numerically, not the represented character. TIO uses Latin-1, so the above program is actually a Latin-1 decoding of the codepoints that make it up.
print'Hello, World!'
should be fairly self-explanatory. However, there is some choice available here; print"Hello, World!"
would have been the same length, but leads to the resulting checksum being less printable.
The checksum is the interesting part of the program. In this program, that's the #»G²Ú
at the end. For golfing, you'd want the shortest workable checksum, which is normally 4 or 5 bytes long. (It's a 32-bit checksum, so 4 bytes would normally be enough, but the checksum is also executed as code, and thus needs to be a valid command; the #
starts a comment, so #
plus 4 bytes is normally enough to add a checksum to anything.) The checksum doesn't have to cover the whole code, but does have to cover a prefix of the part of the code that actually runs; adding comments at the end is terser than adding them at the start, and we want to execute the entire program, so for this program, I caused the checksum to cover the entire program.
Although a Hello World program doesn't benefit much from the checksumming, we could have made use of the checksum behaviour to embed the Hello World program into a larger document or write multiple copies of the program so that if one gets corrupted, the others can still run. This makes A Pear Tree considerably more robust than most languages are.
Answered by ais523 on November 21, 2021
public class h {public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {getstatic java/lang/System.out:"Ljava/io/PrintStream;";ldc "Hello, World!";invokevirtual java/io/PrintStream.println:"(Ljava/lang/String;)V";return;}}
Ungolfed
public class h {
public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {
getstatic java/lang/System.out:"Ljava/io/PrintStream;";
ldc "Hello, World!";
invokevirtual java/io/PrintStream.println:"(Ljava/lang/String;)V";
return;
}
}
Pretty much the same thing as Jasmin, just with a different syntax.
Answered by Kitten on November 21, 2021
"!dlroW ,olleH"[>[(#<
Pushes "Hello, World!" to the stack "!dlroW ,olleH"
Duplicates top of stack afterward, which results in "HHello, World!" [
Moves to the right >
.
Duplicates it again, which results in "HHHello, World!" [
Outputs "H" while popping from the stack, so the stack is "HHello, World!" (
Pops the top of the stack, results in "Hello, World!" #
Moves left <
Pops the top of the stack, results in "ello, World!" #
Outputs "e" while popping from the stack, which results in STDOUT being "He" and the stack being "llo, World!" (
Duplicates the top of the stack, resulting in the stack being "lllo, World!" [
Moves right. >
And I'm sure you can figure out the rest. If you can't, I'll update a more indepth-explanation soon.
Answered by MilkyWay90 on November 21, 2021
20280782166
114
fff#dff#dfffff#dfffffffffff#dfffffffffffffff#dffffffffffffffffffffffffffffffffff#dfffffffff#dfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff#dffffffffffffffffffffffffff#dfffffffffffffffffff#dffff#dffffffffff#dfffffffffff#d
Golfed down to 761 bytes by increasing the brute-forcer to seeds up to 9999, instead of 999
Golfed down to 728 bytes by increasing the brute-forcer to seeds up to 99999, instead of 9999
Golfed down to 552 bytes by increasing the brute-forcer to seeds up to 999999, instead of 99999
Golfed down to 260 bytes with the help of @ASCII_only
Answered by MilkyWay90 on November 21, 2021
Write("Hello, World!")
I realize this question has an existing C# answer which presumably uses the traditional csc.exe compiler. This answers uses the csi.exe command-line REPL.
Answered by dana on November 21, 2021
p+[[ua+ua,]"!"]
Oh boy, he did it again, he started another language.
All functions and operators in Clam are prefix
p+[[ua+ua,]"!"]
p Print
+ Addition
[...........] Argument list
[......] Standalone list
u Uppercase the first letter of..
a ..the string at dictionary index..
+ ..42 (+) - 32 = 10, dictionary[10] = 'hello'
ua, Do the same as above for index 11, 'world'
End of list, standalone list concatenates its
contents as strings with ', ' as delimiter
"!" String literal
End of argument list, Addition also acts as string concat
Transpiled JS code:
console.log('Hello, World' + "!");
Answered by Mayube on November 21, 2021
H
w
nnn
d
v
d
v
l
c
u
v
r
v
o
c
u
v
W
nn
c
c
m
c
m
m
w
nnn
c
m
d
nnnn
m
b
b
c
v
e
v
H
l
p
e
t
Answered by u-ndefined on November 21, 2021
.ORIG x3000
LEA R0, TEXT
TRAP x22
HALT
TEXT .STRINGZ "Hello, World!"
.END
This compiles to an object file:
ibug@ubuntu:~ $ hexdump -Cv hello.obj
00000000 30 00 e0 02 f0 22 f0 25 00 48 00 65 00 6c 00 6c |0....".%.H.e.l.l|
00000010 00 6f 00 2c 00 20 00 57 00 6f 00 72 00 6c 00 64 |.o.,. .W.o.r.l.d|
00000020 00 21 00 00 |.!..|
00000024
ibug@ubuntu:~ $ stat -c "%s" hello.obj
36
ibug@ubuntu:~ $
Answered by iBug on November 21, 2021
Answered by Οurous on November 21, 2021
Answered by Dennis on November 21, 2021
!!!!!!!++*!!!-*!---**+++*/!!!++*!!!!!+++++*!!++++*+++*&++++*&++*
This programming language was actually made by me on November 30th, and it's only useful for printing stuff. See here.
Answered by Cortex on November 21, 2021
_=-~(_==_)
_*=_-~_
__=_*_+~-~-_
_=('%'+`''`[~_/_])*-~-~_%(~-_*~-~-_,_*_+_/_,__,__,_*_-~_,',',' ',__-_+~_,_*_-~_,`_==_`[_/_],__,_*_)+'!'
I'm not sure this is optimal, but it sure was fun.
_=-~(_==_) # Set _ to 2
_*=_-~_ # Set _ to 2*(2+2+1) = 10
__=_*_+~-~-_ # Set __ to 10*10+(10-1-1) = 108
_= # Set _ to
('%'+`''`[~_/_]) # %c, where c is coming from the character x0c
*-~-~_ # Repeated 12 times
%(... # Then format into that format string
~-_*~-~-_, # (10-1)*(10-1-1) = 72 = 'H'
_*_+_/_, # 10*10+1 = 101 = 'e'
__, # 108 = 'l'
__, # 108 = 'l'
_*_-~_, # 10*10+10+1 = 111 = 'o'
',', # ','
' ', # ' '
__-_+~_, # 108-10-(10+1) = 87 = 'W'
_*_-~_, # 10*10+10+1 = 111 = 'o'
`_==_`[_/_], # second letter of True = 'r'
__, # 108 = 'l'
_*_ # 10*10 = 100 = 'd'
)+'!' # Then add the last char '!'
# And implicitly print _
Answered by Jo King on November 21, 2021
Answered by ბიმო on November 21, 2021
"Hello, World!"say
Answered by alephalpha on November 21, 2021
«H%c¡|,!
Wow. It's been a while since I posted this. And boy oh boy how Keg has changed.
« #Start a special compressed string
H% #String compression code (SCC) for "Hello"
c¡ #SCC for "World"
|,! #Join "Hello" and "World" with a `,` and `!` to create "Hello, World!"
« #Close the special compressed string and implicitly print
Hello, World!
Keg is a newly created stack-based, golfing language, which focuses on only having symbols as functions and keywords. As such, alphanumeric characters are pushed to the stack as letters (even spaces are pushed, meaning that they aren't NOPs).
Symbols that would normally be commands can be escaped using 's.
Answered by lyxal on November 21, 2021
printf["Hello, World!"];
Xanathar is a work in progress language, so it is rather hard to use.
Compilation:
$ xanathar helloworld.xan
$ ./helloworld.xan.o
Answered by NoOneIsHere on November 21, 2021
++.*+..+...
++.*++..+.+
++.*++.++..
++.*++.++..
++.*++.++++
++.*+.++..
++.*+.....
++.*+.+.+++
++.*++.++++
++.*+++..+.
++.*++.++..
++.*++..+..
++.*+....+
Each line of the program is:
++
indicating that this line prints the following to STDOUT;.*
, the portal register indicating a number literal; and+
and .
characters forming the binary representation of the character to be printed.Answered by Nissa on November 21, 2021
"ol!,ld elWHro"
Now on Try It Online thanks to Dennis!
Backhand is my first new language, taking inspiration from 2D languages like Befunge and ><>
. However, it is 1D, but makes up for the missing dimension by having the pointer move more than one character at a time. Initially, the program starts at location 0
with step count 3
.
" ! d l r " starts a string literal and starts pushing characters to the stack
o , W o Change direction and go left when you reach the end
l l e H " Switch direction again to go right and end the string literal
H Halt and output stack
Of course, it looks quite funny, since the program is also an anagram of just "Hello, World!".
Answered by Jo King on November 21, 2021
COPY 72 #STDO
COPY 101 #STDO
COPY 108 #STDO
COPY 108 #STDO
COPY 111 #STDO
COPY 44 #STDO
COPY 32 #STDO
COPY 119 #STDO
COPY 111 #STDO
COPY 114 #STDO
COPY 108 #STDO
COPY 100 #STDO
COPY 33 #STDO
Can probably save some bytes by copying a constant to X, and ADDI/SUBI from it.
Answered by SIGSTACKFAULT on November 21, 2021
Hexdump:
0000000: 9a62 c6c6 ca78 b665 a999 4ea9 5995 aa66 .b...x.e..N.Y..f
0000010: 53a9 6363 6665 3958 d996 a539 6363 6565 S.ccfe9X...9ccee
0000020: 6363 6656 5396 3636 3656 65a9 9594 ea8d ccfVS.666Ve.....
0000030: 9599 6aa5 6339 6395 9599 594e 5656 5665 ..j.c9c...YNVVVe
0000040: aa99 94e5 ....
Unpacking the program gives the following object:
((())()(())((()())((())())((())())(()()(())))((()())())(())(()())()()(())(())(()()(()))()()()(()()())(())(()()())()()()(())(())(()()(()))()()(()())((())())((())())(())(())(()()(()))(()()())((())())(())(()())()()(()()(()))(()())((())())((())())(()()())(()()())((())())((())())(())(()()())(()()(()))(()())((())())((())())((())())(()()())(())(()())()()(())(()()())(()()(()))()()()((())())(()()())(())(()())()()()()(()()())((())(()))(()())((()))(()()())(()()())(())(()()())(()()(()))(()()())(()()())(()()())(())(()())()()()()(())(())(()()(()))(()()()))
Indented and commented, this gives:
( Start of main object
(()) Define () (()) doing: (
(()()) Save top stack value to register
((())()) ((())()) Push twice
(()()(())) Concatenate
This code will double an object
) ((()())())
(()) (()()) Push 2
() () Double it twice, producing 8
(()) (()) Push 1
(()()(())) Add: 8 + 1 = 9
() () () Double thrice, producing 72
(()()()) Output 72 = 'H'; Stack: empty
(()) (()()()) Push 3
() () () Double thrice, producing 24
(()) (()) (()()(())) Add 1, producing 25
() () Double twice, producing 100
(()()) ((())()) ((())()) Duplicate and save to register
(()) (()) (()()(())) Add 1, producing 101
(()()()) Output 101 = 'e'; Stack: 100
((())()) Load 100 from register
(()) (()()) Push 2
() () Double twice, producing 8
(()()(())) Add 100 + 8 = 108
(()()) ((())()) ((())()) Duplicate and save to register
(()()()) (()()()) Output both 108 = 'l'; Stack: 100
((())()) ((())()) Load 108 twice
(()) (()()()) Push 3
(()()(())) Add 108 + 3 = 111
(()()) ((())()) ((())()) ((())()) Triplicate
(()()()) Output 111 = 'o'; Stack: 100, 108, 111, 111
(()) (()()) Push 2
() () Double twice, producing 8
(()) (()()()) Push 3
(()()(())) Add 8 + 3 = 11
() () () Double thrice, producing 88
((())()) Load 44, saved by the last doubling
(()()()) Output 44 = ','; Stack: 100, 108, 111, 111, 88
(()) (()()) Push 2
() () () () Double four times, producing 32
(()()()) Output 32 = ' '; Stack: 100, 108, 111, 111, 88
((())(())) Use 88 as new stack
(()()) Load 1
((())) Exit the stack which is now 87
(()()()) Output 87 = 'H'; Stack: 100, 108, 111, 111
(()()()) Output 111 = 'o'; Stack: 100, 108, 111
(()) (()()()) Push 3
(()()(())) Add 111 + 3 = 114
(()()()) Output 114 = 'r'; Stack: 100, 108
(()()()) Output 108 = 'l'; Stack: 100
(()()()) Output 100 = 'd'; Stack: empty
(()) (()()) Push 2
() () () () Double four times, producing 32
(()) (()) Push 1
(()()(())) Add 32 + 1 = 33
(()()()) Output 33 = '!'
) End of main object
Answered by wastl on November 21, 2021
?("Hello, World!")
This is a language written in Cuneiform, and uses Sumerian words as keywords.
At its heart, this is just a translation of Python into Sumerian, but in the future there will be new features added, such as the Babylonian numeral system (which works in base 60).
Because it relies heavily on unicode, this is not going to be a very good golfing language.
Answered by Beta Decay on November 21, 2021
,200,245,300,300,303,112,52,223,303,310,300,244,53
Just apply the ASCII code-points to the pairing function ,
- strings/string-manipulation is not really the strength of µ6 (I guess nothing really is).
Answered by ბიმო on November 21, 2021
-12 thanks to @JoKing
!dlroW ,olleH
0
:| <@6
g>,
0_^> +
:
- <
Try it online! (requires the -r
and -i
flags)
Flobnar is an interesting 2D language vaguey similar to Jellyfish. It shares a creator and many of its instructions with Befunge.
Befunge is an "instruction-based" language, in that the functionality of most commands is encapsulated by an effect. Flobnar, on the other hand, is an "expression-based" language, in that the functionality of most commands is encapsulated by a return value. For example, the 4
term always returns 4
, the >
term is a tail call to the cell to the east, and the +
term returns the sum of the terms to its north and south.
The relevant terms used by this program are:
@
indicates the starting point of the program. @
evaluates the term to its west, and the result of this is the return value of the program (this is printed by default; the -r
interpreter flag is needed to disable this behavior).
lets evaluation "pass through" (it is a tail call to the cell opposite to the direction from which it was evaluated).^>v<
are tail calls to the cells in the direction they point.#
is like
, except that is jumps to the cell two steps away, like Befunge's #
command.
evaluates the cell to the south to get an argument, then lets evaluation pass through to the other side with the new argument. After evaluation is finished, the original argument is restored.:
returns the current argument.+
returns the sum of the cells to the north and south.-
returns the difference of the cell to the north and the cell to the south.!
evaluates the cell on the other side, and returns 1 if it is 0 and 0 otherwise.g
evaluates the cell to the north to get an x-coordinate, the cell to the south to get a y-coordinate, and returns the Unicode codepoint of the cell at those coordinates.|
evaluates the cell on the other side. If the result is 0, it returns the cell to the south; otherwise, it returns the cell to the north._
evaluates the cell on the other side. If the result is 0, it returns the cell to the west; otherwise, it returns the cell to the east.,
evaluates the cell on the other side to get a codepoint and outputs the Unicode character with that codepoint. It always returns 0
. This is one of the few non-referentially-transparent operations in the language.l
. This would be an error, but -i
will cause invalid characters to be ignored (treated as
).This program defines a recursive function that takes a single argument x
and always returns 0. It looks something like this in Python:
def f(x):
if x:
print(playfield[x, 0])
return f(x - 1)
else:
print(playfield[x, 0])
return 0
Answered by Esolanging Fruit on November 21, 2021
So simple even Pikachu can do it!
pi pi pika pi pi pika pi pi pika pi pikachu
pi pika
pi pika pikachu
pi pika pika pikachu
pi pika pi pi pika pi pi pika pi pikachu
pi pikachu pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pi pika pi pi pika pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pi pika pi pi pika pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pi pika pi pi pika pi pi pika pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pi pi pika pi pi pikachu
pi pikachu pi pikachu
pi pi pika pi pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pi pi pika pi pikachu
pi pikachu pi pikachu
pikachu pi pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pi pika pi pi pika pi pi pika pi pikachu
pi pikachu pi pikachu
pika pi pi pika pi pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pika
pi pika pi pi pika pi pi pika pi pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pi pika pi pi pika pi pi pika pi pi pika pi pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pika pi
pi pika pi pi pika pi pi pika pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu
pikachu pikachu pika pikachu
pika pi
pi pi pika pi pikachu
pi pika
pi pikachu pi pikachu
pika pi
pi pika pi pikachu
pikachu pikachu pi pikachu
Try it at Trove42! (Copy and paste above text)
# H
pi pi pika pi pi pika pi pi pika pi pikachu # push 9 to `pi` stack
pi pika # copy top of `pi` stack, 9, to `pika` stack
pi pika pikachu # push 1 to `pika` stack
pi pika pika pikachu # add top two elements of `pika` stack
# push result, 10, to `pika` stack
pi pika pi pi pika pi pi pika pi pikachu # push 9 to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 72, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 72,
# to ASCII, 'H', and print
# e
pika pi # copy top of `pika` stack, 10, to `pi` stack
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 100, to `pi` stack
pi pi pikachu # push 1 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 101, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 101,
# to ASCII, 'e', and print
# l
pika pi # copy top of `pika` stack, 10, to `pi` stack
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 100, to `pi` stack
pi pi pika pi pi pika pi pika pi pikachu # push 8 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 108, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 108,
# to ASCII, 'l', and print
# l
pika pi # copy top of `pika` stack, 10, to `pi` stack
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 100, to `pi` stack
pi pi pika pi pi pika pi pika pi pikachu # push 8 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 108, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 108,
# to ASCII, 'l', and print
# o
pika pi # copy top of `pika` stack, 10, to `pi` stack
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 100, to `pi` stack
pi pi pika pi pi pika pi pi pika pi pika pi pikachu # push 11 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 101, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 111,
# to ASCII, 'o', and print
# "," (comma)
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pi pika pi pi pikachu # push 4 to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 40, to `pi` stack
pi pi pika pi pi pikachu # push 4 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 44, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 44,
# to ASCII, ',', and print
# " " (space)
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pi pika pi pikachu # push 3 to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 40, to `pi` stack
pikachu pi pi pikachu # push 2 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 32, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 32,
# to ASCII, ' ', and print
# W
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pika pi pi pika pi pi pika pi pikachu # push 8 to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 80, to `pi` stack
pika pi pi pika pi pi pika pi pikachu # push 7 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 87, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 87,
# to ASCII, 'W', and print
# o
pika pi # copy top of `pika` stack, 10, to `pi` stack
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 100, to `pi` stack
pika pi # copy top of `pi` stack, 100, to `pika` stack
pi pika pi pi pika pi pi pika pi pi pika pi pikachu # push 11 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 111, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 101,
# to ASCII, 'o', and print
# r
pika pi # copy top of `pika` stack, 100, to `pi` stack
pi pika pi pi pika pi pi pika pi pi pika pi pi pika pi pikachu # push 14 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 114, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 114,
# to ASCII, 'r', and print
# l
pika pi # copy top of `pika` stack, 100, to `pi` stack
pi pika pi pi pika pi pi pika pi pikachu # push 8 to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 101, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 101,
# to ASCII, 'e', and print
# d
pikachu pikachu pika pikachu # convert top of `pika` stack, 100,
# to ASCII, 'd', and print
# "!" (exclaimation point)
pika pi # copy top of `pika` stack, 10, to `pi` stack
pi pi pika pi pikachu # push 3 to `pi` stack
pi pika # copy top of `pi` stack, 3, to `pika` stack
pi pikachu pi pikachu # multiply top two elements of `pi` stack
# push result, 30, to `pi` stack
pika pi # copy top of `pika` stack, 3, to `pi` stack
pi pika pi pikachu # add top two elements of `pi` stack
# push result, 33, to `pi` stack
pikachu pikachu pi pikachu # convert top of `pi` stack, 33,
# to ASCII, '!', and print
Answered by Taylor Raine on November 21, 2021
Answered by Mayube on November 21, 2021
Hexdump:
31 c9 8e d9 be 10 7c b1 0d ac b4 0e cd 10 e2 f9 |1.....|.........|
48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 00 00 00 |Hello, World!...|
*
00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
*
represents 464 bytes of padding required to place the bootable flag (55 aa
) at offset 510.
This is the same as the following assembler code, which can be assembled using nasm hello.asm -f bin -o hello.bin
, assuming the assembler code is in a file called hello.asm
[ORG 0x7C00]
[BITS 16]
xor cx, cx ; Set cx to 0
mov ds, cx ; Set ds to cx (0)
mov si, msg ; Set si to the address of the message
mov cl, 13 ; Set cx to 13 (the size of the message)
print_loop: ; For each character in the message:
lodsb ; Set al to the character
mov ah, 0x0E ; Set ah to 0x0E
int 0x10 ; Call interrupt 0x10 (video services) with ah set to 0x0E (print al to screen)
loop print_loop ; Decrement cx and continue the loop if cx > 0
msg:
db 'Hello, World!'
times 510 - ($-$$) db 0
db 0x55
db 0xAA
The code can be runned with QEMU using the following command, assuming the binary code is saved in a file called hello.bin
:
qemu-system-x86_64 -drive format=raw,file=hello.bin
Answered by Herman L on November 21, 2021
function H():String{return"Hello, World!";}
Might as well put it out there. Q# is Microsoft's programming language for quantum computers, not that there's anything quantum happening here.
"Now hold on a moment! This isn't a complete program!"--You, probably.
Well, it's not actually possible to write a complete program in Q#. You always have to call it from a different language. So I'm just submitting a "function", although note that while Q# is a .NET language, the function
keyword actually defines a class and not a method, and the submission is equivalent to the following C# code:
public class H : Operation<QVoid, String>, ICallable
{
public H(IOperationFactory m) : base(m)
{
}
String ICallable.Name => "H";
String ICallable.FullName => "qsharp.H";
public override Func<QVoid, String> Body => (__in) =>
{
return "Hello, World!";
}
;
public override void Init()
{
}
public override IApplyData __dataIn(QVoid data) => data;
public override IApplyData __dataOut(String data) => new QTuple<String>(data);
public static System.Threading.Tasks.Task<String> Run(IOperationFactory __m__)
{
return __m__.Run<H, QVoid, String>(QVoid.Instance);
}
}
You can use this link to "disassemble" Q#.
Answered by Pavel on November 21, 2021
Answered by Erik the Outgolfer on November 21, 2021
%% %++ %++ %++ %++ %++ %++ %++ %++ @* ## %++ %++ %++ %++ %++ @* ## %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ @* @* ## %++ %++ %++ %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ @* ## @* %++ %++ %++ %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ %++ %++ %++ @* ## %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ @* ##
%# - adds one to the integer index.
%% - resets the integer index to zero.
%& - the integer that the integer index is pointing to is inputted into the program.
#% - sets all of the integers to one.
## - resets all of the integers to zero.
&& - pauses the program.
&@ - clears the screen.
%++ - adds one to the integer that the integer index is pointing to
@[ int ] - outputs the integer as a character (1 = A, 2 = B, ... 26 = Z)
* - integer 0
Answered by DIDIx13 on November 21, 2021
00000000: 674a 4343 4003 0f78 405d 434b 0e76 7e23 [email protected]@]CK.v~#
00000010: e5ee 2f ../
Z80Golf is, essentially, a Z80 machine hooked up to $8000=putchar
and $8003=getchar
. The source code is a binary copied to $0000
(all other memory is zeroed out, just like the registers); execution starts there and runs until a halt
instruction.
It was designed by mokehehe on anarchy golf for code golf competitions there, but seems to have fallen into disuse. It's really fun to golf in, but excelling in it requires a pretty thorough understanding of the Z80 chip (that I myself don't even have, but some golfers like kodera and *yuko* do, and every solution they write is very clever.)
A naïve Hello, World! program might look like this:
start:
ld a, (ix+hello)
or a
jr nz, okay
halt
okay:
call $8000 ; putchar
inc ix
jr start
hello:
db "Hello, World!"
It assembles into a 27 byte binary. It even cheats a little bit: we don't need to explicitly zero-terminate the string "Hello, World!"
ourselves, as all the memory past our source code is zeroed already. And it's still a fair bit longer than our 19-byte solution.
So how does the 19-byte solution work?
It doesn't look much like a Hello, World! program when disassembled:
ld h,a
ld c,d
ld b,e
ld b,e
ld b,b
inc bc
rrca
ld a,b
ld b,b
ld e,l
ld b,e
ld c,e
ld c,0x76
ld a,(hl)
inc hl
push hl
xor 0x2f
We can look at the program in a slightly more revealing manner.
db 47 ^ 'H' ; 67 ld h, a
db 47 ^ 'e' ; 4a ld c, d
db 47 ^ 'l' ; 43 ld b, e
db 47 ^ 'l' ; 43 ld b, e
db 47 ^ 'o' ; 40 ld b, b
db 47 ^ ',' ; 03 inc bc
db 47 ^ ' ' ; 0f rrca
db 47 ^ 'W' ; 78 ld a, b
db 47 ^ 'o' ; 40 ld b, b
db 47 ^ 'r' ; 5d ld e, l
db 47 ^ 'l' ; 43 ld b, e
db 47 ^ 'd' ; 4b ld c, e
db 47 ^ '!' ; 0e ld c,
halt ; 76 $76
ld a, (hl)
inc hl
push hl
xor 47
; 32749 nop instructions, and then:
; putchar(A)
; ret
Whenever the PC becomes $8000
, Z80Golf is programmed to write the byte in register A
to STDOUT, and then effectively execute a ret
(the PC is set to (SP)
and SP is incremented by 2). In our code, instead of using call $8000
to access this behavior, we let the PC wade through a sea of nop
s (opcode 00
) from $0013
to $7fff
.
Keeping this in mind, the code will run as follows:
ld h,a
.mem[0] ^ 47
, which is 'H'
.$0001
).putchar
, and return to the $0001
we pushed.ld c,d
this time.mem[1] ^ 47
, which is 'e'
.$0002
).putchar
, and return to the $0002
we pushed.mem[12] ^ 47
, which is '!'
.putchar
, and return to the $000d
we pushed.
ld c, $76
— and $76
is the halt
opcode!Of course, the constant 47 was carefully picked so that none of the first instructions 13 influence the execution of the code, and the last one is some opcode that takes a single-byte argument, “hiding” the halt
opcode until we jump there after printing '!'
.
Answered by Lynn on November 21, 2021
Pushes the characters to the stack one by one (the second "l" is made with duplication, saving 1 byte), then concatenates them.
!dlroW ,oldeH++++++++++++
Answered by Windmill Cookies on November 21, 2021
ֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֲֳֳֳֳֳֳֳֳֳֳֳֳֳֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָ
Even though it has tons of bytes, it's top 3 in width, as all the characters are diacritical marks.
There isn't much useful to explain. The character codes are put in reverse order into the stack using mostly אֱ
(push 1), אֶ
(dup) and אַ
(add). Then אֵ
(print as char) is called 13 times.
Another thing that adds to the byte count is that each character is represented by 2 bytes in UTF-8. So it's actually 336 characters.
Answered by Bary12 on November 21, 2021
++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++.<<++++++++++++++.------------.>+++++++++++++++.>.+++.------.--------.<<+.
++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++. H
>+. e
+++++++.. l l
+++. o
<<++++++++++++++. comma
------------. space
>+++++++++++++++. W
>. o
+++. r
------. l
--------. d
<<+. !
This can definitely be golfed. (World record is 72 bytes so I already know that)
This is basic hard coded answer, simply gets the Ascii value, resets and keeps going
-[>+<-------]>-.[-]<-[>++<-----]>-.+++++++..[-]>+[+>+[<]>->]<.[-]--[>+<++++++]>+.[-]>-[-[-<]>>+<]>-.[-]-[>+<---]>++.[-]>+[+>+[<]>->]<.[-]>+[-->++[<]>-]>.[-]>+[++[++>]<<+]>+.[-]-[>++<-----]>--.[-]>-[-[-<]>>+<]>.
-[>+<-------]>-. H
[-]
<-[>++<-----]>-. e
+++++++.. l l
[-]
>+[+>+[<]>->]<. o
[-]
--[>+<++++++]>+. ,
[-]
>-[-[-<]>>+<]>-. space
[-]
-[>+<---]>++. W
[-]
>+[+>+[<]>->]<. o
[-]
>+[-->++[<]>-]>. r
[-]
>+[++[++>]<<+]>+. l
[-]
-[>++<-----]>--. d
[-]
>-[-[-<]>>+<]>. !
Answered by Muhammad Salman on November 21, 2021
"!dlroW ,olleH"W@
A (very-unfinished at the time of this writing) fungelike. This works on the current master version.
Ahead is my first esolang (well... that actually has progress). It borrows a lot of concepts from Befunge and ><> but hopefully it provides enough unique features to be interesting. I particularly want to provide features that can improve code density and golfing, one of which is included in this answer.
W
is called "Writewhile". This pops cells from the stack and prints them as chars, until it encounters a 0. The 0 is popped and discarded (not printed). Since stringmode pushes a 0 to the stack when it starts, this makes printing strings rather easy.
"!dlroW ,olleH" push chars to stack
W pop and print until 0
@ kill head
Answered by snail_ on November 21, 2021
Answered by Azeros on November 21, 2021
+|=++=>=+=|>>+>=+++++>>|>++>+++|=>=+===>>>+==>>====+++|==>=|>>>>===+++===++++++==>>+===>>>>+==
I noticed there wasn't a tinyBF answer here. This is based on Ksab's record-breaking brainfuck answer.
Answered by Jo King on November 21, 2021
_--!+++?>>/<<
+[_>-[?+>__-/]<_<_-]>-.>?+.?..![.>]//.!.___./-.??+.
Based off KSab's Brainfuck answer.
Answered by Okx on November 21, 2021
H;_/201;lQP/oe;/W_|@dr
----
This was found with a brute force program. Time taken:
In 0 days 0 hours 52 minutes 56.4935 seconds
I suspect this is optimal.
Answered by DELETE_ME on November 21, 2021
.!.!..!.!....!..!..!.!.!.x[!.!..!.!..!..rv].!..!.!....!..!.!.!..!....!.!......!.!.!.!.!...!.!..!.!....!.!...!..!.!..!..!.!..!...!..!..!.!....!.!....!.
Print He
, print l
twice, print o, World!
Answered by wastl on November 21, 2021