quine golf 2: surface shader boogaloo, 55x55 3019B

This commit is contained in:
Crispy 2024-08-13 20:04:30 +02:00
parent c1df57a20b
commit 2680a70a20
6 changed files with 111 additions and 9 deletions

View file

@ -82,7 +82,8 @@ fn main() {
fn golfed() {
// source code conversion
let source_text = read_to_string("../Assets/test/quine_golf.shader").unwrap();
// let source_text = read_to_string("../Assets/test/quine_golf.shader").unwrap();
let source_text = read_to_string("../Assets/test/QuineSurface.shader").unwrap();
let mut encoded_text: Vec<u32> = Vec::new();
let mut temp = 0;
let mut i = 0;
@ -120,13 +121,14 @@ fn golfed() {
for t in &encoded_text {
out_string += &format!("{t:#010x},");
}
out_string += "};\n";
out_string.pop();
out_string += "}\n";
out_string += &format!("b={blob_start};\n");
out_string += &format!(
"uint magic_number_L_plus_b= {};\n",
encoded_text.len() * 11 + blob_start
encoded_text.len() * 11 + blob_start - 1
);
out_string += &format!("uint magic_number_L= {};\n", encoded_text.len() * 11);
out_string += &format!("uint magic_number_L= {};\n", encoded_text.len() * 11 - 2);
// font
let img = ImageReader::open("6x6.png").unwrap().decode().unwrap();