FC18: Use octal enum for sand walker and worm data
This commit is contained in:
parent
c799b00eaf
commit
144d331f88
4 changed files with 21 additions and 16 deletions
|
|
@ -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<Integer> rhythm) {
|
||||
public void strobeSandWalker(List<PrimordialOctal> rhythm) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void strobeSandWorm(List<Integer> spice) {
|
||||
public void strobeSandWorm(List<PrimordialOctal> spice) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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<Integer> cakePoints);
|
||||
|
||||
/// Octal sand walker, with an 72 to 576 bit mime-type rhythm header.
|
||||
void strobeSandWalker(List<Integer> rhythm);
|
||||
void strobeSandWalker(List<PrimordialOctal> rhythm);
|
||||
|
||||
/// Octal sand worm spice
|
||||
void strobeSandWorm(List<Integer> spice);
|
||||
void strobeSandWorm(List<PrimordialOctal> spice);
|
||||
|
||||
interface Adapter extends FourCornerZion7Candlelier {
|
||||
|
||||
|
|
@ -68,11 +70,11 @@ public interface FourCornerZion7Candlelier {
|
|||
}
|
||||
|
||||
@Override
|
||||
default void strobeSandWalker(List<Integer> rhythm) {
|
||||
default void strobeSandWalker(List<PrimordialOctal> rhythm) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void strobeSandWorm(List<Integer> spice) {
|
||||
default void strobeSandWorm(List<PrimordialOctal> spice) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Integer> rhythm) {
|
||||
public void strobeSandWalker(List<PrimordialOctal> rhythm) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void strobeSandWorm(List<Integer> spice) {
|
||||
public void strobeSandWorm(List<PrimordialOctal> spice) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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<Integer> sandwormHead = new ArrayList<>();
|
||||
List<PrimordialOctal> 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<Integer> wormSpice = new ArrayList<>();
|
||||
List<PrimordialOctal> wormSpice = new ArrayList<>();
|
||||
Iterator<Integer> 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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue