omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / tests / one_layer / generalization / dev / tasks / cases / devgen03 / hidden / reference.osc
| 1 | fn h(s: u32, i: u32) -> u32 { |
| 2 | return (s * 31 + i * i + 7) % 65536; |
| 3 | } |
| 4 | |
| 5 | fn mix_hash(seed: u16, n: u8) -> u16 { |
| 6 | let m: u32 = n as u32; |
| 7 | let mut s: u32 = seed as u32; |
| 8 | let mut i: u32 = 0; |
| 9 | while i < m bound 256 { |
| 10 | s = h(s, i); |
| 11 | i = i + 1; |
| 12 | } |
| 13 | return s as u16; |
| 14 | } |