(no subject)
Jan. 22nd, 2004 10:16 pmAnybody know C-programming? Because I'm going crazy.
Basically it's supposed to take the input for a line of 1s and 0s then apply a rule to each successively generated line. It's meant to look at the cell directly above the active cell and the two cells touching that one. If they're all 1s or all 0s, the active cell is a zero, otherwise it's a 1.
For instance, if I input 0000100100
my output should be:
0000100100
0001111110
0011000011
0111100110
and so on but I'm just getting
1111111111
1111111111
1111111111
1111111111
If anybody can tell me where I'm going wrong with my sucking coding, I'll love you forever and ever. I've been working at this all day and I'm ready to kill the computer.
ETA: the code is here.
Basically it's supposed to take the input for a line of 1s and 0s then apply a rule to each successively generated line. It's meant to look at the cell directly above the active cell and the two cells touching that one. If they're all 1s or all 0s, the active cell is a zero, otherwise it's a 1.
For instance, if I input 0000100100
my output should be:
0000100100
0001111110
0011000011
0111100110
and so on but I'm just getting
1111111111
1111111111
1111111111
1111111111
If anybody can tell me where I'm going wrong with my sucking coding, I'll love you forever and ever. I've been working at this all day and I'm ready to kill the computer.
ETA: the code is here.
no subject
on 2004-01-22 08:14 pm (UTC)no subject
on 2004-01-23 10:17 am (UTC)You are so my new favourite person. Thankyouthankyouthankyou!
Now off to wrestle with turning the 1s and 0s into graphics *g*