Sunday, February 13, 2011

Extended Euclidean Algorithm

Yay, today I learnt (more precisely, relearnt) Extended Euclidean Algorithm. Yay, I can start solving Diophantine Equations again :D


void EGCD(int a,int b){
if(a < 0 || b < 0){
EGCD(abs(a),abs(b));
if(a < 0) x = -x;
if(b < 0) y = -y;
}
else if(b == 0){
x = 1;
y = 0;
}
else{
EGCD(b,a%b);
x1 = y;
y1 = x-(a/b)*y;
x = x1;
y = y1;
}
}


Below is random experimentation with HTML tags and javascripts on blogs
This is Google



HOW DO I ENABLE ALL THE RANDOM LANGUAGES AND SCRIPTS???

Sunday, February 6, 2011

Post drought

To stop this post drought (while the next article on RJT Chess is tentatively being written), I shall post an error code arising from my randomings on C++.

invalid types 'int [((unsigned int)((int)(X*Y)))][]' for array subscript

That's quite a lot of brackets towards the middle.