Myers.get_block_cell_value: def of bend-edit-distance@0.2.2.0 Import: import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers Lines 133-142 of bend-edit-distance@0.2.2.0/src/Myers.bend: https://jend.leeeet.dev/read.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&start_line=133&end_line=142 import Base # getBlockCellValues(block)[W], without constructing the other 31 cells. # Walking up a row subtracts its positive vertical difference and adds its # negative difference. W is always in 0..31, never a whole extra block. def get_block_cell_value(padding: Nat, +pv: U32, +mv: U32, score: U32) -> U32: match padding: case 0n: score case 1n+p: get_block_cell_value(p, U32.shl(pv), U32.shl(mv), U32.add(U32.sub(score, U32.shrn(pv, 31n)), U32.shrn(mv, 31n))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shl https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub