Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Test your skills (2005)
Index -> General Programming
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: 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. Smile

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
Sponsor
sponsor
MihaiG




PostPosted: Sat Jan 01, 2005 5:26 pm   Post subject: (No subject)

can you post something for VB or turing?
wtd




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: Sat Jan 01, 2005 10:02 pm   Post subject: (No subject)

Private message, please, so multiple people can answer the question. Smile

I'll post answers at the end of the week.
Hikaru79




PostPosted: Sun Jan 02, 2005 1:42 am   Post subject: (No subject)

Hey, sweet idea, wtd Smile 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 Wink I wanna take a screenshot when that happens!
wtd




PostPosted: Sun Jan 02, 2005 10:00 pm   Post subject: (No subject)

Hikaru79 wrote:
Hey, sweet idea, wtd Smile 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 Wink 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. Smile

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?"
wtd




PostPosted: 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:

code:
You are? Simon
HELLO SIMON!  SORRY FOR YELLING!!!


Reference material:

http://www.haskell.org
http://www.familygeek.com/haskell/tutorial.html
Andy




PostPosted: Mon Jan 03, 2005 8:21 pm   Post subject: (No subject)

with what language? haskell only?
wtd




PostPosted: Mon Jan 03, 2005 9:05 pm   Post subject: (No subject)

dodge_tomahawk wrote:
with what language? haskell only?


Yes. 20 bits if you get it right and PM me before the 9th. Smile

Hint: My tutorial covers similar territory.
AsianSensation




PostPosted: Mon Jan 03, 2005 10:48 pm   Post subject: (No subject)

nice wtd, I think this is a good challenge, and should not only be stickified, but also receive proper funding. Very Happy

If you run out of bits, just ask, the mods will be happy to reimburse you.
Andy




PostPosted: Tue Jan 04, 2005 8:47 pm   Post subject: (No subject)

lol.. i doubt wtd will run out any time soon
bugzpodder




PostPosted: Tue Jan 04, 2005 8:52 pm   Post subject: (No subject)

i'd post questions but i am too cheap to give away my bits... (like how rich ppl likes to hold their money)
Andy




PostPosted: Tue Jan 04, 2005 8:55 pm   Post subject: (No subject)

LOL.. i'll give away bits for u bugz
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 10  [ 147 Posts ]
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Jump to:   


Style:  
Search: