Computer Forums Programming Challenges
 Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 01-24-2011, 09:41 PM #1 Beta Member   Join Date: Jan 2011 Posts: 5 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. __________________
01-26-2011, 08:26 AM   #2
Site Team

Join Date: Jul 2009
Location: England, UK
Posts: 3,422
Re: Programming Challenges

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

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.

01-26-2011, 01:58 PM   #3
Beta Member

Join Date: Jan 2011
Posts: 5
Re: Programming Challenges

Quote:
 Originally Posted by berry120 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.

01-26-2011, 01:59 PM   #4
Site Team

Join Date: Jul 2009
Location: England, UK
Posts: 3,422
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.

01-26-2011, 02:54 PM   #5
Beta Member

Join Date: Jan 2011
Posts: 5
Re: Programming Challenges

Quote:
 Originally Posted by berry120 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.