[Odin] Walking string and making runes[Odin] Walking string and making runes
🧑🚀
A Human Message
Week 4, 2026
// https://program52.com/en/challenge/2026/5B7BB05B5
// - use "odin run ." to run the code
// - input1.txt and input2.txt should be nearby with the input data
package main
import "core:fmt"
import "core:strconv"
import "core:strings"
input1_bytes := #load("input1.txt")
input2_bytes := #load("input2.txt")
main :: proc () {
for bytes in ([2] [] byte { input1_bytes, input2_bytes }) {
text := strings.trim(string(bytes), "\n\r\t ")
for line in strings.split_lines(text) {
result := decode(line)
fmt.printfln("->|%s|\n<-|%s|", line, result)
}
}
}
decode :: proc (input: string, allocator := context.allocator) -> string {
assert(len(input)%8 == 0, "input length must be divisible by 8")
sb := strings.builder_make(allocator)
for i in 0..