doyle: tardis (sex and food preparation by buffyx)
[personal profile] doyle
Anybody 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.

on 2004-01-22 02:46 pm (UTC)
Posted by [identity profile] doyle_sb4.livejournal.com
Ooh... okay, will try and fix that. Thanks!

on 2004-01-22 03:23 pm (UTC)
Posted by [identity profile] quinn222.livejournal.com
also -

I see you calling this function -

getch();

but I don't see the actual function defined anywhere.

Profile

doyle: tardis (Default)
doyle

January 2016

S M T W T F S
     12
3 456789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 15th, 2026 02:29 pm
Powered by Dreamwidth Studios