Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Sorting algorithm

Name: Help 2011-04-15 11:56

>http://en.wikipedia.org/wiki/Quater-imaginary_base#Converting_into_quater-imaginary


ConvertToBase2i(int num) //int num is base 10
{
 int length = 1; //length of new number
 int power = 1; //origin (x^n)

 while(num < 3*(4^power)) //maximum possible value is 3 times
{
 ++length; ++power;
 if(power % 2 == 1)
   ++length; ++power;
}

int array[length]; //this will be at least large enough
int arrayValue = 0;

do{
 //**HERE**
 //Need to arrange the possible coefficeints {0,1,2,3} to get the correct answer. ([a]-[b]+[c]-[d]+[e]-...)
 //Then test those numbers:
 //for(int j = 0; j < length; ++j)
 //for(int i = 0; i < power; ++i)
  // arrayValue += array[j] * i;
}while(arrayValue != num);

string output = "";
for(int i = 0; i < power; ++i)
{
 output += array[i]; //real element
 output += "0"; //imaginary element
}

return 0;

Name: anoymous@eecs.berkeley.edu 2011-04-15 12:32

>>1
Is it really that fucking difficult to post a complete program that illustrates your problem?

Name: anonymous@eecs.berkeley.edu 2011-04-15 12:34

By a complete program, I mean one that I can copy, paste, and then compile. Ie, one that I don't have to enter in additional lines of code. God you suck.

Name: Anonymous 2011-04-15 13:06

>>3
Sorry, i'll leave and never come back.

Name: Anonymous 2011-04-15 13:39

DICENTIS,
 EGO SUM ABELSON ET SUSSMAN,
 PRIMUS ET RELIQUUS,
 CARUS ET CUDDARUS.

Name: Anonymous 2011-04-15 13:40

DICENTIS,
 EGO SUM ABELSON ET SUSSMAN,
 PRIMUS ET RELIQUUS,
 CARUS ET CUDDARUS.

Name: Anonymous 2011-04-15 13:41

DICENTIS,
 EGO SVM ABELSON ET SVSSMAN,
 PRIMVS ET RELIQVVS,
 CARVS ET CVDDARVS.

Name: Anonymous 2011-04-15 13:43

DICENTIS,
 EGO SVM ABELSON ET SVSSMAN,
 PRIMVS ET RELIQVVS,
 CARVS ET CVDDARVS.

Name: Anonymous 2011-04-15 13:45

DICENTIS,
 EGO SVM ABELSON ET SVSSMAN,
 PRIMVS ET RELIQVVS,
 CARVS ET CVDDARVS.

Name: Anonymous 2011-04-15 13:46

DICENTIS,
 EGO SVM ABELSON ET SVSSMAN,
 PRIMVS ET RELIQVVS,
 CARVS ET CVDDARVS.

Name: Anonymous 2011-04-15 13:48

DICENTIS,
 EGO SVM ABELSON ET SVSSMAN,
 PRIMVS ET RELIQVVS,
 CARVS ET CVDDARVS.

Don't change these.
Name: Email:
Entire Thread Thread List