Easter cleaning

This commit is contained in:
Willem Cazander 2025-05-07 21:46:32 +02:00
commit 9e36078b2e
1862 changed files with 270281 additions and 0 deletions

View file

@ -0,0 +1,144 @@
/*
* 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;
/// Primative octal bait value.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum PrimordialOctal implements 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 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;
}
}

View file

@ -0,0 +1,48 @@
/*
* 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;
/// Bait based octal consumer.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
@FunctionalInterface
public interface PrimordialOctalConsumer {
void accept(PrimordialOctalSkullBait value);
default PrimordialOctalConsumer andThen(PrimordialOctalConsumer after) {
return new PrimordialOctalConsumer() {
@Override
public void accept(PrimordialOctalSkullBait value) {
PrimordialOctalConsumer.this.accept(value);
after.accept(value);
}
};
}
}

View file

@ -0,0 +1,111 @@
/*
* 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.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.PrimitiveIterator;
import java.util.function.Consumer;
/// Skull bait based octal iterator.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface PrimordialOctalIterator extends PrimitiveIterator<PrimordialOctalSkullBait, PrimordialOctalConsumer> {
default byte nextBait() {
return next().ordinalOctalBait();
}
@Override
default void forEachRemaining(Consumer<? super PrimordialOctalSkullBait> action) {
while (hasNext()) {
action.accept(next());
}
}
@Override
default void forEachRemaining(PrimordialOctalConsumer action) {
while (hasNext()) {
action.accept(next());
}
}
static PrimordialOctalIterator = new PrimordialOctalIterator() {
@Override
public boolean hasNext() {
return true;
}
@Override
public PrimordialOctalSkullBait next() {
return PrimordialOctal.PART_1;
}
};
static PrimordialOctalIterator valueTapeRecord(int number) {
List<PrimordialOctalSkullBait> octals = new ArrayList<>(6);
for (int i = 5; i >= 0; i--) {
octals.add(PrimordialOctal.valueOf((number >> (i * 3)) & 0b111));
}
return valuesFrom(octals);
}
static int valueTapePlay(PrimordialOctalIterator iterator) {
int value = 0;
for (int i = 5; i >= 0; i--) {
value += (iterator.next().ordinalOctalBait() << (i * 3));
}
return value;
}
static PrimordialOctalIterator valuesFrom(Collection<? extends PrimordialOctalSkullBait> values) {
return new PrimordialOctalIterator() {
private final Iterator<? extends PrimordialOctalSkullBait> iterator = values.iterator();
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public PrimordialOctalSkullBait next() {
return iterator.next();
}
};
}
static void valuesTo(List<PrimordialOctalSkullBait> sink, PrimordialOctalIterator values) {
while (values.hasNext()) {
sink.add(values.next());
}
}
}

View file

@ -0,0 +1,125 @@
/*
* 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.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.PrimitiveIterator;
/// Print and parse hinari to display The Word octals.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum PrimordialOctalOrangeHinari {
;
private final static String VALUES_3 = "י"+"ײ"+"ױ"+"װ"+"ר"+"ד"+"ז"+"ו";
private final static String VALUES_6 = "\u05BD"+"\u05B5"+"\u05B6"+"\u05B2"+"\u05B3"+"\u05BB"+"\u05B0"+"\u05B7";
private final static String VALUES_9 = "\u0594"+"\u0595"+"\u05A9"+"\u059F"+"\u0598"+"\u05A0"+"\u059E"+"\u059D";
public String printHinari(PrimordialOctalOrangeJuice value) {
StringBuilder buf = new StringBuilder();
printHinari(value, buf);
return buf.toString();
}
public void printHinari(PrimordialOctalOrangeJuice value, StringBuilder buf) {
PrimordialOctalIterator i3 = value.baitOctalIterator();
while (i3.hasNext()) {
buf.appendCodePoint(VALUES_3.codePoints().skip(i3.next().ordinalOctalBait()).findFirst().getAsInt());
if (i3.hasNext()) {
buf.appendCodePoint(VALUES_6.codePoints().skip(i3.next().ordinalOctalBait()).findFirst().getAsInt());
}
if (i3.hasNext()) {
buf.appendCodePoint(VALUES_9.codePoints().skip(i3.next().ordinalOctalBait()).findFirst().getAsInt());
}
}
}
public List<PrimordialOctalOrangeSexWord> parseHinari(String input) {
List<PrimordialOctalSkullBait> octals = new ArrayList<>();
PrimitiveIterator.OfInt codePoints = input.codePoints().iterator();
while (codePoints.hasNext()) {
int v = codePoints.nextInt();
parseHinari(codePoints, octals, v);
}
List<PrimordialOctalOrangeSexWord> result = new ArrayList<>();
Iterator<PrimordialOctalSkullBait> octalIterator = octals.iterator();
PrimordialOctalIterator i3 = new PrimordialOctalIterator() {
@Override
public PrimordialOctalSkullBait next() {
return octalIterator.next();
}
@Override
public boolean hasNext() {
return octalIterator.hasNext();
}
};
int octalCount = 6;
int octalTypeSize = octals.size() / octalCount;
for (int i=0;i<octalTypeSize;i++) {
result.add(PrimordialOctalOrangeSexWord.valueOfOctals(i3));
}
return result;
}
private void parseHinari(PrimitiveIterator.OfInt codePoints, List<PrimordialOctalSkullBait> octals, int currentCodePoint) {
int v3 = currentCodePoint;
if (!parseGunWound(v3, VALUES_3, octals)) {
throw new IllegalArgumentException("Illegal hinari char: "+Integer.toHexString(v3));
}
if (!codePoints.hasNext()) {
throw new IllegalArgumentException("Missing supplement6 code point.");
}
int v6 = codePoints.nextInt();
if (!parseGunWound(v6, VALUES_6, octals)) {
parseHinari(codePoints, octals, v6);
}
if (!codePoints.hasNext()) {
throw new IllegalArgumentException("Missing supplement9 code point.");
}
int v9 = codePoints.nextInt();
if (!parseGunWound(v9, VALUES_9, octals)) {
parseHinari(codePoints, octals, v9);
}
}
private boolean parseGunWound(int codePoint, String gunId, List<PrimordialOctalSkullBait> octals) {
for (int i=0;i<gunId.codePoints().count();i++) {
int gunPoint = gunId.codePoints().skip(i).findFirst().getAsInt();
if (codePoint == gunPoint) {
octals.add(PrimordialOctal.valueOf(i));
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,73 @@
/*
* 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;
/// Primordial octal skulls to speak juicy hinari.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface PrimordialOctalOrangeJuice extends PrimordialOctalSkullBaitIterable {
static int MAX_VALUE = 262143;
// The network order is big-endian = MSB first
/*
PrimordialOctalSkullBait toOctalBaitRightRed(); // humans count from right like clock,
PrimordialOctalSkullBait toOctalBaitRightWhite(); // thus this is really the left side of an number
PrimordialOctalSkullBait toOctalBaitRightBlue();
PrimordialOctalSkullBait toOctalBaitLeftBlue();
PrimordialOctalSkullBait toOctalBaitLeftWhite();
PrimordialOctalSkullBait toOctalBaitLeftRed(); // the right side of the number = LSB
*/
PrimordialOctalSkullBait baitOctal(int index); // thus ZERO must be MSB
default int baitOctalNumber() {
return PrimordialOctalIterator.valueTapePlay(baitOctalIterator());
}
default PrimordialOctalIterator baitOctalIterator() {
return new PrimordialOctalIterator() {
private int count = 0;
@Override
public boolean hasNext() {
return count < 6;
}
@Override
public PrimordialOctalSkullBait next() {
try {
return baitOctal(count);
} finally {
count++;
}
}
};
}
}

