diff --git a/judgment/majorityjudgment.go b/judgment/majorityjudgment.go index 3629599..4f97641 100644 --- a/judgment/majorityjudgment.go +++ b/judgment/majorityjudgment.go @@ -105,11 +105,17 @@ func (mj *MajorityJudgment) ComputeScore(tally *ProposalTally, favorContestation for i := uint8(0); i < amountOfGrades; i++ { analysis.Run(mutatedTally, favorContestation) score += fmt.Sprintf("%0"+fmt.Sprintf("%d", amountOfDigitsForGrade)+"d", analysis.MedianGrade) - // fixme: BAD → uint64 to int conversion — either move to int everywhere, or use whatever bigint Go has - score += fmt.Sprintf("%0"+fmt.Sprintf("%d", amountOfDigitsForAdhesionScore)+"d", int(amountOfJudgments)+int(analysis.SecondGroupSize)*analysis.SecondGroupSign) + //adhesionScore := amountOfJudgments) + analysis.SecondGroupSize * analysis.SecondGroupSign + adhesionScore := amountOfJudgments + if analysis.SecondGroupSign > 0 { + adhesionScore = adhesionScore + analysis.SecondGroupSize + } else if analysis.SecondGroupSign < 0 { + adhesionScore = adhesionScore - analysis.SecondGroupSize + } + score += fmt.Sprintf("%0"+fmt.Sprintf("%d", amountOfDigitsForAdhesionScore)+"d", adhesionScore) regradingErr := mutatedTally.RegradeJudgments(analysis.MedianGrade, analysis.SecondMedianGrade) if nil != regradingErr { - return "", regradingErr // 仕方がない + return "", regradingErr // 仕方がない – C'est la vie ! (see issue #4) } }