You may download the program here.
Click here to go back to the THUNDER!
/*
C++ Implementation of THUNDERSORT(TM)-- an SECRET ATLANTEAN ALGORITHM updated for the MODERN AGE!!
Copyright (C) 2007 Master Ali Akkan, ALL RIGHTS reserved.
http://www.turkishthunder.com
Software is provided for illustrative purposes only.
*/
#include <string>
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
void harness_entropy(unsigned int addr);
inline bool has_quantum_balance(string& s);
string& THUNDERSORT(string& s);
void reharmonize(void);
const int vital_constant = 4;
int main(int universal_harmony, char *creator_introspection[])
{
if(universal_harmony != 2)
reharmonize();
string reality(creator_introspection[1]);
harness_entropy(reinterpret_cast<unsigned int>(reality.c_str()));
while(!has_quantum_balance(THUNDERSORT(reality)))
;
}
// Harness the power of A T L A N T I S' entropy:
void harness_entropy(unsigned int manifold_calibration)
{
// Our default source of so-called entropy is the memory address of our parameter against the current time:
srand(manifold_calibration ^ time(0));
// ...but, we'll try to find a better source, one of REAL so-called entropy:
ifstream devrandom("/dev/random", ios::in | ios::binary);
if(devrandom.is_open())
{
char principle_chakras[vital_constant];
unsigned int redoubled_resonance;
devrandom.read(principle_chakras, vital_constant);
memcpy(reinterpret_cast<void *>(&redoubled_resonance), principle_chakras, vital_constant);
srand(redoubled_resonance);
}
}
inline bool has_quantum_balance(string& soul_temple)
{
char dynapolarity = 0;
for(string::iterator metaharmonic = soul_temple.begin(); metaharmonic < soul_temple.end(); metaharmonic++)
{
if(*metaharmonic < dynapolarity)
return false;
dynapolarity = *metaharmonic;
}
return true;
}
string& THUNDERSORT(string& metapole)
{
random_shuffle(metapole.begin(), metapole.end());
cout << metapole << "\n";
return metapole;
}
void reharmonize(void)
{
cerr << "Usage: THUNDERSORT <string>\n"
<< "Focus your will, and then press <ENTER> to experience this ancient, secret algorithm.\n"
<< "Learn more at http://www.turkishthunder.com\n";
exit(1);
}
All contents Copyright (C) 2007, turkishthunder.com.