From ddda38ffaaabcbae2f85e6b92c46ff25d82bb5ad Mon Sep 17 00:00:00 2001 From: Willem Date: Thu, 7 Aug 2025 19:24:24 +0200 Subject: [PATCH] FC18: Removed recursieve fc18 access for 6 and 8 bit systems. --- .../java/org/x4o/fc18/FourCornerRecipe.java | 46 ------------------- .../x4o/fc18/FourCornerUnicodeDisplay.java | 9 ---- .../zero33/dec1/FCDotDEC2701DashPX0.java | 4 +- .../fc18/zion7/FourCornerZion7Candlelier.java | 7 --- .../zion7/FourCornerZionStenoGrapher.java | 4 -- .../fc18/zion7/FourCornerZionStenoLexer.java | 38 --------------- .../fc18/FourCornerUnicodeDisplayTest.java | 10 ++-- 7 files changed, 6 insertions(+), 112 deletions(-) diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java index 48897f3..65409e3 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java @@ -24,7 +24,6 @@ package org.x4o.fc18; import java.math.BigInteger; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.PrimitiveIterator; @@ -36,7 +35,6 @@ import org.x4o.fc18.cake2.pie9c.FCDotPIE9CDash10; import org.x4o.fc18.cake2.pie9c.FCDotPIE9CDash11; import org.x4o.fc18.cake2.pie9c.FCDotPIE9CDash20; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; -import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; /// Holds different lookup and conversion maps towards four corner int18 cake points. /// @@ -50,50 +48,6 @@ final public class FourCornerRecipe { private FourCornerRecipe() { } - static public List embedFC18(List cakePoints) { - if (cakePoints.isEmpty()) { - return cakePoints; - } - boolean lostEnd = false; - List result = new ArrayList<>(); - Iterator i = cakePoints.iterator(); - while (i.hasNext()) { - int cakePoint = i.next(); - if (cakePoint < 64) { - result.add(cakePoint); - continue; - } - if (!i.hasNext()) { - break; - } - boolean closeEnd = true; - result.addAll(FCDotDEC2701DashPX0.ESC68_FC18.baklavaPointSequence()); - while (i.hasNext()) { - lostEnd = false; - if (cakePoint < 64) { - result.add(FCDotCDC1604DashP6._SALAH_EXCLAMATION.baklavaPointDotIndex()); - result.add(cakePoint); - closeEnd = false; - break; - } - for (int cakePointIdx=0;cakePointIdx<=6;cakePointIdx++) { - int octal = (cakePoint >> ((6-cakePointIdx)*3)) & 0b111; - int letter = octal + FCDotCDC1604DashP6.NX01_A.ordinal(); - result.add(letter); - } - cakePoint = i.next(); - lostEnd = true; - } - if (closeEnd) { - result.add(FCDotCDC1604DashP6._SALAH_EXCLAMATION.baklavaPointDotIndex()); - } - if (lostEnd) { - result.add(cakePoint); - } - } - return result; - } - @Deprecated // TODO: move to sand worm static public List embedUNI2K(String value) { List result = new ArrayList<>(value.length()); diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java index 76fb38b..31a473d 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java @@ -124,7 +124,6 @@ public class FourCornerUnicodeDisplay { private final class StenoUnicodePrinter implements FourCornerZion7Candlelier, FourCornerZion7WaterCodex, FourCornerZionStenoLexerSmoke.AdapterMonoPipe { private final StringBuilder output; - private FourCornerZionStenoLexer thisDisplayEscaked = null; private boolean wasExternalWord = false; private StenoUnicodePrinter(StringBuilder output) { @@ -232,14 +231,6 @@ public class FourCornerUnicodeDisplay { renderFromInt18(math, output); } - @Override - public void strobeRecursiveCake(List cakePoints) { - if (thisDisplayEscaked == null) { - thisDisplayEscaked = new FourCornerZionStenoLexer(this, true); - } - thisDisplayEscaked.read(cakePoints); - } - @Override public void strobeSandWalker(List rhythm) { } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java index 9ebfd0e..dc47434 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java @@ -137,9 +137,7 @@ public enum FCDotDEC2701DashPX0 implements FourCornerX06BaklavaPointSequence, Fo ESC68_NCR, /// _ESC6_X2 _ESC6_X3 _ESC6_X3 = 18 - /// On 6/8 bit escape to 18 bit four corner cake points. - /// Stream per six octals as CDC chars in NX01_A to NX08_H, and MUST end with !. - ESC68_FC18, + __ESC_RESERVED_B9, // =========== Internal control sequences diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java index 39f9468..34a2a9a 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java @@ -42,9 +42,6 @@ public interface FourCornerZion7Candlelier { /// 1152 bit fractions of two 576 bit numbers. void strobeNCR1632(BigInteger denominator, BigInteger numerator); - /// Allows a 6 bit computer to use the full FC18 space for nether or fractions. - void strobeRecursiveCake(List cakePoints); - /// Octal sand walker, with an 72 to 576 bit mime-type rhythm header. void strobeSandWalker(List rhythm); @@ -65,10 +62,6 @@ public interface FourCornerZion7Candlelier { default void strobeNCR1632(BigInteger denominator, BigInteger numerator) { } - @Override - default void strobeRecursiveCake(List cakePoints) { - } - @Override default void strobeSandWalker(List rhythm) { } 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 fee52d1..ff953f2 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 @@ -68,10 +68,6 @@ public class FourCornerZionStenoGrapher { FourCornerRecipe.embedNCR1632Numerator(out, numerator); } - @Override - public void strobeRecursiveCake(List cakePoints) { - } - @Override public void strobeSandWalker(List rhythm) { } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java index b046550..42329aa 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java @@ -622,9 +622,6 @@ public class FourCornerZionStenoLexer { if (FCDotDEC2701DashPX0.ESC68_NCR.equals(cdcDECMode)) { return handleNCR(lexer); // TODO: add small bank switching ? } - if (FCDotDEC2701DashPX0.ESC68_FC18.equals(cdcDECMode)) { - return handleFC18(lexer); - } if (FCDotDEC2701DashPX0.ESC_DEC0801_E10.equals(cdcDECMode)) { return handleE10(lexer); } @@ -796,41 +793,6 @@ public class FourCornerZionStenoLexer { return true; } - private boolean handleFC18(FourCornerZionStenoLexer lexer) { - lexer.decModeReset(); - List> result = new ArrayList<>(); - scanSalahRakaAt(lexer, result); - if (result.isEmpty()) { - return true; - } - List renderCakePoints = new ArrayList<>(); - for (List argu : result) { - int cakePointArgu = 0; - int cakePointIdx = 6; - for (Integer octal : argu) { - if (octal < FCDotCDC1604DashP6.NX01_A.ordinal()) { - continue; - } - if (octal > FCDotCDC1604DashP6.NX08_H.ordinal()) { - continue; - } - int offset = octal - FCDotCDC1604DashP6.NX01_A.ordinal(); - cakePointArgu = cakePointArgu + (offset << (cakePointIdx*3)); - cakePointIdx--; - if (cakePointIdx < 0) { - renderCakePoints.add(cakePointArgu); - cakePointIdx = 6; - cakePointArgu = 0; - } - } - } - if (renderCakePoints.isEmpty()) { - return true; - } - lexer.handler.strobeRecursiveCake(renderCakePoints); - return true; - } - private boolean scanSalahRakaAt(FourCornerZionStenoLexer lexer, List> result) { List argu = new ArrayList<>(); while (lexer.cdcDECScanIndex <= lexer.cdcDECScanIndexEnd) { diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java index 1d67485..b6c5055 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java @@ -114,15 +114,15 @@ public class FourCornerUnicodeDisplayTest { int bitsFC18 = cdc.size()*18; Assertions.assertTrue(bitsFC18 < bitsUTF8, "FC18 is not smaller"); - List cdc6 = FourCornerRecipe.embedFC18(cdc); - Assertions.assertEquals(outputExpected, FourCornerUnicodeDisplay.text().renderFromInt18(cdc6)); - Assertions.assertTrue(cdc6.size() > cdc.size(), "FCx6 is not bigger"); + //List cdc6 = FourCornerRecipe.embedFC18(cdc); + //Assertions.assertEquals(outputExpected, FourCornerUnicodeDisplay.text().renderFromInt18(cdc6)); + //Assertions.assertTrue(cdc6.size() > cdc.size(), "FCx6 is not bigger"); System.out.println("size FC18="+cdc.size()); System.out.println("size 0x21="+outputExpected.length()); System.out.println("size UTF8="+outputExpected.getBytes(StandardCharsets.UTF_8).length); - System.out.println("size FCx6="+cdc6.size()); - System.out.println("raw FCx6="+FourCornerUnicodeDisplay.raw().renderFromInt18(cdc6)); + //System.out.println("size FCx6="+cdc6.size()); + //System.out.println("raw FCx6="+FourCornerUnicodeDisplay.raw().renderFromInt18(cdc6)); } @Test