All pastes #240667 Raw Edit

rkz

public java v1 · immutable
·published 2006-11-05 21:10 UTC
rendered paste body
        HashMap key = new HashMap();        int bestMatch = -1;          double smallestDelta;        for (int i=0;i<26;i++) {            smallestDelta = 1; //impossibly large number to start off with.            for (int j=0;j<26;j++){                if (delta(cipherFreqArray[i],engfreqs[j]) < smallestDelta)                 {                    smallestDelta = delta(cipherFreqArray[i],engfreqs[j]);                    bestMatch = j;                 }            }            key.put(returnCharFromVal(bestMatch), returnCharFromVal(i));        }