FC18: Redone binary number encodings

This commit is contained in:
Willem Cazander 2025-09-01 01:11:23 +02:00
parent 46d305b5aa
commit e790e89dd7
18 changed files with 1271 additions and 914 deletions

View file

@ -22,6 +22,9 @@
*/
package org.x4o.fc18;
import java.util.HashSet;
import java.util.Set;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.x4o.fc18.cake2.FourCornerDotCake;
@ -36,10 +39,16 @@ public class FourCornerDotCakeTest {
@Test
public void testValues() throws Exception {
Set<Integer> startPoints = new HashSet<>();
for (FourCornerDotCake v : FourCornerDotCake.values()) {
Assertions.assertNotNull(v);
Assertions.assertNotNull(v.getVidePoints());
Assertions.assertNotNull(v.tower());
if (startPoints.contains(v.getStart())) {
throw new IllegalStateException("Duplicate start cake point: " + Integer.toHexString(v.getStart()) + " in " + v.name());
} else {
startPoints.add(v.getStart());
}
}
}

View file

@ -23,8 +23,12 @@
package org.x4o.fc18.cake2.pie9;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.PrimitiveIterator;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@ -32,10 +36,10 @@ import org.x4o.fc18.FourCornerUnicodeDisplay;
import org.x4o.fc18.cake2.FourCornerDotCake;
public class FCDotPIE9Test {
String pieChars;
String cakeChars;
public FCDotPIE9Test() {
int pieStart = FourCornerDotCake.FC_PIE9C_01.getStart();
int pieStop = FourCornerDotCake.FC_PIE9D_27.getStop();
@ -52,7 +56,7 @@ public class FCDotPIE9Test {
}
cakeChars = disp.renderFromInt18(cakePoints);
}
@Test
public void testUnusedUnicodeMath() throws Exception {
int totalMissing = 0;
@ -60,27 +64,21 @@ public class FCDotPIE9Test {
String testChar = new StringBuilder().appendCodePoint(i).toString();
if (!pieChars.contains(testChar)) {
totalMissing++;
//System.out.println(totalMissing + ":missing-test-chr: " + testChar);
// System.out.println(totalMissing + ":missing-test-chr: " + testChar);
}
}
Assertions.assertTrue(totalMissing < 128, "To many math chars missing....");
}
@Test
public void testUnusedKuTen1And2() throws Exception {
// see: https://www.msx.org/wiki/KuTen_-_JIS_-_SJIS_Code_Conversion_Tables
String kuTenPage1 = "、 。 , . ・ : ; ? ! ゛ ゜ ´ ` ¨"+
"^  ̄ _ ヽ ヾ ゝ ゞ 〃 仝 々 〆 〇 ー ― ‐ / " +
"\ ~ ∥ | … ‥ ‘ ’ “ ” ( ) 〔 〕 [ ]" +
" } 〈 〉 《 》 「 」 『 』 【 】 + - ± ×" +
"÷ = ≠ < > ≦ ≧ ∞ ∴ ♂ ♀ ° ′ ″ ℃ ¥" +
"$ ¢ £ % # & * @ § ☆ ★ ○ ● ◎ ◇ ";
String kuTenPage2 = "◆ □ ■ △ ▲ ▽ ▼ ※ 〒 → ← ↑ ↓ 〓" +
"∈ ∋ ⊆ ⊇ ⊂ ⊃" +
"∪ ∩ ∧ ∨ ¬ ⇒ ⇔ ∀ " +
"∃ ∠ ⊥ ⌒ ∂ " +
"∇ ≡ ≒ ≪ ≫ √ ∽ ∝ ∵ ∫ ∬" +
"Å ‰ ♯ ♭ ♪ † ‡ ¶ ◯";
String kuTenPage1 = "、。,.・:;?!゛゜´`¨" + "^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/"
+ "\~∥|…‥‘’“”()〔〕[]" + "}〈〉《》「」『』【】+-±×"
+ "÷=≠<>≦≧∞∴♂♀°′″℃¥" + "$¢£%#&*@§☆★○●◎◇";
String kuTenPage2 = "◆□■△▲▽▼※〒→←↑↓〓" + "∈∋⊆⊇⊂⊃"
+ "∪∩∧∨¬⇒⇔∀" + "∃∠⊥⌒∂"
+ "∇≡≒≪≫√∽∝∵∫∬" + "ʼn♯♭♪†‡¶◯";
String kuTen = (kuTenPage1 + kuTenPage2).replaceAll("\t", "").replaceAll(" ", "");
int totalMissing = 0;
PrimitiveIterator.OfInt charCheck = kuTen.codePoints().iterator();
@ -88,37 +86,57 @@ public class FCDotPIE9Test {
String testChar = new StringBuilder().appendCodePoint(charCheck.next()).toString();
if (!cakeChars.contains(testChar)) {
totalMissing++;
//System.out.println(totalMissing + ":missing-test-chr: " + testChar);
// System.out.println(totalMissing + ":missing-test-chr: " + testChar);
}
}
Assertions.assertTrue(totalMissing < 128, "To many kuten chars missing....");
}
@Test
public void testUnusedVGATempleOS() throws Exception {
// see: https://github.com/rendello/templeos_font/blob/master/Convert/chars.txt
String vgaTOSChars = " !\"#$%&'()*+,-./"+
"0123456789:;<=>?" +
"@ABCDEFGHIJKLMNO" +
"PQRSTUVWXYZ[\\]^_" +
"`abcdefghijklmno" +
"pqrstuvwxyz{|}~ " +
"çüéâäàȧ êëèïîìÄȦ" +
"ÉæÆôöòûùÿÖÜ¢£¥ 𝑓" +
"áíóú ¿ ½¼¡«»" +
"░▒▓│┤╡╢╖╕╣║╗╝╜╛┐" +
"└┴┬├─┼╞╟╚╔╩╦╠═╬╧" +
"╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀" +
"αβΓπΣσμτΦθΩδ∞ ε " +
"≡±≤≥ ÷≈ √ⁿ² " +
"ВГЁЖЗИЙЛПУФЧШЪЫЭ" +
"ЮЯбвгёжзийклмнпт" +
"чшъыьэюя „”№ " +
" ⅠⅡ↑↓⭰⭲ " +
"ДЦЩдф щ ij🔔 " +
" ⅓ ¾ §¶ ";
String vgaTOSChars = " !\"#$%&'()*+,-./" + "0123456789:;<=>?" + "@ABCDEFGHIJKLMNO" + "PQRSTUVWXYZ[\\]^_" + "`abcdefghijklmno" + "pqrstuvwxyz{|}~ "
+ "çüéâäàȧ êëèïîìÄȦ" + "ÉæÆôöòûùÿÖÜ¢£¥ 𝑓" + "áíóú ¿ ½¼¡«»" + "░▒▓│┤╡╢╖╕╣║╗╝╜╛┐" + "└┴┬├─┼╞╟╚╔╩╦╠═╬╧" + "╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀"
+ "αβΓπΣσμτΦθΩδ∞ ε " + "≡±≤≥ ÷≈ √ⁿ² " + "ВГЁЖЗИЙЛПУФЧШЪЫЭ" + "ЮЯбвгёжзийклмнпт" + "чшъыьэюя „”№ " + " ⅠⅡ↑↓⭰⭲ "
+ "ДЦЩдф щ ij🔔 " + " ⅓ ¾ §¶ ";
int totalMissing = 0;
PrimitiveIterator.OfInt charCheck = vgaTOSChars.codePoints().iterator();
while (charCheck.hasNext()) {
String testChar = new StringBuilder().appendCodePoint(charCheck.next()).toString();
if (!cakeChars.contains(testChar)) {
totalMissing++;
// System.out.println(totalMissing + ":missing-test-chr: " + testChar);
}
}
Assertions.assertTrue(totalMissing < 128, "To many temple os chars missing....");
}
@Test
public void testRussianLCGUnification() throws Exception {
String russianAlphabetString = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя";
Set<Character> russianSet = new HashSet<>();
for (char c : russianAlphabetString.toCharArray()) {
russianSet.add(c);
}
// todo missing: Ш (russian) -> W (upper latin W)
// todo missing: ш (russian) -> w (small latin w)
List<Character> latin = Arrays.asList('А', 'В', 'Е', 'К', 'М', 'Н', 'О', 'Р', 'С', 'Т', 'У', 'Х', 'а', 'е', 'о', 'р', 'с', 'у', 'х');
// todo missing: к (russian) -> κ (small greek k)
// todo missing: т (russian) -> τ (small greek t)
List<Character> greek = Arrays.asList( 'Ф', 'ф', 'П', 'п', 'Л');
List<Character> brascii = Arrays.asList( 'Ё', 'ё');
russianSet.removeAll( new HashSet<>(latin));
russianSet.removeAll( new HashSet<>(greek)); // 42
russianSet.removeAll( new HashSet<>(brascii));
Assertions.assertEquals(40, russianSet.size()); // need 44
String russianLCG = russianSet.stream().map(v -> new StringBuilder().append(v)).collect(Collectors.joining());
// System.out.println("russianLCG="+russianLCG);
// fixme: move some pair to lua like: Йй, Яя, Жж, Ээ, Дд and left over in pie slice
// fixme2: move dec27 to end, add one lua more, thus have space for 27 + 17 candy
int totalMissing = 0;
PrimitiveIterator.OfInt charCheck = russianLCG.codePoints().iterator();
while (charCheck.hasNext()) {
String testChar = new StringBuilder().appendCodePoint(charCheck.next()).toString();
if (!cakeChars.contains(testChar)) {
@ -126,6 +144,6 @@ public class FCDotPIE9Test {
//System.out.println(totalMissing + ":missing-test-chr: " + testChar);
}
}
Assertions.assertTrue(totalMissing < 128, "To many temple os chars missing....");
Assertions.assertTrue(totalMissing < 128, "To many russian chars missing....");
}
}

View file

@ -48,74 +48,76 @@ import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
public class StenoGrapherTest {
@Test
public void testSandWalker() throws Exception {
public void testSandWorm() throws Exception {
List<Integer> out = new ArrayList<>();
FourCornerZion7Candlelier writerX06 = FourCornerZionStenoGrapher.writerX06(out);
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(out);
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX06.strobeSandWalker(List.of(PrimordialOctal.PART_1));
writerX18.strobeSandWorm(List.of(PrimordialOctal.PART_1), List.of(PrimordialOctal.PART_1));
});
List<PrimordialOctal> octalMine = new ArrayList<>();
for (int i=0;i<24;i++) {
octalMine.add(PrimordialOctal.PART_1);
}
writerX06.strobeSandWalker(octalMine);
writerX18.strobeSandWorm(octalMine, List.of(PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1));
String res = FourCornerUnicodeDisplay.text().renderFromInt18(out);
Assertions.assertTrue(res.endsWith("PART_1PART_1"), "missing " + res);
}
@Test
public void testINT144Values() throws Exception {
public void testBASE2Values() throws Exception {
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
writerX18.strobeNumberINT144(BigInteger.valueOf(123));
writerX18.strobeWord(FCDotCDC1604DashP6.NY19_MINUS.ordinal());
writerX18.strobeNumberINT144(FourCornerZion7Petroglyphs.INT144_VALUE_MAX);
writerX18.strobeNumberINT144(BigInteger.valueOf(-123));
writerX18.strobeNumberBASE2(FourCornerZion7FremanBase2.SIGNED_0032, BigInteger.valueOf(123));
writerX18.strobeTheWord(FCDotCDC1604DashP6.NY09_EQUALS.ordinal());
writerX18.strobeNumberBASE2(FourCornerZion7FremanBase2.SIGNED_0128, BigInteger.valueOf(-123));
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals("123=-123", resX18);
}
@Test
public void testBASE8Values() throws Exception {
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
writerX18.strobeNumberBASE8(FourCornerZion7FremanBase8.SIGNED_0144, BigInteger.valueOf(123));
writerX18.strobeTheWord(FCDotCDC1604DashP6.NY19_MINUS.ordinal());
writerX18.strobeNumberBASE8(FourCornerZion7FremanBase8.SIGNED_0144, new BigInteger("11150372599265311570767859136324180752990207", 10));
writerX18.strobeNumberBASE8(FourCornerZion7FremanBase8.SIGNED_0144, BigInteger.valueOf(-123));
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals("123-11150372599265311570767859136324180752990207-123", resX18);
}
@Test
public void testDEC144Values() throws Exception {
public void testDEC576Values() throws Exception {
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
writerX18.strobeNumberDEC144(BigInteger.valueOf(123), 456);
writerX18.strobeWord(FCDotCDC1604DashP6.NY09_EQUALS.ordinal());
writerX18.strobeNumberDEC144(FourCornerZion7Petroglyphs.DEC144_COEFFICIENT_MAX, FourCornerZion7Petroglyphs.DEC144_EXPONENT_MAX);
writerX18.strobeNumberDEC576(BigInteger.valueOf(123), BigInteger.valueOf(456));
writerX18.strobeTheWord(FCDotCDC1604DashP6.NY09_EQUALS.ordinal());
writerX18.strobeNumberDEC576(FourCornerZion7Petroglyphs.DEC576_COEFFICIENT_MAX, FourCornerZion7Petroglyphs.DEC576_EXPONENT_MAX);
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals("123*10⁴⁵⁶=42535295865117307932921825928971026431*10¹³¹⁰⁷¹", resX18);
Assertions.assertEquals("123*10⁴⁵⁶=26187124863169134960105517574620793217733136368344518315866330944769070371237396439066160738607233257207093473020480568073738052367083144426628220715007*10²³⁶¹¹⁸³²⁴¹⁴³⁴⁸²²⁶⁰²⁷⁵²", resX18);
}
@Test
public void testFP144Values() throws Exception {
public void testE503M72Values() throws Exception {
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
writerX18.strobeNumberFP144(true, 456, BigInteger.valueOf(123));
writerX18.strobeWord(FCDotCDC1604DashP6.NY09_EQUALS.ordinal());
writerX18.strobeNumberFP144(false, FourCornerZion7Petroglyphs.FP144_EXPONENT_MAX, FourCornerZion7Petroglyphs.FP144_SIGNIFICAND_MAX);
writerX18.strobeNumberE503M72(true, BigInteger.valueOf(456), BigInteger.valueOf(123));
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals("(-1)¹*2⁴⁵⁶⁻¹²⁷*1.123=(-1)⁰*2¹³¹⁰⁷¹⁻¹²⁷*1.85070591730234615865843651857942052863", resX18);
Assertions.assertEquals("(-1)¹*2⁴⁵⁶⁻¹²⁷*1.123", resX18);
}
@Test
public void testNCRValues() throws Exception {
List<Integer> outX06 = new ArrayList<>();
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX06 = FourCornerZionStenoGrapher.writerX06(outX06);
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
BigInteger v1 = BigInteger.valueOf(123);
writerX06.strobeNumberNCR1632(BigInteger.ONE, v1);
writerX18.strobeNumberNCR1632(BigInteger.ONE, v1);
BigInteger v2 = BigInteger.valueOf(12345);
writerX06.strobeNumberNCR1632(BigInteger.ONE, v2);
writerX18.strobeNumberNCR1632(BigInteger.ONE, v2);
BigInteger v3 = BigInteger.valueOf(-5432);
writerX06.strobeNumberNCR1632(v3, v3);
writerX18.strobeNumberNCR1632(v3, v3);
String resX06 = FourCornerUnicodeDisplay.text().renderFromInt18(outX06);
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals(resX18, resX06);
Assertions.assertEquals("¹/₁₂₃¹/₁₂₃₄₅⁻⁵⁴³²/₋₅₄₃₂", resX06);
Assertions.assertEquals("¹/₁₂₃¹/₁₂₃₄₅⁻⁵⁴³²/₋₅₄₃₂", resX18);
}
//Test TODO: MOVE + fix java.io.IOException: Expected 9 bytes, got: 3 from PrimordialOctalOrangeString.ioSmurfReadStreamX8
@ -129,7 +131,7 @@ public class StenoGrapherTest {
for (int x = 1; x <= 1025 /*_999999*/; x++) {
BigInteger v = BigInteger.valueOf(x);
writerX18.strobeNumberNCR1632(BigInteger.ONE, v);
writerX18.strobeWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex());
writerX18.strobeTheWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex());
}
writerX18.strobeDocumentOmega();
PrimordialOctalOrangeString str = PrimordialOctalOrangeString.ioSmurfReadListX18(outX18);
@ -149,21 +151,13 @@ public class StenoGrapherTest {
@Test
public void testNCRCount1024() throws Exception {
List<Integer> outX06 = new ArrayList<>();
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX06 = FourCornerZionStenoGrapher.writerX06(outX06);
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
for (int x = 1; x <= 1025; x++) {
BigInteger v = BigInteger.valueOf(x);
writerX06.strobeNumberNCR1632(BigInteger.ONE, v);
writerX18.strobeNumberNCR1632(BigInteger.ONE, v);
}
String resX06 = FourCornerUnicodeDisplay.text().renderFromInt18(outX06);
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals(resX18, resX06);
Assertions.assertTrue(resX06.startsWith("¹/₁¹/₂¹/₃"), "missing " + resX06);
Assertions.assertTrue(resX06.contains("¹/₅₁₂¹/₅₁₃¹/₅₁₄"), "missing " + resX06);
Assertions.assertTrue(resX06.endsWith("¹/₁₀₂₃¹/₁₀₂₄¹/₁₀₂₅"), "missing " + resX06);
Assertions.assertTrue(resX18.startsWith("¹/₁¹/₂¹/₃"), "missing " + resX18);
Assertions.assertTrue(resX18.contains("¹/₅₁₂¹/₅₁₃¹/₅₁₄"), "missing " + resX18);
Assertions.assertTrue(resX18.endsWith("¹/₁₀₂₃¹/₁₀₂₄¹/₁₀₂₅"), "missing " + resX18);
@ -171,18 +165,9 @@ public class StenoGrapherTest {
@Test
public void testNCRMaxValue() throws Exception {
List<Integer> outX06 = new ArrayList<>();
List<Integer> outX18 = new ArrayList<>();
FourCornerZion7Candlelier writerX06 = FourCornerZionStenoGrapher.writerX06(outX06);
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
BigInteger maxValue = new BigInteger("7FFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF", 16);
writerX06.strobeNumberNCR1632(maxValue, maxValue);
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX06.strobeNumberNCR1632(maxValue, maxValue.add(BigInteger.ONE));
});
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX06.strobeNumberNCR1632(maxValue.add(BigInteger.ONE), maxValue);
});
writerX18.strobeNumberNCR1632(maxValue, maxValue);
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX18.strobeNumberNCR1632(maxValue, maxValue.add(BigInteger.ONE));

View file

@ -39,7 +39,7 @@ import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
* @version 1.0 Jan 14, 2025
*/
public class StenoLexerNCRTest {
@Test
public void testNCRSmokeSignals() throws Exception {
TestSmokeReader smokeReader = new TestSmokeReader();
@ -47,29 +47,29 @@ public class StenoLexerNCRTest {
lexer.withSmokeSignals(smokeReader);
List<Integer> cdc = new ArrayList<>();
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + (512*3) + 1); /// auto NXX_001
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart() + (512*3) + 1); /// auto NXX_001
Assertions.assertEquals(0, smokeReader.pipeSmokeClouds);
lexer.read(cdc);
Assertions.assertEquals(1, smokeReader.pipeSmokeClouds);
Assertions.assertEquals("burnNumberNCR1632MissingSparkler", smokeReader.pipeError);
cdc.addAll(FCDotDEC2701DashPX0.ESC_STOP.baklavaPointSequence()); // the print above auto value + next test
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() - 1 + 123); // normal NXX_123
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + (512*4) + 2); /// auto NXX_123 + this
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart() - 1 + 123); // normal NXX_123
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart() + (512*4) + 2); /// auto NXX_123 + this
smokeReader.reset();
lexer.read(cdc);
Assertions.assertEquals(2, smokeReader.pipeSmokeClouds);
cdc.addAll(FCDotDEC2701DashPX0.ESC_STOP.cakePointSequence()); // the print above auto value + next test (normal bank reset)
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 11);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + (512*3) + 12);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + (512*4) + 13);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + (512*5) + 14);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart()); // and one which prints
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 123); // normal NXX_123
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart() + 11);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart() + (512*3) + 12);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart() + (512*4) + 13);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart() + (512*5) + 14);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart()); // and one which prints
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart() + 123); // normal NXX_123
smokeReader.reset();
lexer.read(cdc);
String res = "[0:1:burnNumberNCR1632MissingSparkler][0:8:burnNumberNCR1632MissingSparkler]¹³⁷⁴³⁸⁹⁵³⁵⁹⁴/₁₃₄₂₁₇₇₃₉[0:16:burnNumberNCR1632MissingSparkler]";
String res = "[0:1:burnNumberNCR1632MissingSparkler][0:8:burnNumberNCR1632MissingSparkler][0:16:burnNumberNCR1632MissingSparkler]";
Assertions.assertEquals(res, FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
}
@ -79,37 +79,49 @@ public class StenoLexerNCRTest {
cdc.add(FCDotCDC1604DashP6.NX24_X.ordinal()); // = X
cdc.add(FCDotCDC1604DashP6.NY09_EQUALS.ordinal());
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 11);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 11);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 14);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 15);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 14);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 15);
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 123);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 512 + 2); // 1024
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 1); // +1 = 1025
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 123);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1); // 4096
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1); // +1 = 4097
cdc.add(FourCornerDotCake.FC_NCR1632_NUM.getStart() + 4);
cdc.add(FourCornerDotCake.FC_NCR1632_DEN.getStart() + 1);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 4);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStart());
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStart() + 1);
cdc.add(FCDotCDC1604DashP6.NY14_SEMICOLON.ordinal());
Assertions.assertEquals("X=¹¹/₁¹/₁¹⁴/₁₅¹²³/₁₀₂₅⁴/₁;", FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
Assertions.assertEquals("X=¹¹/₁¹/₁¹⁴/₁₅¹²³/₄₀₉₇⁴/₁;", FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
}
@Test
public void testNCRLargestF576() throws Exception {
List<Integer> cdc = new ArrayList<>();
for (int i = FourCornerDotCake.FC_NCR1632_NUM.getStop(); i >= FourCornerDotCake.FC_NCR1632_NUM.getStart(); i = i - 512) {
cdc.add(i);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL0N.getStop());
for (int i = FourCornerDotCake.FC_NCR1632_SEL0N.getStop(); i >= FourCornerDotCake.FC_NCR1632_SEL0N.getStart(); i--) {
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStop());
}
for (int i = FourCornerDotCake.FC_NCR1632_DEN.getStop(); i >= FourCornerDotCake.FC_NCR1632_DEN.getStart(); i = i - 512) {
cdc.add(i);
cdc.add(FourCornerDotCake.FC_NCR1632_SEL1D.getStop());
for (int i = FourCornerDotCake.FC_NCR1632_SEL1D.getStop(); i >= FourCornerDotCake.FC_NCR1632_SEL1D.getStart(); i--) {
cdc.add(FourCornerDotCake.FC_NCR1632_BANK.getStop());
}
String resSuper = "⁻¹⁹³²²⁶⁸⁷⁶¹⁵⁰⁸⁶²⁹¹⁷²³⁴⁷⁶⁷⁵⁹⁴⁵⁴⁶⁵⁹⁹³⁶⁷²¹⁴⁹⁴⁶³⁶⁶⁴⁸⁵³²¹⁷⁴⁹⁹³²⁸⁶¹⁷⁶²⁵⁷²⁵⁷⁵⁹⁵⁷¹¹⁴⁴⁷⁸⁰²¹²²⁶⁸⁰⁹⁶⁸⁸³²⁹⁰⁹⁶¹²⁸⁸⁹⁸¹²³¹⁸⁰⁸⁰¹⁵⁷⁵¹⁰⁸⁸⁵⁸⁸⁶⁸²⁵³⁹³³⁰⁵²¹⁴⁹³⁸²⁷⁸⁷¹⁴⁵⁴³³⁶⁷³³⁵⁴⁰³⁷⁴³⁴⁸⁴⁹⁰⁴⁰⁷⁴¹¹⁷¹¹";
String resSuber = "₋₁₉₃₂₂₆₈₇₆₁₅₀₈₆₂₉₁₇₂₃₄₇₆₇₅₉₄₅₄₆₅₉₉₃₆₇₂₁₄₉₄₆₃₆₆₄₈₅₃₂₁₇₄₉₉₃₂₈₆₁₇₆₂₅₇₂₅₇₅₉₅₇₁₁₄₄₇₈₀₂₁₂₂₆₈₀₉₆₈₈₃₂₉₀₉₆₁₂₈₈₉₈₁₂₃₁₈₀₈₀₁₅₇₅₁₀₈₈₅₈₈₆₈₂₅₃₉₃₃₀₅₂₁₄₉₃₈₂₇₈₇₁₄₅₄₃₃₆₇₃₃₅₄₀₃₇₄₃₄₈₄₉₀₄₀₇₄₁₁₇₁₁";
String resSuper = "⁻¹²³⁶⁶⁵²⁰⁰⁷³⁶⁵⁵²²⁶⁷⁰³⁰²⁵¹²⁶⁰⁵⁰⁹⁸²³⁵⁹⁵⁰¹⁷⁵⁶⁵⁶⁷⁴⁵⁵⁰⁶⁰⁵⁹¹⁹⁹⁵⁷⁰³¹⁵²⁸⁰⁴⁶⁴⁴⁸⁶¹²⁵⁵³²⁶⁵⁹³³⁵⁸⁵¹⁵⁸²⁰⁰⁵³⁰⁶²¹⁵²²⁴⁹⁴⁷⁹⁸⁸³⁵⁷¹³⁰⁰⁸⁰⁶⁹⁶⁶⁹⁶⁷⁵⁶⁸²⁵¹⁷¹⁵³³⁷⁵⁶⁰⁴⁹⁸³⁷⁷³⁰⁷⁷⁵⁵⁰⁹⁴⁶⁵⁸³⁹⁵⁸³⁰³³⁸⁶⁰⁷⁴³⁴⁹⁵⁶⁷";
String resSuber = "₋₁₂₃₆₆₅₂₀₀₇₃₆₅₅₂₂₆₇₀₃₀₂₅₁₂₆₀₅₀₉₈₂₃₅₉₅₀₁₇₅₆₅₆₇₄₅₅₀₆₀₅₉₁₉₉₅₇₀₃₁₅₂₈₀₄₆₄₄₈₆₁₂₅₅₃₂₆₅₉₃₃₅₈₅₁₅₈₂₀₀₅₃₀₆₂₁₅₂₂₄₉₄₇₉₈₈₃₅₇₁₃₀₀₈₀₆₉₆₆₉₆₇₅₆₈₂₅₁₇₁₅₃₃₇₅₆₀₄₉₈₃₇₇₃₀₇₇₅₅₀₉₄₆₅₈₃₉₅₈₃₀₃₃₈₆₀₇₄₃₄₉₅₆₇";
Assertions.assertEquals(resSuper + "/" + resSuber, FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
}
}