Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-24-2011, 10:41 PM   #1
Beta Member
 
Join Date: Jan 2011
Posts: 5
Default Programming Challenges

Today my website announced its new add-on: Challenges. The point of the add-on is to take the common Programmer and test his skills using an online Web-based Programming test. You can test your skills in a variety of different languages and different skills of Programming.

Not a Programmer?
We have tests and Quizzes you can also take!

Link: Challenges | Programming and Web Development Help & Forums or Click here!

Thanks

This is not meant to be a advertising post, more or less a post to teach beginner programmers.
__________________

javanerd123 is offline   Reply With Quote
Old 01-26-2011, 09:26 AM   #2
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: Programming Challenges

Quote:
This is not meant to be a advertising post, more or less a post to teach beginner programmers.
Sorry, I don't really buy that. Both of the posts you've made thus far (and your signature) have been advertising your site.

Besides which, I've tried at least one of the challenges on your site which is badly worded / just plain wrong:

Quote:
Given 2 ints, a and b, return true if one of them is 10 or if their sum is 10.
Technically speaking, "return true;" would be a valid solution to that problem. I'm still returning true in all the cases you specified, and you gave no requirement as to what the program should do if those conditions aren't met.

There's also the question of ambiguity between whether "one" of them is 10, do you mean one or the other (XOR) or do you mean one and only one is 10?

Assuming you mean OR and not XOR, then a perfectly valid solution to the problem would be:

Code:
return a==10||b==10||a+b==10;
...which fails. The expected output dialog is also wrong:

Expected This run
1 true OK

Err... you might want to distinguish between 1 and true.

I'd actually recommend beginners stay away from these for a while. They look more confusing than helpful, at least in their present state.
__________________

__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 01-26-2011, 02:58 PM   #3
Beta Member
 
Join Date: Jan 2011
Posts: 5
Default Re: Programming Challenges

Quote:
Originally Posted by berry120 View Post
Sorry, I don't really buy that. Both of the posts you've made thus far (and your signature) have been advertising your site.

Besides which, I've tried at least one of the challenges on your site which is badly worded / just plain wrong:


Technically speaking, "return true;" would be a valid solution to that problem. I'm still returning true in all the cases you specified, and you gave no requirement as to what the program should do if those conditions aren't met.

There's also the question of ambiguity between whether "one" of them is 10, do you mean one or the other (XOR) or do you mean one and only one is 10?

Assuming you mean OR and not XOR, then a perfectly valid solution to the problem would be:

Code:
return a==10||b==10||a+b==10;
...which fails. The expected output dialog is also wrong:

Expected This run
1 true OK

Err... you might want to distinguish between 1 and true.

I'd actually recommend beginners stay away from these for a while. They look more confusing than helpful, at least in their present state.
The output was a programming error, my fault. Its hard not to make mistakes when Copy/Pasting PHP Class's.
javanerd123 is offline   Reply With Quote
Old 01-26-2011, 02:59 PM   #4
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: Programming Challenges

Quote:
The output was a programming error, my fault. Its hard not to make mistakes when Copy/Pasting PHP Class's.
That's pretty much the textbook way not to code...
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 01-26-2011, 03:54 PM   #5
Beta Member
 
Join Date: Jan 2011
Posts: 5
Default Re: Programming Challenges

Quote:
Originally Posted by berry120 View Post
That's pretty much the textbook way not to code...
Lol, It is very time-ineffecient to remake ~100 lines of code, compared to copy/pasting and changing 4-5 lines.
javanerd123 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0