Added some white space and make bank reset loop once

This commit is contained in:
Willem Cazander 2025-01-16 16:22:56 +01:00
parent aa6f12f336
commit c2371ebaa3

View file

@ -285,7 +285,7 @@ public class FourCornerZionStenoLexer {
class StenoScannerNCR18 extends StenoScanner { class StenoScannerNCR18 extends StenoScanner {
private final int denominatorBank[] = new int[64]; // <== is the terminator select per 9 bit group private final int denominatorBank[] = new int[64]; // <== is the terminator select per 9 bit group
private final int numeratorBank[] = new int[64]; private final int numeratorBank[] = new int[denominatorBank.length];
public StenoScannerNCR18() { public StenoScannerNCR18() {
super(FourCornerDotCake.FC_NCR1632_XD.getStart(), FourCornerDotCake.FC_NCR1632_XN.getStop()); super(FourCornerDotCake.FC_NCR1632_XD.getStart(), FourCornerDotCake.FC_NCR1632_XN.getStop());
@ -343,22 +343,20 @@ public class FourCornerZionStenoLexer {
} }
private void bankReset() { private void bankReset() {
for (int i=0;i<denominatorBank.length;i++) { for (int i = 0; i < denominatorBank.length; i++) {
denominatorBank[i] = 0; denominatorBank[i] = 0;
}
for (int i=0;i<numeratorBank.length;i++) {
numeratorBank[i] = 0; numeratorBank[i] = 0;
} }
} }
private void bankFire() { private void bankFire() {
BigInteger denominator = BigInteger.ONE; BigInteger denominator = BigInteger.ONE;
for (int i=0; i<denominatorBank.length;i++) { for (int i = 0; i < denominatorBank.length; i++) {
denominator = denominator.add(BigInteger.valueOf(denominatorBank[i]).shiftLeft(i*9)); denominator = denominator.add(BigInteger.valueOf(denominatorBank[i]).shiftLeft(i * 9));
} }
BigInteger numerator = BigInteger.ONE; BigInteger numerator = BigInteger.ONE;
for (int i=0; i<numeratorBank.length;i++) { for (int i = 0; i < numeratorBank.length; i++) {
numerator = numerator.add(BigInteger.valueOf(numeratorBank[i]).shiftLeft(i*9)); numerator = numerator.add(BigInteger.valueOf(numeratorBank[i]).shiftLeft(i * 9));
} }
handler.strobeNCR1632(denominator, numerator); handler.strobeNCR1632(denominator, numerator);
} }