Boolean help?
Posted: Thu Feb 25, 2010 7:58 am
Alright I just need help doing this, I really don't know how to go about writing this program... And if someone might be able to help that'd be awesome.
I was just attempting it in the shell not a graphics API or anything.
Alright so I have 200 chests and 200 pirates, and one other guy named blackbeard, and I dunno lets say it's blackbeards birthday. Alright so the pattern is like this, the first pirate opens every single chest. The second pirate goes and changes the position(if it's open he closes it, if it's closed he opens it) of every OTHER chest (skips 1 each). The third pirate goes and changes the position of every 3 chests (skips 2 each time). And so on and so forth.
after ALL 200 pirates have gone through the chests, blackbeard goes through and takes the treasure out of ONLY the ones that are open. WHICH did he take from?
I no longer have the source code for this because it was just me quickly trying to do it at school, but when I was trying to figure this out, I realized that I didn't really know enough about Boolean functions... Which was how I was trying to do it.
I was just attempting it in the shell not a graphics API or anything.
Alright so I have 200 chests and 200 pirates, and one other guy named blackbeard, and I dunno lets say it's blackbeards birthday. Alright so the pattern is like this, the first pirate opens every single chest. The second pirate goes and changes the position(if it's open he closes it, if it's closed he opens it) of every OTHER chest (skips 1 each). The third pirate goes and changes the position of every 3 chests (skips 2 each time). And so on and so forth.
after ALL 200 pirates have gone through the chests, blackbeard goes through and takes the treasure out of ONLY the ones that are open. WHICH did he take from?
I no longer have the source code for this because it was just me quickly trying to do it at school, but when I was trying to figure this out, I realized that I didn't really know enough about Boolean functions... Which was how I was trying to do it.