From 3efd7c891815f872ae63f930f0e64ae97225f1fa Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 8 Sep 2025 17:38:17 +0200 Subject: [PATCH] FC18: Remove cake point check from steno tongue --- .../zion7/FourCornerZionStenoGrapher.java | 8 +++--- .../fc18/zion7/flame4/FCFlameStenoTongue.java | 25 +++++-------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java index 4b437e2..495fa4c 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java @@ -299,13 +299,15 @@ public class FourCornerZionStenoGrapher { @Override public void strobeTheWord(FCFlameWordDish course, int cakePoint) { - if (cakePoint < outTongue.cakePointMin()) { + if (FCFlameStenoTongue.FC18_WORMS.equals(outTongue)) { + throw new IllegalArgumentException("Cake point word is not allowed with worms: 0x" + Integer.toHexString(cakePoint)); + } + if (cakePoint < course.cakePointMin()) { throw new IllegalArgumentException("Cake point is smaller than limit: 0x" + Integer.toHexString(cakePoint)); } - if (cakePoint > outTongue.cakePointMax()) { + if (cakePoint > course.cakePointMax()) { throw new IllegalArgumentException("Cake point is greater than limit: 0x" + Integer.toHexString(cakePoint)); } - // TODO: validate with course if (FCFlameStenoTongue.FC6_PLUS.equals(outTongue) && cakePoint > CAKE_POINT_MAX_FC6) { // fixme improve this FourCornerDotCake slice = FourCornerDotCake.valueFromCakePoint(cakePoint).get(); diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/flame4/FCFlameStenoTongue.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/flame4/FCFlameStenoTongue.java index 782ed13..6528873 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/flame4/FCFlameStenoTongue.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/flame4/FCFlameStenoTongue.java @@ -22,7 +22,6 @@ */ package org.x4o.fc18.zion7.flame4; -import org.x4o.fc18.cake2.FourCornerDotCake; /// The steno tongue speak language supported limits. /// @@ -31,32 +30,20 @@ import org.x4o.fc18.cake2.FourCornerDotCake; public enum FCFlameStenoTongue { /// Pure six bit baklave point word candy. - FC6 (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_CDC1604_P6.getStop()), + FC6, /// Big computer have extra ROM space for extra candy letters. - FC6_PLUS (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_PIE9D_27.getStop()), + FC6_PLUS, /// Full range with all features - FC18 (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_CDC1604_P6.getStop()), + FC18, /// An adult man does not use candy. - FC18_ADULT (FourCornerDotCake.FC_CLK1K_Z.getStop() + 1, FourCornerDotCake.FC_CDC1604_P6.getStop()), + FC18_ADULT, /// An sand man rides adult worms, in the desert of the real. - FC18_WORMS (0, -1), // allow zero letters in strobeTheWord range + FC18_WORMS, ; private static final FCFlameStenoTongue[] VALUES = values(); - private final int cakePointMin; - private final int cakePointMax; - private FCFlameStenoTongue(int cakePointMin, int cakePointMax) { - this.cakePointMin = cakePointMin; - this.cakePointMax = cakePointMax; - } - - public int cakePointMin() { - return cakePointMin; - } - - public int cakePointMax() { - return cakePointMax; + private FCFlameStenoTongue() { } public boolean isSixBit() {