From 144d331f88db84f7622e947ae54d9668559931a1 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 2 Aug 2025 23:58:05 +0200 Subject: [PATCH] FC18: Use octal enum for sand walker and worm data --- .../org/x4o/fc18/FourCornerUnicodeDisplay.java | 5 +++-- .../fc18/zion7/FourCornerZion7Candlelier.java | 10 ++++++---- .../fc18/zion7/FourCornerZionStenoGrapher.java | 5 +++-- .../fc18/zion7/FourCornerZionStenoLexer.java | 17 +++++++++-------- 4 files changed, 21 insertions(+), 16 deletions(-) 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 b158f6c..d6c23bd 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 @@ -36,6 +36,7 @@ import org.x4o.fc18.cake2.FourCornerX08MuffinPointSequence; import org.x4o.fc18.cake2.FourCornerX18CakePointSequence; import org.x4o.fc18.cake2.pie9d.FCDotPIE9DDash09; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; +import org.x4o.fc18.octal8.PrimordialOctal; import org.x4o.fc18.zion7.FourCornerZion7Candlelier; import org.x4o.fc18.zion7.FourCornerZion7WaterCodex; import org.x4o.fc18.zion7.FourCornerZionStenoLexer; @@ -240,11 +241,11 @@ public class FourCornerUnicodeDisplay { } @Override - public void strobeSandWalker(List rhythm) { + public void strobeSandWalker(List rhythm) { } @Override - public void strobeSandWorm(List spice) { + public void strobeSandWorm(List spice) { } @Override 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 d4471b6..39f9468 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 @@ -25,6 +25,8 @@ package org.x4o.fc18.zion7; import java.math.BigInteger; import java.util.List; +import org.x4o.fc18.octal8.PrimordialOctal; + /// Handles the main lexer four corner cake strobes. /// /// @author Willem Cazander @@ -44,10 +46,10 @@ public interface FourCornerZion7Candlelier { void strobeRecursiveCake(List cakePoints); /// Octal sand walker, with an 72 to 576 bit mime-type rhythm header. - void strobeSandWalker(List rhythm); + void strobeSandWalker(List rhythm); /// Octal sand worm spice - void strobeSandWorm(List spice); + void strobeSandWorm(List spice); interface Adapter extends FourCornerZion7Candlelier { @@ -68,11 +70,11 @@ public interface FourCornerZion7Candlelier { } @Override - default void strobeSandWalker(List rhythm) { + default void strobeSandWalker(List rhythm) { } @Override - default void strobeSandWorm(List spice) { + default void strobeSandWorm(List spice) { } } } 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 c87be19..2159f46 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 @@ -27,6 +27,7 @@ import java.util.List; import java.util.Objects; import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; +import org.x4o.fc18.octal8.PrimordialOctal; /// Write steno for zion. /// @@ -69,11 +70,11 @@ public class FourCornerZionStenoGrapher { } @Override - public void strobeSandWalker(List rhythm) { + public void strobeSandWalker(List rhythm) { } @Override - public void strobeSandWorm(List spice) { + public void strobeSandWorm(List spice) { } @Override 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 b7b21d3..79ba898 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 @@ -39,6 +39,7 @@ import org.x4o.fc18.cake2.zero33.dec1.FCDotCMD5401Dash2D; import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC0801DashE10; import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; import org.x4o.fc18.cake2.zero33.dec1.FCDotINC0801DashP8; +import org.x4o.fc18.octal8.PrimordialOctal; /// Parsed FC text and calls the handler methods for the classified strobe lights. /// @@ -347,7 +348,7 @@ public class FourCornerZionStenoLexer { sandWalking[bitOff] = 1; bitSize = bitOff; } - List sandwormHead = new ArrayList<>(); + List sandwormHead = new ArrayList<>(); PrimitiveIterator.OfInt i = Arrays.stream(sandWalking).iterator(); int octalIdx = 2; int octalValue = 0; @@ -363,7 +364,7 @@ public class FourCornerZionStenoLexer { octalIdx--; continue; } - sandwormHead.add(octalValue); + sandwormHead.add(PrimordialOctal.valueOf(octalValue)); octalIdx = 2; octalValue = 0; } @@ -389,7 +390,7 @@ public class FourCornerZionStenoLexer { for (int i = idxFirst; i <= idxLast; i++) { wormBody15.add(lexer.input.get(i)); } - List wormSpice = new ArrayList<>(); + List wormSpice = new ArrayList<>(); Iterator i15 = wormBody15.iterator(); while (i15.hasNext()) { int bitValue15 = i15.next(); @@ -413,11 +414,11 @@ public class FourCornerZionStenoLexer { octal0 += ((bitValue15 >> 2) & 0b1) << 2; octal0 += ((bitValue15 >> 1) & 0b1) << 1; octal0 += ((bitValue15 >> 0) & 0b1) << 0; - wormSpice.add(octal4); - wormSpice.add(octal3); - wormSpice.add(octal2); - wormSpice.add(octal1); - wormSpice.add(octal0); + wormSpice.add(PrimordialOctal.valueOf(octal4)); + wormSpice.add(PrimordialOctal.valueOf(octal3)); + wormSpice.add(PrimordialOctal.valueOf(octal2)); + wormSpice.add(PrimordialOctal.valueOf(octal1)); + wormSpice.add(PrimordialOctal.valueOf(octal0)); } lexer.handler.strobeSandWorm(wormSpice); }