KALDERIUS'S PROFILE
Search
Filter
C++ question
The answer ought to be 12.
^ is a basic operator in C++, much like +, -, *, /, etc. Like you said, ^ does a bitwise exclusive or (XOR).
So you're right about 1100. 9 is 1001 in binary, and 5 is 0101. XOR each bit and you get 1100. Then, take it back out of binary and you get 12.
You probably know that you can use commands like "X1 += 4" which takes the value of X1, adds 4 to it, and stores the result back into X1. ^= is probably the same way. I have absolutely no idea why you'd ever want to use ^=, but I guess it's there just in case.
More information, just in case you're interested:
& is the bitwise AND operator and | is the bitwise OR operator. When you're using an if statement and you want to check multiple conditions, you know to use && and ||. This is because && is the logical AND operator and || is the logical OR operator. If you just use one & or |, the program will execute the bitwise command.
In my experience, I most often use bitwise functions in regard to images, when each pixel is stored as an int and broken up into 4 parts: R, G, B, and alpha. With bitwise functions you can address only the portion of the integer which you wish to address, e.g. ANDing out the "Red" portion by using & 0000111111111111.
^ is a basic operator in C++, much like +, -, *, /, etc. Like you said, ^ does a bitwise exclusive or (XOR).
So you're right about 1100. 9 is 1001 in binary, and 5 is 0101. XOR each bit and you get 1100. Then, take it back out of binary and you get 12.
You probably know that you can use commands like "X1 += 4" which takes the value of X1, adds 4 to it, and stores the result back into X1. ^= is probably the same way. I have absolutely no idea why you'd ever want to use ^=, but I guess it's there just in case.
More information, just in case you're interested:
& is the bitwise AND operator and | is the bitwise OR operator. When you're using an if statement and you want to check multiple conditions, you know to use && and ||. This is because && is the logical AND operator and || is the logical OR operator. If you just use one & or |, the program will execute the bitwise command.
In my experience, I most often use bitwise functions in regard to images, when each pixel is stored as an int and broken up into 4 parts: R, G, B, and alpha. With bitwise functions you can address only the portion of the integer which you wish to address, e.g. ANDing out the "Red" portion by using & 0000111111111111.
Educated Choice Awards 2008
Educated Choice Awards 2008
Is there any way there could be an "honorable mention" thing for the games that hypothetically should be on the list but aren't? Or maybe a separate, less important list of every game that got at least one vote, without the descriptions and pictures.
I like playing good games and this is the best thing RMN has ever done in terms of finding what games are actually good. But if there are other games released that might be good, I will NEVER find them and thus never play them, so it would be a bit of a waste not to mention them at all, anywhere.
I like playing good games and this is the best thing RMN has ever done in terms of finding what games are actually good. But if there are other games released that might be good, I will NEVER find them and thus never play them, so it would be a bit of a waste not to mention them at all, anywhere.
DotPlus
This game was a lot of fun. I got to 116 with 67954300 after playing for what was probably well over an hour, at which point I think my brain gave up. It's a really well-made game all around!
My only complaint is that the later levels are too easy. All you have to do is click a bunch of the blocks that are at the top of the screen, then click a bunch of 9s until the difference is less than 9, then click a block (or a few blocks) that sums it to the correct total. Then if you want to clear out some more, just do that again and again. There are a lot of 9s so it really shouldn't be a challenge until the sums get way up there and you have trouble physically clicking on enough of the numbers. If you wanted to be really evil and screw with people, you could replace some of the many 9s that show up in the later levels with 7s and 8s.
Other than that, this was a neat concept and a lot of fun. Do you have any plans to add other game modes or anything or do you think that would detract from its awesomeness? Thank you for making this!
My only complaint is that the later levels are too easy. All you have to do is click a bunch of the blocks that are at the top of the screen, then click a bunch of 9s until the difference is less than 9, then click a block (or a few blocks) that sums it to the correct total. Then if you want to clear out some more, just do that again and again. There are a lot of 9s so it really shouldn't be a challenge until the sums get way up there and you have trouble physically clicking on enough of the numbers. If you wanted to be really evil and screw with people, you could replace some of the many 9s that show up in the later levels with 7s and 8s.
Other than that, this was a neat concept and a lot of fun. Do you have any plans to add other game modes or anything or do you think that would detract from its awesomeness? Thank you for making this!
Pages:
1













