Page 1 of 4

'Bit Test' challenge... the strange coding.. please help me.

Posted: Sun Jun 22, 2008 2:23 pm
by dorahan
please help me to solve this challenge... i never seen a coding with 'bool' word like that before... please help me an explain to me about this coding.. and how to solve the challenge... thanks so much..

Posted: Sun Jun 22, 2008 3:19 pm
by therethinker
Seriously, what languages HAVE you seen!?

That code is C.

Posted: Mon Jun 23, 2008 9:53 am
by dorahan
What? that is C code?? I have learned a bit of C++. But i never seen that kind of word... Maybe it's the advanced level of C... huehehhee... i think i only learned the beginner level of C... hahahaha... huhuhuhu... T_T

Posted: Mon Jun 23, 2008 2:51 pm
by therethinker
Well, to be fair, it is also C++. (C is practically a subset of C++) Its not really that advanced, either.

Posted: Mon Jun 23, 2008 3:35 pm
by dorahan
Ohh i really don't know about that.. anyway i haven't solved this challenge... please give me any clue to solve this... i promise to study more about C. @__@

Posted: Tue Jun 24, 2008 1:26 am
by therethinker
Study more C and you'll find the answer ;-)

Posted: Wed Jul 02, 2008 4:00 pm
by dorahan
Argghhh please give me any clue to solve this problemm... I'm frustated already... Have no idea at all...

bit test

Posted: Sun Aug 24, 2008 3:08 am
by Suriv
Try to test the function by sending random values and take a look to the output,
after passing a bunch of values you will see a pattern.
then it will be easy to find the answer.

Posted: Thu Sep 25, 2008 11:12 am
by chriskag
Hello hackers.
This is my first post.
My English isn't so good.
You see, I'm from Greece and I don't know how to translate some things in English.
I am also new in Linux, thanks to this forum, and I don't know how to run a c++ project.
Neither how to find and install translators, programs, etc.
I managed to solve some of the tests in windows, which I am using for years, but Linux is hard for me.

About the test, I can only say that
it has an integer input
it tests if both values (&) have the price of zero

But how can x and x-1 have the same price?
I think it always return false (-1)

Could you please help me?

Posted: Thu Sep 25, 2008 2:01 pm
by canine
In most languages, C and C++ included, true is any non-zero number.

This makes -1 true.

0 is the only false value.

Otherwise I don't know much more about this puzzle.

Oh, to compile a C or C++ program on GNU/Linux, you would do:

Code: Select all

gcc file.c -o file
, if it's a c program

OR

Code: Select all

gcc file.cpp -o file -lstdc++
, if it's a c++ program.

Obviously change file.cpp or file.c to the filename of the source code. If they compile without problem, you can go ahead and do:

Code: Select all

./file
Which will run the code.

Posted: Sat Sep 27, 2008 1:43 pm
by chriskag
Thank you canine
You've been very helpfull

Posted: Sat Sep 27, 2008 5:12 pm
by canine
chriskag wrote:Thank you canine
You've been very helpfull
Anytime.

Posted: Wed Oct 15, 2008 1:16 pm
by tails
wangyudian wrote:but i don't know what (format: 'blank of blank') mean!
It's like "something of something", or /.* of .*/ in regex.

Posted: Thu Oct 16, 2008 4:09 am
by skragglies
I know the answer...I think. I mean I know what the function does, but I can't seem to word it correctly, and I speak english as a native language...

Nevermind, I just realized there are three ways to say it in a blank of blank format. I was only trying two of them.

Posted: Mon Oct 27, 2008 11:12 pm
by tails
Hey, do not write the answer here!
It spoils the challenge. Everyone can see it.
You should delete it as soon as possible.

Edit: Thanks.