MAG (my array generator) is the latest evolution of a proposed CA (cellular automata) algorithm. 

It is written in C++ (previous version in C) and consists of MyArrayGenerator.cpp class file 
and corresponding MyArrayGenerator.h header file. 

The driver program for creating a 32-bit binary file is CreateRandomFile.cpp. 
When the driver is executed you will be prompted to enter the desired file size 
in Megabytes and at least one integer as a seed. 

This latest version differs from previous versions, which were made by filling the array 
with a relatively random stream of integers (similar procedure as Merssene Twister initialization 
with a linear congruential generator).
 
In this latest version, the MAG algorithm is used as the initialization of the working array. 

If only a few integers are entered (even one), the value/s is/are assigned to each element in the array. 
Then the array is preprocessed by "MAG with the carry increment" (doShuffle() method)
to ensure that the array falls in the 3rd class CA (chaotic state).
 
Transition from the seed to the initial state bears one2one correspondence. 
There is no loss of complexity to the stream generated (in the random sense)
if fewer seed integers are entered but it is easier to retrieve simpler seed/s 
from the crypto-point of view.

The class MyArrayGenerator has the ability to work with various array sizes. 
Just initialize the array with a desired array size in the driver: 
line 	MyArrayGenerator generator; 
becames MyArrayGenerator generator("insert here whatever array size you want");

Also, the period can be checked. In this case the driver may look as follows:

#include "MyArrayGenerator.h"

int main()
{
	//creating arrays
	MyArrayGenerator generator, initial, lastState;
	
	//geting parametar for desired file size
	unsigned long int roundSize = generator.getEvolutionSize();
	
	//geting seeds
	generator.getIntegerSeedFromKeyboard();
	
	//preprocessing
	generator.doShuffle();
	initial = generator;
	
	//creating random stream
	generator.getLastState(roundSize);
	lastState = generator;
		
	unsigned long int check = initial.checkPeriodPattern(roundSize,lastState);  
	
	cout << check << endl;

	return 0;
}

