Skip to content

Commit

Permalink
c͠h̙ǎ‎‎‏‎‏n‏̶g‎̦‏e‎͏‏ ‎‎s‏‏ͬt‎͜‏‎y‏̕l‎̉‏‎‎e‏‏̲
Browse files Browse the repository at this point in the history
  • Loading branch information
GlennFolker committed Nov 2, 2020
1 parent 2d0bfbd commit 6775027
Showing 1 changed file with 23 additions and 39 deletions.
62 changes: 23 additions & 39 deletions src/namegen/NameGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import java.awt.*;
import java.awt.datatransfer.*;
import java.io.*;
import java.util.*;

public class NameGen{
private static Random rand = new Random();
private static boolean exit = false;

public static synchronized void main(String[] args){
Expand Down Expand Up @@ -49,62 +51,44 @@ public static synchronized void name(BufferedReader reader) throws IOException{
String name = reader.readLine().replace("\\n", Character.toString('\n'));

StringBuilder result = new StringBuilder();
int last, num = 0;

for(int iteration = 0; iteration < 3; iteration++){
for(int i = 0; i < name.length(); i++){
last = num;

int a = name.codePointAt((i - 1 + name.length()) % name.length());
int b = name.codePointAt((i + 1 + name.length()) % name.length());
int n = name.codePointAt(i);

num = (n << a >> b) ^ (n >> a << b);

for(int h = 0; h < 2; h++){
int f = name.codePointAt(Math.abs((num + name.length()) % name.length()));

if(num <= last){
num ^= f;
}else{
num >>= f;
}
}
for(int i = 0; i < name.length(); i++){
int min = 0x0300;
int max = 0x036F;
int range = max - min;

int seed = 768 + (num % 111);
int seedB = 710 + (num % 19);
int seedC = num <= last ? seed : seedB;
rand.setSeed(i);
int seed = min + rand.nextInt(range + 1);

char c = name.charAt(i);
char c = name.charAt(i);

result.append(Character.toString(c));
if(!Character.isWhitespace(c)){
result.append(Character.toString(seedC));
}
result.append(Character.toString(c));
if(!Character.isWhitespace(c)){
result.append(Character.toString(seed));
}
}

int iterations = 3, freq = iterations * 2;

for(int it = 0; it < iterations; it++){
name = result.toString();
result.setLength(0);
}

int iterations = 3, freq = iterations * 2;
for(int iteration = 0; iteration < iterations; iteration++){
for(int i = 0; i < name.length(); i++){
char c = name.charAt(i);
result.append(Character.toString(c));

if((i + iteration % (freq + 1)) == freq){
String a = Character.toString(8206) + Character.toString(c) + Character.toString(8207);
a = Character.toString(8238) + a + Character.toString(8234);

if(i % (freq + 1) == freq){
CharSequence a = Character.toString(8206) + Character.toString(c) + Character.toString(8207);
result.append(a);
}else{
result.append(Character.toString(c));
}
}

name = result.toString();
result.setLength(0);
}

name = result.toString();
result.setLength(0);

boolean success = setClipboardString(name);
if(success){
Log.log(LogLevel.info, "Generated name has been copied to clipboard!");
Expand Down

0 comments on commit 6775027

Please sign in to comment.