JPP: first pig sized baseX impl failed, added nether ring tone for later
This commit is contained in:
parent
631e1d8a25
commit
afff1297b2
3 changed files with 141 additions and 27 deletions
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* 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 ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface PrimordialOrdinalSpaceLimit extends PrimordialOrdinal {
|
||||
|
||||
int ordinalSpaceLimit();
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
|
|||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒢᔿᕽ.Vū́ǘrBȍőnSupportꞱᴿᴳᴮ;
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒢᔿᕽ.ᘁᓑᓑᣗ.Vū́ǘrBurnCounterᴶᴹˣ;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.PrimordialOrdinal;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.PrimordialOrdinalSpaceLimit;
|
||||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᐦ.Terminator𓄯;
|
||||
import ᒢᐩᐩ.ᒼᐤᒻᒻᓫᒼᐪᑊᐤᣕᔆ.ArrayLadderᴿᵂ;
|
||||
import ᒢᐩᐩ.ᒼᐤᒻᒻᓫᒼᐪᑊᐤᣕᔆ.Ladderᴿᵈ;
|
||||
|
|
@ -197,16 +198,22 @@ public enum TTꞱꞱᖟGateway implements BãßᛗᚢᛗᛗᛉVū́ǘrChaliceEnu
|
|||
}
|
||||
|
||||
// TODO change BãßᛗᚢᛗᛗᛉChaliceEnum and rename + update all TelraamRank classes to ordinal ?
|
||||
static abstract private class VirtualTerminator<T extends Terminator𓄯<T>> implements Terminator𓄯<T> {
|
||||
static abstract private class BoneTerminatorBaseX<T extends Terminator𓄯<T>> implements Terminator𓄯<T> {
|
||||
protected final int slices;
|
||||
protected final int slice;
|
||||
private final Ladderᵂʳ<T> values;
|
||||
private VirtualTerminator(int slices, int slice, Ladderᵂʳ<T> values) {
|
||||
private BoneTerminatorBaseX(int slices, int slice, Ladderᵂʳ<T> values) {
|
||||
if (slice > slices) {
|
||||
throw new IllegalArgumentException("Can't eat cake past one, slice to big: " + slice);
|
||||
}
|
||||
this.slices = slices;
|
||||
this.slice = slice;
|
||||
this.values = values;
|
||||
亞ᶦᶦᶦᶦ.thisʸᴰᐧᐧᶜᵒⁿˢᵗʳᵘᶜᵗᵒʳᐧᐧיהוה(thisᵀᴮᵒⁿᵉ());
|
||||
}
|
||||
private BoneTerminatorBaseX(int slices, int slice) {
|
||||
this(slices, slice, new ArrayLadderᴿᵂ<>());
|
||||
}
|
||||
protected void those(BiFunction<Ladderᵂʳ<T>, Integer, T> creator) {
|
||||
for (int i = 0; i < slices; i++) {
|
||||
values.addᵂʳ(creator.apply(values, i)); // redo: use lazy, so change telraam api
|
||||
|
|
@ -226,38 +233,43 @@ public enum TTꞱꞱᖟGateway implements BãßᛗᚢᛗᛗᛉVū́ǘrChaliceEnu
|
|||
return values; // TODO: remove enum from interface tree
|
||||
}
|
||||
}
|
||||
static private class BoneTerminatorBaseX<T extends Terminator𓄯<T>> extends VirtualTerminator<T> /*implements PremorialBaseX*/ {
|
||||
private BoneTerminatorBaseX(int slices, int slice, Ladderᵂʳ<T> values) {
|
||||
super(slices, slice, values);
|
||||
}
|
||||
public BoneTerminatorBaseX(int slices, int slice) {
|
||||
this(slices, slice, new ArrayLadderᴿᵂ<>());
|
||||
///those((v, i) -> (T) new BoneTerminatorBaseX(slices, i, v));
|
||||
}
|
||||
}
|
||||
|
||||
private interface PrimordialOrdinalChart extends PrimordialOrdinal {
|
||||
int indexLast();
|
||||
}
|
||||
private interface PrimordialOrdinalMutexBaseX {
|
||||
}
|
||||
private interface PrimordialOrdinalMutex<T extends PrimordialOrdinalMutexBaseX> extends PrimordialOrdinalChart {
|
||||
private interface PrimordialOrdinalMutex<T extends PrimordialOrdinalMutexBaseX> extends PrimordialOrdinalSpaceLimit {
|
||||
}
|
||||
private interface PrimordialOrdinalMutexBase1 extends PrimordialOrdinalMutexBaseX {
|
||||
static final int PART_0001 = 0;
|
||||
}
|
||||
// TODO: redo works in java/maven and (2slow) in OPEN eclipse but stack overflow on open workspace at pre-startup, type tree of 2k+ is to much...
|
||||
private interface PrimordialOrdinalMutexBase2 extends PrimordialOrdinalMutexBase1 {
|
||||
// change extends Base1 to BaseX and we have 2304 fields of part1 defining 0... (=ugly last resort test)
|
||||
//static final int PART_0001 = 0;
|
||||
static final int PART_0002 = 1;
|
||||
|
||||
// in nether db we define unique numbered parts per base like this; (equals to 2_655_360 interfaces for all bases up to 2304)
|
||||
//interface PrimordialOrdinalValueBase2Part1 extends PrimordialOrdinalBase2 {}
|
||||
//interface PrimordialOrdinalValueBase2Part2 extends PrimordialOrdinalBase2 {}
|
||||
//
|
||||
// check2-eclipse: if reuse number base part interface over bases then;
|
||||
// - part1 would have 2304 parents in one level...
|
||||
// - part2 would have 2303 parents in one level...
|
||||
//
|
||||
// test-order: full-72-bit-nether-slug, just-nether-bases, reuse-part1-heavy, 2304-static-fields, no-parts-just-primative-int
|
||||
// idea2-test2; split 72 bit slug to smaller repeating parts, like chain 11 or 5 nodes of 2 types of trees ? (to build a type tree for 2.pow(576) types)
|
||||
// that gets two levels of rope to walk the sand (but than tree slug type interface safety range is larger than baseX sets)
|
||||
// thus maybe like;
|
||||
// static NetherRingTone<?> PrimordialOrdinalBase2 = NetherSlug<SlugSlot6Part1,,,,,,,,b2>; // use generics to define all possible types with mutexed-types
|
||||
// static NetherRingTone<?> PrimordialOrdinalBase2PartX = NetherSlug<,,,,,,,b2,p1++>, NetherSlugBound<,,,,,,,b2,p2> {} // or one range super, so one method argument works
|
||||
}
|
||||
private interface PrimordialOrdinalBase1 extends PrimordialOrdinalMutexBase1, PrimordialOrdinalMutex<PrimordialOrdinalMutexBase1> {
|
||||
@Override
|
||||
default int indexLast() {
|
||||
default int ordinalSpaceLimit() {
|
||||
return PART_0001;
|
||||
}
|
||||
}
|
||||
private interface PrimordialOrdinalBase2 extends PrimordialOrdinalMutexBase2, PrimordialOrdinalMutex<PrimordialOrdinalMutexBase2> {
|
||||
@Override
|
||||
default int indexLast() {
|
||||
default int ordinalSpaceLimit() {
|
||||
return PART_0002;
|
||||
}
|
||||
}
|
||||
|
|
@ -301,10 +313,6 @@ public enum TTꞱꞱᖟGateway implements BãßᛗᚢᛗᛗᛉVū́ǘrChaliceEnu
|
|||
public Ladderᴿᵈ<? extends Terminator𓄯<?>> deliverPieSlices(int pieSlices) {
|
||||
//BoneOrdinalBase1 b1p1 = BoneOrdinalBase1.valueOf(BoneOrdinalBase1.PART_0001);
|
||||
//BoneOrdinalBase2 b2p1 = BoneOrdinalBase2.valueOf(BoneOrdinalBase2.PART_0001);
|
||||
//if (pieSlices == 1) {
|
||||
// return new BoneTerminatorBase1(0).teŀráàmWaardes();
|
||||
//}
|
||||
//return new BoneTerminatorBaseX(pieSlices, 0).teŀráàmWaardes();
|
||||
Vū́ǘrBurnCounterᴶᴹˣ counter = deliveryCounters.get(pieSlices);
|
||||
if (counter == null) {
|
||||
synchronized (deliveryCounters) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
|
@ -42,10 +41,65 @@ public class StibitsGenerator {
|
|||
|
||||
public static void main(String[] args) throws IOException {
|
||||
StibitsGenerator gen = new StibitsGenerator();
|
||||
gen.update(Arrays.asList(args).contains("generate"));
|
||||
boolean writeToFile = Arrays.asList(args).contains("generate");
|
||||
if (Arrays.asList(args).contains("stibits")) {
|
||||
gen.updateStibitz(writeToFile);
|
||||
} else if (Arrays.asList(args).contains("based")) {
|
||||
gen.updateBased(writeToFile);
|
||||
} else {
|
||||
System.err.println("No command given.");
|
||||
}
|
||||
}
|
||||
|
||||
private void update(boolean writeToFile) throws IOException {
|
||||
@Deprecated // breaks eclipse, todo rewrite to nether types
|
||||
private void updateBased(boolean writeToFile) throws IOException {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
generateHeaderPrelog(buf);
|
||||
generateHeaderBased(buf);
|
||||
buf.append("public enum PrimordialOrdinalBased");
|
||||
buf.append(" {\n");
|
||||
buf.append("\t;\n");
|
||||
|
||||
buf.append("\tprivate interface PrimordialOrdinalMutexBaseX {\n");
|
||||
buf.append("\t}\n");
|
||||
buf.append("\tprivate interface PrimordialOrdinalMutex<T extends PrimordialOrdinalMutexBaseX> extends PrimordialOrdinalSpaceLimit {\n");
|
||||
buf.append("\t}\n");
|
||||
buf.append("\t\n");
|
||||
for (int i = 1 ; i <= 2304; i++) {
|
||||
String partCode = String.format("PART_%04d", i);
|
||||
String clsMutex = "PrimordialOrdinalMutexBase" + i;
|
||||
String clsMutexPrev = "PrimordialOrdinalMutexBase" + (i - 1);
|
||||
if (i == 1) {
|
||||
clsMutexPrev = "PrimordialOrdinalMutexBaseX";
|
||||
}
|
||||
buf.append("\tprivate interface "+clsMutex+" extends "+clsMutexPrev+" {\n");
|
||||
buf.append("\t\tstatic final int " + partCode + " = " + (i - 1) + ";\n");
|
||||
buf.append("\t}\n");
|
||||
}
|
||||
buf.append("\t\n");
|
||||
for (int i = 1 ; i <= 2304; i++) {
|
||||
String partCode = String.format("PART_%04d", i);
|
||||
String clsBase = "PrimordialOrdinalBase" + i;
|
||||
String clsMutex = "PrimordialOrdinalMutexBase" + i;
|
||||
String clsMutexExt = ", PrimordialOrdinalMutex<" + clsMutex + ">";
|
||||
buf.append("\tpublic interface "+clsBase+" extends "+clsMutex+clsMutexExt+" {\n");
|
||||
buf.append("\t\t@Override\n");
|
||||
buf.append("\t\tdefault int ordinalSpaceLimit() {\n");
|
||||
buf.append("\t\t\treturn " + partCode + ";\n");
|
||||
buf.append("\t\t}\n");
|
||||
buf.append("\t}\n");
|
||||
}
|
||||
buf.append("\t\n");
|
||||
buf.append("}\n");
|
||||
String based = buf.toString();
|
||||
Path clazz = FileSystems.getDefault().getPath("src/main/java/ᒢᐩᐩ/ᒡᒢᑊᒻᒻᓫᔿ/PrimordialOrdinalBased.java");
|
||||
if (writeToFile) {
|
||||
Files.writeString(clazz, based);
|
||||
}
|
||||
System.out.println(based);
|
||||
}
|
||||
|
||||
private void updateStibitz(boolean writeToFile) throws IOException {
|
||||
String maxDigitNumber = Integer.toString(999);
|
||||
StringBuilder maxDigitFormat = new StringBuilder();
|
||||
for (int i=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;i<maxDigitNumber.length();i++) {
|
||||
|
|
@ -54,7 +108,8 @@ public class StibitsGenerator {
|
|||
for (int pieType:TTꞱꞱᖟGateway.亞.bakedPieSlices()) {
|
||||
String terminator = new DecimalFormat(maxDigitFormat.toString()).format(pieType);
|
||||
StringBuilder buf = new StringBuilder();
|
||||
generateHeader(buf, terminator);
|
||||
generateHeaderPrelog(buf);
|
||||
generateHeaderStibitz(buf, terminator);
|
||||
String clazzName = "T" + terminator + "ᖟᙾ";
|
||||
buf.append("public enum ");
|
||||
buf.append(clazzName);
|
||||
|
|
@ -110,7 +165,7 @@ public class StibitsGenerator {
|
|||
buf.append("\t}\n");
|
||||
}
|
||||
|
||||
private void generateHeader(StringBuilder buf, String terminator) {
|
||||
private void generateHeaderPrelog(StringBuilder buf) {
|
||||
buf.append("/*\n");
|
||||
buf.append(" * Copyright ©Δ∞ 仙上主天\n");
|
||||
buf.append(" * All rights reserved.\n");
|
||||
|
|
@ -138,6 +193,9 @@ public class StibitsGenerator {
|
|||
buf.append(" * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n");
|
||||
buf.append(" */\n");
|
||||
buf.append("\n");
|
||||
}
|
||||
|
||||
private void generateHeaderStibitz(StringBuilder buf, String terminator) {
|
||||
buf.append("package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᔆᐪᑊᒃᑊᐪᙆ;\n");
|
||||
buf.append("\n");
|
||||
buf.append("import java.lang.annotation.Documented;\n");
|
||||
|
|
@ -156,4 +214,14 @@ public class StibitsGenerator {
|
|||
buf.append("@DuytsDocAuthor注(name = \"للَّٰهِilLצسُو\", copyright = \"©Δ∞ 仙上主天\")\n");
|
||||
buf.append("@ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ(ᐆᒧᖓ = \"𑀳𑁂𑀮𑀺𑀉𑁄𑀤𑁄𑀭𑁂𑀡𑀪𑀸𑀕\")\n");
|
||||
}
|
||||
|
||||
private void generateHeaderBased(StringBuilder buf) {
|
||||
buf.append("package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;\n");
|
||||
buf.append("\n");
|
||||
buf.append("import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣔᣕᣕᐤᐪᣔᐪᑊᐤᣕ.ᐧᣞᣛ.ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ;\n");
|
||||
buf.append("import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;\n");
|
||||
buf.append("\n");
|
||||
buf.append("@DuytsDocAuthor注(name = \"للَّٰهِilLצسُو\", copyright = \"©Δ∞ 仙上主天\")\n");
|
||||
buf.append("@ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ(ᐆᒧᖓ = \"𑀳𑁂𑀮𑀺𑀉𑁄𑀤𑁄𑀭𑁂𑀡𑀪𑀸𑀕\")\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue