code wiki / _hdl_build / _pe_codec_grade.nx

_pe_codec_grade.nx source

↩ module page · 11 lines · 411 B

1// AUTHORED BY THE NISHI BUILDER (pattern: PERMIL_VERDICT) -- baked band ladder, no Claude logic 2func _pe_codec_grade_verdict(count: i64) -> i64 { 3 if count < 0 { return 0 - 1 } 4 let permil: i64 = count * 1000 / 1000 5 if permil >= 1000 { return 1 } 6 if permil >= 800 { return 2 } 7 if permil >= 600 { return 3 } 8 if permil >= 400 { return 4 } 9 if permil >= 0 { return 5 } 10 return 0 - 1 11}