Data update
This commit is contained in:
parent
9817d9b99b
commit
07c7092a52
140 changed files with 2712 additions and 241 deletions
|
|
@ -0,0 +1,30 @@
|
|||
public class ElementaryCellularAutomatonRandomNumberGenerator {
|
||||
|
||||
public static void main(String[] aArgs) {
|
||||
final int seed = 989898989;
|
||||
evolve(seed, 30);
|
||||
}
|
||||
|
||||
private static void evolve(int aState, int aRule) {
|
||||
long state = aState;
|
||||
for ( int i = 0; i <= 9; i++ ) {
|
||||
int b = 0;
|
||||
for ( int q = 7; q >= 0; q-- ) {
|
||||
long stateCopy = state;
|
||||
b |= ( stateCopy & 1 ) << q;
|
||||
state = 0;
|
||||
for ( int j = 0; j < BIT_COUNT; j++ ) {
|
||||
long t = ( stateCopy >>> ( j - 1 ) ) | ( stateCopy << ( BIT_COUNT + 1 - j ) ) & 7;
|
||||
if ( ( aRule & ( 1L << t ) ) != 0 ) {
|
||||
state |= 1 << j;
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.print(" " + b);
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
private static final int BIT_COUNT = 64;
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue