Score on criteria count, not sample count

This commit is contained in:
Ian Gulliver
2021-11-20 20:30:16 -10:00
parent 6612523a52
commit 05c62a92e1
3 changed files with 40 additions and 30 deletions

View File

@@ -13,12 +13,14 @@ func (s *Sample) SetInputs(state *vm.State) {
}
}
func (s *Sample) OutputsMatch(state *vm.State) bool {
func (s *Sample) matchingOuts(state *vm.State) uint64 {
ret := uint64(0)
for i, val := range s.Out {
if state.GlobalMemory().MustReadUnsigned(uint64(i)) != val {
return false
if state.GlobalMemory().MustReadUnsigned(uint64(i)) == val {
ret++
}
}
return true
return ret
}