Made space for sand worms in the cake

This commit is contained in:
Willem Cazander 2025-01-18 16:11:48 +01:00
parent 456c14d7d4
commit 35fd0e9f23
4 changed files with 39 additions and 20 deletions

View file

@ -251,7 +251,7 @@ public class FourCornerUnicodeDisplay {
}
@Override
public void strobeNether(List<Integer> key, List<Integer> octals) {
public void strobeSandWorm(List<Integer> head, List<Integer> body) {
// TODO Auto-generated method stub
}

View file

@ -251,14 +251,18 @@ public enum FourCornerDotCake {
FC_CLK1K_Z(131072 + (1024*25), 1024),
FC_CLK1K_AMP(131072 + (1024*26), 1024),
/// Align unicode
__RESERVED_CLKSP(1 + FC_CLK1K_AMP.getStop(), 0x27000 - FC_CLK1K_AMP.getStop() - 1, "Reserved for CLKSP"),
/// Text structure control indicators
__RESERVED_STRUCT(1 + FC_CLK1K_AMP.getStop(), 0x27000 - 576 - 1 - FC_CLK1K_AMP.getStop(), "Reserved for STRUCT"),
// =========== Allow more data grams for legacy unicode and next generation unicode
/// MUST Prefix with __ESC18_NETHER, than pack big indian octals per 5, which is 15 bit data in one 18 bit cake point.
/// This can encode dark text data like icons, bitmap images or vector images and unicode4D/etc.
FC_NETHER(0x27000, 32768, "Dark octal data"),
/// Preamble of a sand worm body as a identifiable type header.
/// Octal worm encoding are 192 unique octals in ordered sequence and have allowed length of 24/48/96 or 192.
FC_SAND_OLGOI(0x27000 - 576, 576, "Large head of logoi worm"),
/// Undefined octal data which are packed big indian octals per 5, which is a 15 bit data gram in one 18 bit cake point.
/// This can encode sand worm text data like icons, bitmap images or vector images and unicode4D/etc.
FC_SAND_KHORKHOI(0x27000, 32768, "Sand octals of large khorkhoi"),
/// Support lower 11 bit of unicode to be encoded with one cake point.
FC_UNI2K_11(0x30000 - 4096, 2048, "Unicode page point"),
@ -339,7 +343,7 @@ public enum FourCornerDotCake {
if (idx < FC_IBM1616_H8.ordinal()) {
return false;
}
if (idx >= FC_UNI2K_11.ordinal()) {
if (idx > FC_CLK1K_AMP.ordinal()) {
return false;
}
return true;

View file

@ -33,12 +33,12 @@ import org.x4o.fc18.cake2.FourCornerDotCake;
/// @version 1.0 Jan 09, 2025
public interface FourCornerZion7Candlelier {
/// Block of relative word slice offsets.
void strobeWords(FourCornerDotCake slice, List<Integer> offsets);
/// Single word from slice.
void strobeWord(FourCornerDotCake slice, int offset);
/// Block of relative word slice offsets.
void strobeWords(FourCornerDotCake slice, List<Integer> offsets);
/// 1152 bit fractions of two 576 bit numbers.
void strobeNCR1632(BigInteger denominator, BigInteger numerator);
@ -48,8 +48,8 @@ public interface FourCornerZion7Candlelier {
/// Allows a 6 bit computer to use the nether,fractions or unicode.
void strobeRecursiveCake(List<Integer> cakePoints);
/// Dark octal data, with up to 576 bit mime-type data type header.
void strobeNether(List<Integer> key, List<Integer> octals);
/// Octal sand worm, with up to 576 bit mime-type data type header.
void strobeSandWorm(List<Integer> head, List<Integer> body);
interface Adapter extends FourCornerZion7Candlelier {
@ -74,7 +74,7 @@ public interface FourCornerZion7Candlelier {
}
@Override
default void strobeNether(List<Integer> key, List<Integer> octals) {
default void strobeSandWorm(List<Integer> head, List<Integer> body) {
}
}
}

View file

@ -94,8 +94,11 @@ public class FourCornerZionStenoLexer {
if (FourCornerDotCake.FC_UNI2K_22.equals(cakeSlice)) {
continue; // parse block manually
}
if (FourCornerDotCake.FC_NETHER.equals(cakeSlice)) {
continue; // merge the nether data to octals manually
if (FourCornerDotCake.FC_SAND_OLGOI.equals(cakeSlice)) {
continue; // parse nether head manually
}
if (FourCornerDotCake.FC_SAND_KHORKHOI.equals(cakeSlice)) {
continue; // parse nether body manually
}
if (FourCornerDotCake.FC_NCR1632_XD.equals(cakeSlice)) {
continue; // parse block manually
@ -108,7 +111,8 @@ public class FourCornerZionStenoLexer {
this.scanners.add(new StenoScannerCDCDEC());
this.scanners.add(new StenoScannerNCR18());
this.scanners.add(new StenoScannerUNI21());
this.scanners.add(new StenoScannerNether());
this.scanners.add(new StenoScannerSandOlgoi());
this.scanners.add(new StenoScannerSandKhorkhoi());
}
public FourCornerZionStenoLexer withSmokeSignals(FourCornerZionStenoLexerSmoke smokeSignals) {
@ -274,10 +278,21 @@ public class FourCornerZionStenoLexer {
}
}
static class StenoScannerNether extends StenoScanner {
static class StenoScannerSandOlgoi extends StenoScanner {
public StenoScannerNether() {
super(FourCornerDotCake.FC_NETHER);
public StenoScannerSandOlgoi() {
super(FourCornerDotCake.FC_SAND_OLGOI);
}
@Override
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
}
}
static class StenoScannerSandKhorkhoi extends StenoScanner {
public StenoScannerSandKhorkhoi() {
super(FourCornerDotCake.FC_SAND_KHORKHOI);
}
@Override
@ -286,7 +301,7 @@ public class FourCornerZionStenoLexer {
private void handlePoints(FourCornerZionStenoLexer lexer, List<Integer> slicedPoints) {
// TODO: convert from 15 bit to 3 bit
lexer.handler.strobeNether(null, slicedPoints);
lexer.handler.strobeSandWorm(null, slicedPoints);
}
}