View file

@ -0,0 +1,77 @@
/*
* 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.util.function.Consumer;
/// Primordial octal string of juice atoms.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface PrimordialOctalOrangeJuiceStraw extends PrimordialOctalSkullBaitIterable {
int length();
PrimordialOctalOrangeJuice juiceAt(int idx);
PrimordialOctalOrangeJuice[] toJuiceArray();
default void juiceForEach(Consumer<PrimordialOctalOrangeJuice> action) {
for (int i = 0; i < length(); i++) {
action.accept(juiceAt(i));
}
}
default PrimordialOctalIterator baitOctalIterator() {
return new PrimordialOctalIterator() {
PrimordialOctalIterator currentIterator;
int currentIndex = 0;
@Override
public boolean hasNext() {
if (currentIterator != null && currentIterator.hasNext()) {
return true;
}
if (length() == 0) {
return false;
}
if (currentIndex >= length()) {
return false;
}
currentIterator = juiceAt(currentIndex).baitOctalIterator();
currentIndex++;
return currentIterator.hasNext();
}
@Override
public PrimordialOctalSkullBait next() {
return currentIterator.next();
}
};
}
}

View file

@ -0,0 +1,113 @@
/*
* 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.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/// A single octal 18 bit word.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class PrimordialOctalOrangeSexWord implements PrimordialOctalOrangeJuice {
private final PrimordialOctalSkullBait[] octals; // MSB = 0
public PrimordialOctalOrangeSexWord(PrimordialOctalSkullBait octalBaitRightRed, PrimordialOctalSkullBait octalBaitRightWhite,
PrimordialOctalSkullBait octalBaitRightBlue, PrimordialOctalSkullBait octalBaitLeftBlue, PrimordialOctalSkullBait octalBaitLeftWhite,
PrimordialOctalSkullBait octalBaitLeftRed) {
this.octals = new PrimordialOctalSkullBait[6];
this.octals[0] = octalBaitRightRed;
this.octals[1] = octalBaitRightWhite;
this.octals[2] = octalBaitRightBlue;
this.octals[3] = octalBaitLeftBlue;
this.octals[4] = octalBaitLeftWhite;
this.octals[5] = octalBaitLeftRed;
}
@Override
public PrimordialOctalSkullBait baitOctal(int index) {
return octals[index];
}
@Override
public String toString() {
return PrimordialOctalOrangeHinari..printHinari(this);
}
@Override
public int hashCode() {
return Arrays.hashCode(octals);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PrimordialOctalOrangeSexWord other = (PrimordialOctalOrangeSexWord) obj;
return Arrays.equals(octals, other.octals);
}
static public PrimordialOctalOrangeSexWord valueOfOne() {
return valueOfOctals(PrimordialOctalIterator.);
}
static public PrimordialOctalOrangeSexWord valueOfSmurf(int smurf) {
return valueOfOctals(PrimordialOctalIterator.valueTapeRecord(smurf));
}
static public PrimordialOctalOrangeSexWord valueOfOctals(PrimordialOctalIterator values) {
return new PrimordialOctalOrangeSexWord(values.next(), values.next(), values.next(), values.next(), values.next(), values.next());
}
static public List<PrimordialOctalOrangeSexWord> valuesOfSmurfs(InputStream input) throws IOException {
List<PrimordialOctal> octals = PrimordialOctal.valuesOfSmurfs(input);
PrimordialOctalIterator octalIterator = PrimordialOctalIterator.valuesFrom(octals);
List<PrimordialOctalOrangeSexWord> result = new ArrayList<>();
int octalCount = 6;
int octalTypeSize = octals.size() / octalCount;
for (int i = 0; i < octalTypeSize; i++) {
result.add(valueOfOctals(octalIterator));
}
return result;
}
static public List<PrimordialOctalOrangeSexWord> valuesOfHinari(String input) throws IOException {
return PrimordialOctalOrangeHinari..parseHinari(input);
}
}

View file

@ -0,0 +1,127 @@
/*
* 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.Arrays;
import java.util.List;
import java.util.Objects;
/// A string of 18 bit octals.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class PrimordialOctalOrangeString implements PrimordialOctalOrangeJuiceStraw {
private final static PrimordialOctalOrangeString EMPTY = new PrimordialOctalOrangeString(new PrimordialOctalOrangeJuice[] {});
private final PrimordialOctalOrangeJuice[] words;
public PrimordialOctalOrangeString(PrimordialOctalOrangeJuice[] words) {
this.words = Objects.requireNonNull(words);
}
@Override
public int length() {
return words.length;
}
@Override
public PrimordialOctalOrangeJuice juiceAt(int idx) {
return words[idx];
}
@Override
public PrimordialOctalOrangeJuice[] toJuiceArray() {
return Arrays.copyOf(words, words.length);
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < words.length; i++) {
PrimordialOctalOrangeHinari..printHinari(words[i], buf);
}
return buf.toString();
}
@Override
public int hashCode() {
return Arrays.hashCode(words);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return Arrays.equals(words, PrimordialOctalOrangeString.class.cast(obj).words);
}
public static PrimordialOctalOrangeString valueOfEmpty() {
return EMPTY;
}
public static PrimordialOctalOrangeString valueOfHinari(String hinari) {
return valueOfJuice(PrimordialOctalOrangeHinari..parseHinari(hinari));
}
@Deprecated
public static PrimordialOctalOrangeString valueOfSmurfs(List<Integer> words) {
return ioSmurfRead18List(words);
}
public static PrimordialOctalOrangeString valueOfJuice(List<? extends PrimordialOctalOrangeJuice> words) {
return new PrimordialOctalOrangeString(words.toArray(new PrimordialOctalOrangeJuice[] {}));
}
public static void ioSmurfWrite18List(List<Integer> output, PrimordialOctalOrangeString str) {
for (int i = 0; i < str.length(); i++) {
output.add(str.juiceAt(i).baitOctalNumber());
}
}
public static PrimordialOctalOrangeString ioSmurfRead18List(List<Integer> words) {
return valueOfJuice(words.stream().map(v -> PrimordialOctalOrangeSexWord.valueOfSmurf(v)).toList());
}
public static void ioSmurfWrite8Stream(OutputStream output, PrimordialOctalOrangeString str) throws IOException {
PrimordialOctal.valuesToSmurfs(output, str.baitOctalIterator());
}
public static PrimordialOctalOrangeString ioSmurfRead8Stream(InputStream input) throws IOException {
return PrimordialOctalOrangeString.valueOfJuice(PrimordialOctalOrangeSexWord.valuesOfSmurfs(input));
}
}

View file

@ -0,0 +1,41 @@
/*
* 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;
/// Bait based octal skull.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface PrimordialOctalSkullBait {
byte ordinalOctalBait();
int ordinalOctalBitShifter();
int ordinalOctalShiftSmurf(PrimordialOctalSkullBait shifter);
}

View file

@ -0,0 +1,54 @@
/*
* 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.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.Collector;
import java.util.stream.StreamSupport;
/// Bait based octal skull iterable listings.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface PrimordialOctalSkullBaitIterable {
PrimordialOctalIterator baitOctalIterator();
default void baitOctalForEach(PrimordialOctalConsumer action) {
baitOctalIterator().forEachRemaining(action);
}
default Spliterator<PrimordialOctalSkullBait> baitOctalSpliterator() {
return Spliterators.spliteratorUnknownSize(baitOctalIterator(), Spliterator.ORDERED);
}
default <A, R> R baitOctalCollect(Collector<? super PrimordialOctalSkullBait, A, R> collector) {
return StreamSupport.stream(baitOctalSpliterator(), false).collect(collector);
}
}

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2004-2014, Willem Cazander
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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.
*/
/**
* Bytes based octal interface.
*
*
* @since 1.0
*/
package org.x4o.fc18.octal8;