From 33794a8186276fd300f449e058d0aa8c34268303 Mon Sep 17 00:00:00 2001 From: Willem Date: Fri, 5 Sep 2025 18:40:36 +0200 Subject: [PATCH] FC18: Keep rational strobe arguments in the network order --- .../org/x4o/fc18/FourCornerUnicodeDisplay.java | 2 +- .../fc18/zion7/FourCornerZion7Candlelier.java | 6 +++--- .../fc18/zion7/FourCornerZionStenoGrapher.java | 4 ++-- .../x4o/fc18/zion7/FourCornerZionStenoLexer.java | 2 +- .../org/x4o/fc18/zion7/StenoGrapherTest.java | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 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 a01b58c..234c11d 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 @@ -324,7 +324,7 @@ public class FourCornerUnicodeDisplay { } @Override - public void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator) { + public void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator, FCFlameNumberTaste tasteFemale, BigInteger denominator) { // TODO: write full format for all new numbers in short FC6 encoding like; (ratio and choco int's) // auto ratio = 0R.0TrD-123.-123; // = 0rX12FF.12FF = 0tNAN = 0tD123.456 (use pure upper case FC6 AND also have FC6PLus version) if (tasteMale.statusSignNegative()) { 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 bbe9988..2f2730d 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 @@ -40,7 +40,7 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit { void strobeNumberGrams(FCFlameNumberGram gram, List values); /// Embed choco married pig rational number. (4+2300+4+2300) - void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator); + void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator, FCFlameNumberTaste tasteFemale, BigInteger denominator); /// Embed choco pig decimal number. (4+1+283+2016) void strobeNumberChocoPigDecimal(FCFlameNumberTaste taste, boolean bias, BigInteger power, BigInteger coefficient); @@ -62,8 +62,8 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit { } @Override - default void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, - BigInteger numerator, BigInteger denominator) { + default void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator, + FCFlameNumberTaste tasteFemale, BigInteger denominator) { } @Override 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 043e831..de331d9 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 @@ -378,8 +378,8 @@ public class FourCornerZionStenoGrapher { @Override public void strobeNumberChocoMarriedPigsRational( - FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, - BigInteger numerator, BigInteger denominator + FCFlameNumberTaste tasteMale, BigInteger numerator, + FCFlameNumberTaste tasteFemale, BigInteger denominator ) { Objects.requireNonNull(tasteMale); Objects.requireNonNull(tasteFemale); 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 f67c19c..b75ea80 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 @@ -545,7 +545,7 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs BigInteger marriedPigs = lexer.numberBankReadBig12(numberBankTop); BigInteger numerator = marriedPigs.shiftRight(2304); BigInteger denominator = marriedPigs.and(BIG_BITS_2304); - lexer.handler.strobeNumberChocoMarriedPigsRational(tasteMale, tasteFemale, numerator, denominator); + lexer.handler.strobeNumberChocoMarriedPigsRational(tasteMale, numerator, tasteFemale, denominator); } } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/StenoGrapherTest.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/StenoGrapherTest.java index 3701f30..364ccbf 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/StenoGrapherTest.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/StenoGrapherTest.java @@ -160,11 +160,11 @@ public class StenoGrapherTest { List outX18 = new ArrayList<>(); FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18); BigInteger v1 = BigInteger.valueOf(123); - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v1); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v1); BigInteger v2 = BigInteger.valueOf(12345); - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v2); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v2); BigInteger v3 = BigInteger.valueOf(5432); - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_NEGATIVE, FCFlameNumberTaste.NUMBER_NEGATIVE, v3, v3); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_NEGATIVE, v3, FCFlameNumberTaste.NUMBER_NEGATIVE, v3); String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18); Assertions.assertEquals("¹/₁₂₃¹/₁₂₃₄₅⁻⁵⁴³²/₋₅₄₃₂", resX18); } @@ -179,7 +179,7 @@ public class StenoGrapherTest { writerX18.strobeDocumentAlpha(); for (int x = 1; x <= 1025 /*_999999*/; x++) { BigInteger v = BigInteger.valueOf(x); - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v); writerX18.strobeTheWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex()); } writerX18.strobeDocumentOmega(); @@ -204,7 +204,7 @@ public class StenoGrapherTest { FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18); for (int x = 1; x <= 1025; x++) { BigInteger v = BigInteger.valueOf(x); - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v); } String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18); Assertions.assertTrue(resX18.startsWith("¹/₁¹/₂¹/₃"), "missing " + resX18); @@ -217,12 +217,12 @@ public class StenoGrapherTest { List outX18 = new ArrayList<>(); FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18); BigInteger maxValue = FourCornerZionStenoPetroglyphs.BIG_BITS_2300; - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, maxValue); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue); Assertions.assertThrows(IllegalArgumentException.class, () -> { - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, maxValue.add(BigInteger.ONE)); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE)); }); Assertions.assertThrows(IllegalArgumentException.class, () -> { - writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE), maxValue); + writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE), FCFlameNumberTaste.NUMBER_POSITIVE, maxValue); }); } }