quine golf: more shorter: 5549 bytes

This commit is contained in:
Crispy 2024-08-12 16:06:51 +02:00
parent 32ffcbc921
commit 9e20abb767
3 changed files with 15 additions and 17 deletions

View file

@ -92,8 +92,9 @@ fn golfed() {
let mut blob_start = 0;
let mut used_charset:Vec<_> = " 0123456789abcdefx,".chars().collect();
for (index, char) in source_text.chars().enumerate() {
if char == '*' && blob_start==0 {
if char == '?' && blob_start==0 {
blob_start = index;
continue;
}
temp <<= 8;
let char_index = used_charset
@ -121,7 +122,7 @@ fn golfed() {
out_string += &format!("{t:#010x},");
}
out_string += "};\n";
out_string += &format!("w L={};\n", encoded_text.len()*11);
out_string += &format!("w L={};", encoded_text.len()*11);
out_string += &format!("w b={blob_start};\n");
// font