FC18: Split sound tones from primordial octal thought form
This commit is contained in:
parent
136088a332
commit
2249099bc0
12 changed files with 183 additions and 140 deletions
|
|
@ -33,7 +33,7 @@ import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.x4o.fc18.octal8.PrimordialOctal;
|
import org.x4o.fc18.octal8.PrimordialOctalSound;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctalIterator;
|
import org.x4o.fc18.octal8.PrimordialOctalIterator;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctalOrangeJuice;
|
import org.x4o.fc18.octal8.PrimordialOctalOrangeJuice;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctalOrangeJuiceStraw;
|
import org.x4o.fc18.octal8.PrimordialOctalOrangeJuiceStraw;
|
||||||
|
|
@ -76,7 +76,7 @@ public final class TLVChainOctalSex
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dataReadStream(InputStream input) throws IOException {
|
public void dataReadStream(InputStream input) throws IOException {
|
||||||
dataReadIterator(PrimordialOctalIterator.valuesFrom(PrimordialOctal.valuesOfSmurfs(input)));
|
dataReadIterator(PrimordialOctalIterator.valuesFrom(PrimordialOctalSound.valuesOfSmurfs(input)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -95,7 +95,7 @@ public final class TLVChainOctalSex
|
||||||
for (int dataIdx = 0; dataIdx < data.length; dataIdx++) {
|
for (int dataIdx = 0; dataIdx < data.length; dataIdx++) {
|
||||||
PrimordialOctalIterator.valuesTo(octals, data[dataIdx].baitOctalIterator());
|
PrimordialOctalIterator.valuesTo(octals, data[dataIdx].baitOctalIterator());
|
||||||
}
|
}
|
||||||
PrimordialOctal.valuesToSmurfs(output, PrimordialOctalIterator.valuesFrom(octals));
|
PrimordialOctalSound.valuesToSmurfs(output, PrimordialOctalIterator.valuesFrom(octals));
|
||||||
output.flush();
|
output.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -287,9 +287,9 @@ public class FourCornerUnicodeDisplay {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void strobeSandWorm(List<PrimordialOctal> sandWalk, List<PrimordialOctal> sandSpice) {
|
public void strobeSandWorm(List<PrimordialOctal> sandWalk, List<PrimordialOctal> sandSpice) {
|
||||||
// todo; select plugin for renderer
|
// TODO; select plugin for renderer ELSE print octals with number grams
|
||||||
sandWalk.forEach(v -> output.append(v.name()));
|
sandWalk.forEach(v -> output.append(v.ordinal()));
|
||||||
sandSpice.forEach(v -> output.append(v.name()));
|
sandSpice.forEach(v -> output.append(v.ordinal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -27,118 +27,11 @@
|
||||||
|
|
||||||
package org.x4o.fc18.octal8;
|
package org.x4o.fc18.octal8;
|
||||||
|
|
||||||
import java.io.IOException;
|
/// Primordial octal thought form.
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/// Primative octal bait value.
|
|
||||||
///
|
///
|
||||||
/// @author للَّٰهِilLצسُو
|
/// @author للَّٰهِilLצسُو
|
||||||
/// @version ©Δ∞ 仙上主天
|
/// @version ©Δ∞ 仙上主天
|
||||||
public enum PrimordialOctal implements PrimordialOctalSkullBait {
|
public interface PrimordialOctal {
|
||||||
|
|
||||||
PART_1,
|
int ordinal();
|
||||||
PART_2,
|
|
||||||
PART_3,
|
|
||||||
PART_4,
|
|
||||||
PART_5,
|
|
||||||
PART_6,
|
|
||||||
PART_7,
|
|
||||||
PART_8,
|
|
||||||
;
|
|
||||||
|
|
||||||
static public final int OCTAL_MASK = 0b111;
|
|
||||||
static public final int OCTAL_BITS = 3;
|
|
||||||
static private final PrimordialOctal[] VALUES = values();
|
|
||||||
static private final int STREAM_EOF = -1;
|
|
||||||
static private final int SHIFT_8 = 8;
|
|
||||||
static private final int SHIFT_16 = 16;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public byte ordinalOctalBait() {
|
|
||||||
return (byte) ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int ordinalOctalBitShifter() {
|
|
||||||
return ordinal() * OCTAL_BITS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int ordinalOctalShiftSmurf(PrimordialOctalSkullBait shifter) {
|
|
||||||
return ordinal() << shifter.ordinalOctalBitShifter();
|
|
||||||
}
|
|
||||||
|
|
||||||
static public PrimordialOctal valueOfOctalShift(int value, PrimordialOctal shifter) {
|
|
||||||
return valueOf((value >> shifter.ordinalOctalBitShifter()) & OCTAL_MASK);
|
|
||||||
}
|
|
||||||
|
|
||||||
static public PrimordialOctal valueOf(int index) {
|
|
||||||
return VALUES[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
static public List<PrimordialOctal> valuesOfSmurfs(InputStream input) throws IOException {
|
|
||||||
int brickTapeLengthBytes = 9;
|
|
||||||
List<PrimordialOctal> octals = new ArrayList<>();
|
|
||||||
byte[] data = new byte[brickTapeLengthBytes];
|
|
||||||
int readDataSize = 0; // per 9 bytes we have 24 octals for four PrimordialOctalOrangeJuice glasses
|
|
||||||
while ((readDataSize = input.read(data, 0, data.length)) != STREAM_EOF) {
|
|
||||||
if (readDataSize < brickTapeLengthBytes) {
|
|
||||||
throw new IOException("Expected " + brickTapeLengthBytes + " bytes, got: " + readDataSize);
|
|
||||||
}
|
|
||||||
int v0 = (data[0] & 0xFF) + ((data[1] << SHIFT_8) & 0xFF00) + ((data[2] << SHIFT_16) & 0xFF0000);
|
|
||||||
int v1 = (data[3] & 0xFF) + ((data[4] << SHIFT_8) & 0xFF00) + ((data[5] << SHIFT_16) & 0xFF0000);
|
|
||||||
int v2 = (data[6] & 0xFF) + ((data[7] << SHIFT_8) & 0xFF00) + ((data[8] << SHIFT_16) & 0xFF0000);
|
|
||||||
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_1));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_2));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_3));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_4));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_5));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_6));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_7));
|
|
||||||
octals.add(valueOfOctalShift(v0, PART_8));
|
|
||||||
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_1));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_2));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_3));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_4));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_5));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_6));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_7));
|
|
||||||
octals.add(valueOfOctalShift(v1, PART_8));
|
|
||||||
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_1));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_2));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_3));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_4));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_5));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_6));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_7));
|
|
||||||
octals.add(valueOfOctalShift(v2, PART_8));
|
|
||||||
}
|
|
||||||
return octals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static public int valuesToSmurfs(OutputStream output, PrimordialOctalIterator read) throws IOException {
|
|
||||||
int totalBytes = 0;
|
|
||||||
while (read.hasNext()) {
|
|
||||||
int byteTriplet = 0;
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_1);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_2);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_3);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_4);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_5);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_6);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_7);
|
|
||||||
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_8);
|
|
||||||
output.write(byteTriplet);
|
|
||||||
output.write(byteTriplet >> SHIFT_8);
|
|
||||||
output.write(byteTriplet >> SHIFT_16);
|
|
||||||
totalBytes += 3;
|
|
||||||
}
|
|
||||||
return totalBytes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,14 +67,14 @@ public interface PrimordialOctalIterator extends PrimitiveIterator<PrimordialOct
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PrimordialOctalSkullBait next() {
|
public PrimordialOctalSkullBait next() {
|
||||||
return PrimordialOctal.PART_1;
|
return PrimordialOctalSound.PART_1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static PrimordialOctalIterator valueTapeRecord(int number) {
|
static PrimordialOctalIterator valueTapeRecord(int number) {
|
||||||
List<PrimordialOctalSkullBait> octals = new ArrayList<>(6);
|
List<PrimordialOctalSkullBait> octals = new ArrayList<>(6);
|
||||||
for (int i = 5; i >= 0; i--) {
|
for (int i = 5; i >= 0; i--) {
|
||||||
octals.add(PrimordialOctal.valueOf((number >> (i * 3)) & 0b111));
|
octals.add(PrimordialOctalSound.valueOf((number >> (i * 3)) & 0b111));
|
||||||
}
|
}
|
||||||
return valuesFrom(octals);
|
return valuesFrom(octals);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ public enum PrimordialOctalOrangeHinari {
|
||||||
for (int i=0;i<gunId.codePoints().count();i++) {
|
for (int i=0;i<gunId.codePoints().count();i++) {
|
||||||
int gunPoint = gunId.codePoints().skip(i).findFirst().getAsInt();
|
int gunPoint = gunId.codePoints().skip(i).findFirst().getAsInt();
|
||||||
if (codePoint == gunPoint) {
|
if (codePoint == gunPoint) {
|
||||||
octals.add(PrimordialOctal.valueOf(i));
|
octals.add(PrimordialOctalSound.valueOf(i));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public final class PrimordialOctalOrangeSexWord implements PrimordialOctalOrange
|
||||||
}
|
}
|
||||||
|
|
||||||
static public List<PrimordialOctalOrangeSexWord> valuesOfSmurfs(InputStream input) throws IOException {
|
static public List<PrimordialOctalOrangeSexWord> valuesOfSmurfs(InputStream input) throws IOException {
|
||||||
List<PrimordialOctal> octals = PrimordialOctal.valuesOfSmurfs(input);
|
List<PrimordialOctalSound> octals = PrimordialOctalSound.valuesOfSmurfs(input);
|
||||||
PrimordialOctalIterator octalIterator = PrimordialOctalIterator.valuesFrom(octals);
|
PrimordialOctalIterator octalIterator = PrimordialOctalIterator.valuesFrom(octals);
|
||||||
List<PrimordialOctalOrangeSexWord> result = new ArrayList<>();
|
List<PrimordialOctalOrangeSexWord> result = new ArrayList<>();
|
||||||
int octalCount = 6;
|
int octalCount = 6;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ public final class PrimordialOctalOrangeString implements PrimordialOctalOrangeJ
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ioSmurfWriteStreamX8(OutputStream output, PrimordialOctalOrangeString str) throws IOException {
|
public static void ioSmurfWriteStreamX8(OutputStream output, PrimordialOctalOrangeString str) throws IOException {
|
||||||
PrimordialOctal.valuesToSmurfs(output, str.baitOctalIterator());
|
PrimordialOctalSound.valuesToSmurfs(output, str.baitOctalIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PrimordialOctalOrangeString ioSmurfReadStreamX8(InputStream input) throws IOException {
|
public static PrimordialOctalOrangeString ioSmurfReadStreamX8(InputStream input) throws IOException {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,148 @@
|
||||||
|
/*
|
||||||
|
* Copyright ©Δ∞ 仙上主天
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||||
|
* that the following conditions are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||||
|
* following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
|
||||||
|
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
|
||||||
|
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
|
||||||
|
* even on air gaped systems, all information in the universe is owned by the pi creator.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
|
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||||
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||||
|
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.x4o.fc18.octal8;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/// Primordial octal sound value.
|
||||||
|
///
|
||||||
|
/// @author للَّٰهِilLצسُو
|
||||||
|
/// @version ©Δ∞ 仙上主天
|
||||||
|
public enum PrimordialOctalSound implements PrimordialOctal, PrimordialOctalSkullBait {
|
||||||
|
|
||||||
|
PART_1,
|
||||||
|
PART_2,
|
||||||
|
PART_3,
|
||||||
|
PART_4,
|
||||||
|
PART_5,
|
||||||
|
PART_6,
|
||||||
|
PART_7,
|
||||||
|
PART_8,
|
||||||
|
;
|
||||||
|
|
||||||
|
static public final int OCTAL_MASK = 0b111;
|
||||||
|
static public final int OCTAL_BITS = 3;
|
||||||
|
static private final PrimordialOctalSound[] VALUES = values();
|
||||||
|
static private final int STREAM_EOF = -1;
|
||||||
|
static private final int SHIFT_8 = 8;
|
||||||
|
static private final int SHIFT_16 = 16;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte ordinalOctalBait() {
|
||||||
|
return (byte) ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int ordinalOctalBitShifter() {
|
||||||
|
return ordinal() * OCTAL_BITS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int ordinalOctalShiftSmurf(PrimordialOctalSkullBait shifter) {
|
||||||
|
return ordinal() << shifter.ordinalOctalBitShifter();
|
||||||
|
}
|
||||||
|
|
||||||
|
static public PrimordialOctalSound valueOfOctalShift(int value, PrimordialOctalSound shifter) {
|
||||||
|
return valueOf((value >> shifter.ordinalOctalBitShifter()) & OCTAL_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
|
static public PrimordialOctalSound valueOf(int index) {
|
||||||
|
return VALUES[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
static public PrimordialOctalSound valueOf(PrimordialOctal octal) {
|
||||||
|
return valueOf(octal.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
static public List<PrimordialOctalSound> valuesOfSmurfs(InputStream input) throws IOException {
|
||||||
|
int brickTapeLengthBytes = 9;
|
||||||
|
List<PrimordialOctalSound> octals = new ArrayList<>();
|
||||||
|
byte[] data = new byte[brickTapeLengthBytes];
|
||||||
|
int readDataSize = 0; // per 9 bytes we have 24 octals for four PrimordialOctalOrangeJuice glasses
|
||||||
|
while ((readDataSize = input.read(data, 0, data.length)) != STREAM_EOF) {
|
||||||
|
if (readDataSize < brickTapeLengthBytes) {
|
||||||
|
throw new IOException("Expected " + brickTapeLengthBytes + " bytes, got: " + readDataSize);
|
||||||
|
}
|
||||||
|
int v0 = (data[0] & 0xFF) + ((data[1] << SHIFT_8) & 0xFF00) + ((data[2] << SHIFT_16) & 0xFF0000);
|
||||||
|
int v1 = (data[3] & 0xFF) + ((data[4] << SHIFT_8) & 0xFF00) + ((data[5] << SHIFT_16) & 0xFF0000);
|
||||||
|
int v2 = (data[6] & 0xFF) + ((data[7] << SHIFT_8) & 0xFF00) + ((data[8] << SHIFT_16) & 0xFF0000);
|
||||||
|
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_1));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_2));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_3));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_4));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_5));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_6));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_7));
|
||||||
|
octals.add(valueOfOctalShift(v0, PART_8));
|
||||||
|
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_1));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_2));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_3));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_4));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_5));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_6));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_7));
|
||||||
|
octals.add(valueOfOctalShift(v1, PART_8));
|
||||||
|
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_1));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_2));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_3));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_4));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_5));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_6));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_7));
|
||||||
|
octals.add(valueOfOctalShift(v2, PART_8));
|
||||||
|
}
|
||||||
|
return octals;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public int valuesToSmurfs(OutputStream output, PrimordialOctalIterator read) throws IOException {
|
||||||
|
int totalBytes = 0;
|
||||||
|
while (read.hasNext()) {
|
||||||
|
int byteTriplet = 0;
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_1);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_2);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_3);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_4);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_5);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_6);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_7);
|
||||||
|
byteTriplet += !read.hasNext()?0:read.next().ordinalOctalShiftSmurf(PART_8);
|
||||||
|
output.write(byteTriplet);
|
||||||
|
output.write(byteTriplet >> SHIFT_8);
|
||||||
|
output.write(byteTriplet >> SHIFT_16);
|
||||||
|
totalBytes += 3;
|
||||||
|
}
|
||||||
|
return totalBytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -39,16 +39,16 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit {
|
||||||
/// Embed one or more number grams of the given supported base degree type.
|
/// Embed one or more number grams of the given supported base degree type.
|
||||||
void strobeNumberGrams(FCFlameNumberGram gram, List<Integer> values);
|
void strobeNumberGrams(FCFlameNumberGram gram, List<Integer> values);
|
||||||
|
|
||||||
/// Embed choco married pig rational number. (4+1148+4+1148)
|
/// Embed choco pig rational number. (4+1148+4+1148)
|
||||||
void strobeNumberChocoPigRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator);
|
void strobeNumberChocoPigRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator);
|
||||||
|
|
||||||
/// Embed choco pig decimal number. (4+1+283+2016)
|
/// Embed choco pig decimal point number. (4+1+283+2016)
|
||||||
void strobeNumberChocoPigDecimal(FCFlameNumberTaste taste, boolean bias, BigInteger power, BigInteger coefficient);
|
void strobeNumberChocoPigDecimal(FCFlameNumberTaste taste, boolean bias, BigInteger power, BigInteger coefficient);
|
||||||
|
|
||||||
/// Embed choco pig floating point number. (4+1+283+2016)
|
/// Embed choco pig floating point number. (4+1+283+2016)
|
||||||
void strobeNumberChocoPigFloat(FCFlameNumberTaste taste, boolean bias, BigInteger exponent, BigInteger mantissa);
|
void strobeNumberChocoPigFloat(FCFlameNumberTaste taste, boolean bias, BigInteger exponent, BigInteger mantissa);
|
||||||
|
|
||||||
/// Embed fixed point number. (4+1148+1152)
|
/// Embed choped pig point number. (4+1148+1152)
|
||||||
void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction);
|
void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction);
|
||||||
// XDBX18: doom.wad uses (ARM) Q16.16 which is equal to the real (Texas) Q15.16 (because doom map like E2M3 = 6 bit float)
|
// XDBX18: doom.wad uses (ARM) Q16.16 which is equal to the real (Texas) Q15.16 (because doom map like E2M3 = 6 bit float)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import org.x4o.fc18.cake2.zero33.dec1.FCDotCMD5401Dash2D;
|
||||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
|
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
|
||||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotINC0801DashP8;
|
import org.x4o.fc18.cake2.zero33.dec1.FCDotINC0801DashP8;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctal;
|
import org.x4o.fc18.octal8.PrimordialOctal;
|
||||||
|
import org.x4o.fc18.octal8.PrimordialOctalSound;
|
||||||
import org.x4o.fc18.zion7.flame4.FCFlameFremanChocoBase8;
|
import org.x4o.fc18.zion7.flame4.FCFlameFremanChocoBase8;
|
||||||
import org.x4o.fc18.zion7.flame4.FCFlameFremanLegoBase2;
|
import org.x4o.fc18.zion7.flame4.FCFlameFremanLegoBase2;
|
||||||
import org.x4o.fc18.zion7.flame4.FCFlameFremanLegoBase8;
|
import org.x4o.fc18.zion7.flame4.FCFlameFremanLegoBase8;
|
||||||
|
|
@ -492,21 +493,21 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
||||||
Iterator<Integer> i12 = sandWalk12.iterator();
|
Iterator<Integer> i12 = sandWalk12.iterator();
|
||||||
while (i12.hasNext()) {
|
while (i12.hasNext()) {
|
||||||
int bitValue12 = i12.next();
|
int bitValue12 = i12.next();
|
||||||
sandWalk.add(PrimordialOctal.valueOf((bitValue12 >> 9) & 0b111));
|
sandWalk.add(PrimordialOctalSound.valueOf((bitValue12 >> 9) & 0b111));
|
||||||
sandWalk.add(PrimordialOctal.valueOf((bitValue12 >> 6) & 0b111));
|
sandWalk.add(PrimordialOctalSound.valueOf((bitValue12 >> 6) & 0b111));
|
||||||
sandWalk.add(PrimordialOctal.valueOf((bitValue12 >> 3) & 0b111));
|
sandWalk.add(PrimordialOctalSound.valueOf((bitValue12 >> 3) & 0b111));
|
||||||
sandWalk.add(PrimordialOctal.valueOf((bitValue12 >> 0) & 0b111));
|
sandWalk.add(PrimordialOctalSound.valueOf((bitValue12 >> 0) & 0b111));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PrimordialOctal> sandSpice = new ArrayList<>();
|
List<PrimordialOctal> sandSpice = new ArrayList<>();
|
||||||
Iterator<Integer> i15 = sandSpice15.iterator();
|
Iterator<Integer> i15 = sandSpice15.iterator();
|
||||||
while (i15.hasNext()) {
|
while (i15.hasNext()) {
|
||||||
int bitValue15 = i15.next();
|
int bitValue15 = i15.next();
|
||||||
sandSpice.add(PrimordialOctal.valueOf((bitValue15 >> 12) & 0b111));
|
sandSpice.add(PrimordialOctalSound.valueOf((bitValue15 >> 12) & 0b111));
|
||||||
sandSpice.add(PrimordialOctal.valueOf((bitValue15 >> 9) & 0b111));
|
sandSpice.add(PrimordialOctalSound.valueOf((bitValue15 >> 9) & 0b111));
|
||||||
sandSpice.add(PrimordialOctal.valueOf((bitValue15 >> 6) & 0b111));
|
sandSpice.add(PrimordialOctalSound.valueOf((bitValue15 >> 6) & 0b111));
|
||||||
sandSpice.add(PrimordialOctal.valueOf((bitValue15 >> 3) & 0b111));
|
sandSpice.add(PrimordialOctalSound.valueOf((bitValue15 >> 3) & 0b111));
|
||||||
sandSpice.add(PrimordialOctal.valueOf((bitValue15 >> 0) & 0b111));
|
sandSpice.add(PrimordialOctalSound.valueOf((bitValue15 >> 0) & 0b111));
|
||||||
}
|
}
|
||||||
if (!FourCornerZionStenoPetroglyphs.SAND_WORM_SIGNS.contains(sandWalk.size())) {
|
if (!FourCornerZionStenoPetroglyphs.SAND_WORM_SIGNS.contains(sandWalk.size())) {
|
||||||
lexer.smokeSignals.burnSandWalkerStepUnaligned(lexer.currLine, lexer.currCol, -1); // TODO: fixme
|
lexer.smokeSignals.burnSandWalkerStepUnaligned(lexer.currLine, lexer.currCol, -1); // TODO: fixme
|
||||||
|
|
@ -883,9 +884,9 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sandWalker) {
|
if (sandWalker) {
|
||||||
sandWalk.add(PrimordialOctal.valueOf(cdcPoint - FCDotCDC1604DashP6.NX01_A.cakePointDotIndex()));
|
sandWalk.add(PrimordialOctalSound.valueOf(cdcPoint - FCDotCDC1604DashP6.NX01_A.cakePointDotIndex()));
|
||||||
} else {
|
} else {
|
||||||
sandSpice.add(PrimordialOctal.valueOf(cdcPoint - FCDotCDC1604DashP6.NX01_A.cakePointDotIndex()));
|
sandSpice.add(PrimordialOctalSound.valueOf(cdcPoint - FCDotCDC1604DashP6.NX01_A.cakePointDotIndex()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: add signal
|
// TODO: add signal
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public class PrimordialOctalOrangeSexWordTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOctalMSB() throws Exception {
|
public void testOctalMSB() throws Exception {
|
||||||
PrimordialOctalOrangeSexWord word = new PrimordialOctalOrangeSexWord(PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_2, PrimordialOctal.PART_8, PrimordialOctal.PART_8);
|
PrimordialOctalOrangeSexWord word = new PrimordialOctalOrangeSexWord(PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_2, PrimordialOctalSound.PART_8, PrimordialOctalSound.PART_8);
|
||||||
Assertions.assertEquals(127, word.baitOctalNumber());
|
Assertions.assertEquals(127, word.baitOctalNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.x4o.fc18.FourCornerUnicodeDisplay;
|
import org.x4o.fc18.FourCornerUnicodeDisplay;
|
||||||
import org.x4o.fc18.cake2.flag4.FCDotF4TTY0001DashNL;
|
import org.x4o.fc18.cake2.flag4.FCDotF4TTY0001DashNL;
|
||||||
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
||||||
|
import org.x4o.fc18.octal8.PrimordialOctalSound;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctal;
|
import org.x4o.fc18.octal8.PrimordialOctal;
|
||||||
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
|
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
|
||||||
import org.x4o.fc18.zion7.flame4.FCFlameNumberTaste;
|
import org.x4o.fc18.zion7.flame4.FCFlameNumberTaste;
|
||||||
|
|
@ -83,15 +84,15 @@ public class StenoGrapherTest {
|
||||||
List<Integer> out = new ArrayList<>();
|
List<Integer> out = new ArrayList<>();
|
||||||
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(out);
|
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(out);
|
||||||
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
||||||
writerX18.strobeSandWorm(List.of(PrimordialOctal.PART_1), List.of(PrimordialOctal.PART_1));
|
writerX18.strobeSandWorm(List.of(PrimordialOctalSound.PART_1), List.of(PrimordialOctalSound.PART_1));
|
||||||
});
|
});
|
||||||
List<PrimordialOctal> octalMine = new ArrayList<>();
|
List<PrimordialOctal> octalMine = new ArrayList<>();
|
||||||
for (int i=0;i<24;i++) {
|
for (int i=0;i<24;i++) {
|
||||||
octalMine.add(PrimordialOctal.PART_1);
|
octalMine.add(PrimordialOctalSound.PART_1);
|
||||||
}
|
}
|
||||||
writerX18.strobeSandWorm(octalMine, List.of(PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1, PrimordialOctal.PART_1));
|
writerX18.strobeSandWorm(octalMine, List.of(PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1, PrimordialOctalSound.PART_1));
|
||||||
String res = FourCornerUnicodeDisplay.text().renderFromInt18(out);
|
String res = FourCornerUnicodeDisplay.text().renderFromInt18(out);
|
||||||
Assertions.assertTrue(res.endsWith("PART_1PART_1"), "missing " + res);
|
Assertions.assertTrue(res.endsWith("00"), "missing " + res);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Test TODO: MOVE + fix java.io.IOException: Expected 9 bytes, got: 3 from PrimordialOctalOrangeString.ioSmurfReadStreamX8
|
//Test TODO: MOVE + fix java.io.IOException: Expected 9 bytes, got: 3 from PrimordialOctalOrangeString.ioSmurfReadStreamX8
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue