Posted: Sat Jan 01, 2005 5:01 pm Post subject: Test your skills (2005)
I figure a new year calls for a new tradition. So, as I come up with questions, I'll post them here, and invite others to PM answers to me within the next week. 20 bits to anyone who can answer correctly.
So, the first question is a Ruby question.
Why does the first print
code:
[2, 4, 6]
to the screen, and the second print
code:
[1, 2, 3]
The code:
code:
p [1, 2, 3].collect { |x| x * 2 }
code:
p [1, 2, 3].collect do |x| x * 2 end
Sponsor Sponsor
MihaiG
Posted: Sat Jan 01, 2005 5:26 pm Post subject: (No subject)
can you post something for VB or turing?
wtd
Posted: Sat Jan 01, 2005 6:18 pm Post subject: (No subject)
Possibly, though I'll admit to not being fond of either of those languages.
Acid
Posted: Sat Jan 01, 2005 7:00 pm Post subject: (No subject)
Could you post some C++ too?
Not like I'll get the question anyway...
wtd
Posted: Sat Jan 01, 2005 7:07 pm Post subject: C++ skills test (1/1/05 - 1/7/05)
I write the following program and compile it with a modern C++ compiler (GCC 3.3):
code:
#include <iostream.h>
main()
{
cout << "Hello world!" << endl;
}
It compiles and runs, but I've made four mistakes. Name them. 5 bits for each mistake.
wtd
Posted: Sat Jan 01, 2005 10:02 pm Post subject: (No subject)
Private message, please, so multiple people can answer the question.
I'll post answers at the end of the week.
Hikaru79
Posted: Sun Jan 02, 2005 1:42 am Post subject: (No subject)
Hey, sweet idea, wtd Hopefully this'll turn into a long-standing tradition at compsci.ca
Can anyone chip in with their own questions, or only the thread owner?
PS: You're very close to 1337 posts I wanna take a screenshot when that happens!
wtd
Posted: Sun Jan 02, 2005 10:00 pm Post subject: (No subject)
Hikaru79 wrote:
Hey, sweet idea, wtd Hopefully this'll turn into a long-standing tradition at compsci.ca
Can anyone chip in with their own questions, or only the thread owner?
PS: You're very close to 1337 posts I wanna take a screenshot when that happens!
You can chip in, but if you're going to award bits, they have to be your bits.
A general suggesion: questions should ask questions that don't get asked much. Like the C++ question, "this works, but what am I doing wrong?" or "not just does this work, but why does it work that way?"
Sponsor Sponsor
wtd
Posted: Mon Jan 03, 2005 3:53 pm Post subject: Haskell challenge (1/3/05 - 1/9/05)
Write a program which prompts for the user's name and accepts it on a single line, then greets the user in all caps. A sample run might look like: