Pointless programming code.

wchill

Resident chillxpert
OP
Member
Joined
Jun 12, 2008
Messages
1,407
Trophies
1
Age
13
Website
Visit site
XP
466
Country
United States
CODEint[] num = new int[9];
int u = 0;
int v = 0;
int w = 0;
int x = 0;
int y = 0;
int z = 0;
int temp = 0;
PrintWriter output;
void setup() {
ÂÂoutput = createWriter("answers.txt");
ÂÂfor (int a = 0; a < 9; a++) {
ÂÂÂÂnum[0] = a;
ÂÂÂÂfor (int b = 0; b < 9; b++) {
ÂÂÂÂÂÂnum[1] = b;
ÂÂÂÂÂÂfor (int c = 0; c < 9; c++) {
ÂÂÂÂÂÂÂÂnum[2] = c;
ÂÂÂÂÂÂÂÂfor (int d = 0; d < 9; d++) {
ÂÂÂÂÂÂÂÂÂÂnum[3] = d;
ÂÂÂÂÂÂÂÂÂÂfor (int e = 0; e < 9; e++) {
ÂÂÂÂÂÂÂÂÂÂÂÂnum[4] = e;
ÂÂÂÂÂÂÂÂÂÂÂÂfor (int f = 0; f < 9; f++) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂnum[5] = f;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂfor (int g = 0; g < 9; g++) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnum[6] = g;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfor (int h = 0; h < 9; h++) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnum[7] = h;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfor (int k = 0; k < 9; k++) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnum[8] = k;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂcheckTrue();
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂ}
ÂÂÂÂ}
ÂÂ}
ÂÂoutput.flush();
ÂÂoutput.close();
}
void checkTrue() {
ÂÂu = num[0] * (10 * num[1] + num[2]);
ÂÂv = 100 * num[3] + 10 * num[4] + num[5];
ÂÂw = num[6] * (10 * num[7] + num[8]);
ÂÂx = num[0] * (10 * num[4] + num[2]);
ÂÂy = 100 * num[3] + 10 * num[1] + num[6];
ÂÂz = num[5] * (10 * num[0] + num[8]);
ÂÂfor (int i = 0; i < 9; i++) {
ÂÂÂÂprint(num);
ÂÂ}
ÂÂprintln();
ÂÂif (u == v && v == w && x == y && y == z) {
ÂÂÂÂfor (int i = 0; i < 9; i++) {
ÂÂÂÂÂÂtemp = temp + int((pow(10, 9-i) * num));
ÂÂÂÂ}
ÂÂÂÂoutput.println(temp);
ÂÂÂÂtemp = 0;
ÂÂ}
}
It's a Processing sketch. Running on my laptop checking 20000 possibilities a second.
All because I wanted to solve a math problem but was too lazy to figure it out myself. Overkill much?
 

BoxShot

Chiyo-chan :3
Member
Joined
Dec 18, 2008
Messages
3,446
Trophies
0
Age
30
Location
Middle of the ocean.
Website
Visit site
XP
220
Country
United States
ohmy.gif
IT'S OVER 9000!

Well yes its complete overkill.
 

Site & Scene News

Popular threads in this forum

eof

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Nut on the hill