-
Jan 16th, 2017, 10:26 PM
#1
Contest 11 - Sorting Characters
Programming Contest – Sorting Characters
For all those who haven't participated in the contest please read the FAQ
Overview
I wish that I could take credit for this contest idea, but I swiped the idea from a different website
A high profile conspiracy theorist is looking for hidden messages in simple messages. He believes that the message is hidden in the individual letters, so rather than get distracted by the words and punctuation, he’s asked us to write a program to take a String and return the letters it contains, sorted. Given the text:
Code:
Wow! Whenever you go outside, it is actually a very pretty world.
The program would output:
Code:
aaacddeeeeeeghiiilllnoooooprrrrsstttttuuuvvwwwwyyyy
Notice that punctuation and whitespace are ignored. The only thing that should be returned is lower-case letters(a-z) with the upper-case letters being converted to lower-case. Anything else such as numbers, whitespace, punctuation, etc. should be ignored.
Languages
C, C#, C++, F#, Java, JavaScript(musts include HTML and CSS, but markup/styling will not be graded), LUA, Perl, Python, and VB.Net
Deadline
January 20th, 2017
Rules for Contest
The rules followed will be specific to the contest and not the game.
- You must submit the source code and include a fiddle(ideone, dotnetfiddle, codepen, etc.)
- Allow the user to enter the String that will be sorted
Marking
Each entry will be judged on the following things.
- Accuracy - Does the program follow all of the rules?
- Length - How concise is the submitted code?
- Execution - How quick did the code execute?
- Efficiency - How efficient is the algorithm(s) you chose?
Prizes
You will get to brag that you won a VBForums contest!
Please submit all entry's to the forum below with the title in the following format "Contest 11: Sorting Characters - [User Name]"
Contest Entries Forum
Last edited by dday9; Jan 17th, 2017 at 12:13 PM.
Reason: Made instructions clearer.
-
Jan 16th, 2017, 11:01 PM
#2
Re: Contest 11 - Sorting Characters
Question - Are letters to be converted to lower case? 'W' and 'w' are not the same thing.....
-
Jan 17th, 2017, 12:03 AM
#3
Re: Contest 11 - Sorting Characters
Originally Posted by brad jones
Question - Are letters to be converted to lower case? 'W' and 'w' are not the same thing.....
Good question. The letters should be converted to lower-case. The conspiracy theorist is very particular lol!
-
Jan 17th, 2017, 03:35 AM
#4
Re: Contest 11 - Sorting Characters
What's a 'fiddle' - as I probably don't have/use one??
Notice that punctuation and whitespace are ignored.
For the sake of completeness, would you define what is being meant by 'punctuation' and 'whitespace' as this could mean different things to different people in different languages.
Last edited by 2kaud; Jan 17th, 2017 at 03:40 AM.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 17th, 2017, 09:24 AM
#5
Re: Contest 11 - Sorting Characters
Originally Posted by 2kaud
What's a 'fiddle' - as I probably don't have/use one??
A fiddle is basically an online compiler/interpreter that represents a console project. The most popular one is ideone(check for link in post #1) because it has several different languages(all the ones I listed except for JavaScript), but if you're going to use a .NET language then I suggest dotnetfiddle(check for link in post #1) since it has auto-complete and its version of intellisense.
Originally Posted by 2kaud
For the sake of completeness, would you define what is being meant by 'punctuation' and 'whitespace' as this could mean different things to different people in different languages.
By excluding punctuation and whitespace I mean that I want any Char that falls between the ascii range 65-90 and 97-122, but convert them to their lower-case equivalent.
-
Jan 17th, 2017, 11:00 AM
#6
Re: Contest 11 - Sorting Characters
Thanks. if I use ideone, can you provide instructions as to how to include the required 'fiddle' please as I don't use online compilers. I use MS VS.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 17th, 2017, 11:13 AM
#7
Re: Contest 11 - Sorting Characters
I submitted a solution, but didn't notice that VB6 was not allowed.
What a pity that VB6 is excluded from the contest
-
Jan 17th, 2017, 11:14 AM
#8
Re: Contest 11 - Sorting Characters
Originally Posted by Arnoutdv
I submitted a solution, but didn't notice that VB6 was not allowed.
What a pity that VB6 is excluded from the contest
Unfortunately, I have no way of judging VB6 entry and neither do any of the moderators as far as I know.
-
Jan 17th, 2017, 03:44 PM
#9
Re: Contest 11 - Sorting Characters
I tried DotNetFiddle. I wrote and tested a solution, but i was unable to save it, so i just copied and pasted into notepad and saved it as a text file with a cs extension. That's what i submitted. I hope that's ok. When is this contest being judged?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 17th, 2017, 04:04 PM
#10
Re: Contest 11 - Sorting Characters
For dotnetfiddle, if you hit the share button it generates the unique URL. I've edited your post to include the source and fiddle.
-
Jan 17th, 2017, 04:12 PM
#11
Re: Contest 11 - Sorting Characters
Ok thanks. When is the contest being judged?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 17th, 2017, 04:27 PM
#12
Re: Contest 11 - Sorting Characters
The deadline is Friday, depending on the amout of submissions I'll likely judge them all on Saturday.
-
Jan 17th, 2017, 10:52 PM
#13
Re: Contest 11 - Sorting Characters
so, the reason we can´t submit vb6 is because it would win right?
-
Jan 18th, 2017, 05:53 AM
#14
Re: Contest 11 - Sorting Characters
Originally Posted by dday9
Unfortunately, I have no way of judging VB6 entry and neither do any of the moderators as far as I know.
Maybe add someone with access to VB6 to the team of judges?
Or do you all really want to exclude the large group of VB6 developers who also contribute a lot to this forum?
-
Jan 18th, 2017, 06:05 AM
#15
Re: Contest 11 - Sorting Characters
As a developer for the past xx decades - mainly with pascal, various assembler, Pick Basic and c/c++ (see me on the associated site forums.codeguru.com) - IMO no language should be excluded. Anyone fancy doing an APL solution? However, as there is only one 'winner', I'm wondering how say a 'good' Python program can be judged against a 'good' VB.Net program? If there are 'good' solutions in different languages, IMO why not award a separate 'winner' for each of these languages?
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 18th, 2017, 10:18 AM
#16
Re: Contest 11 - Sorting Characters
Originally Posted by Arnoutdv
Maybe add someone with access to VB6 to the team of judges?
Or do you all really want to exclude the large group of VB6 developers who also contribute a lot to this forum?
The rules to the contests state that a moderator or admin must judge the contest. I certainly don't mind checking with the other mods to:
- Clarify if any of them have the VB6 compiler to judge it themselves
- Add a non-moderator to judge strictly VB6 entries.
Be thinking of who should do the VB6 judging
Originally Posted by 2kaud
As a developer for the past xx decades - mainly with pascal, various assembler, Pick Basic and c/c++ (see me on the associated site forums.codeguru.com) - IMO no language should be excluded. Anyone fancy doing an APL solution? However, as there is only one 'winner', I'm wondering how say a 'good' Python program can be judged against a 'good' VB.Net program? If there are 'good' solutions in different languages, IMO why not award a separate 'winner' for each of these languages?
We ran into this issue on a prior contest where the winner was a Python submission because the code was essentially a one-liner were as all of the others were much larger and took longer to execute. What I try to do as a judge is when judging on effeciency to judge based on the language that the code was written in.
Take for example the following VB.Net code, if I see the following:
Code:
For x As Integer = 0 To 9
Dim input As String = Console.ReadLine()
Console.WriteLine(input & x.ToString())
Next
When I know that it is more efficient to declare the variable outside of the loop like this:
Code:
Dim input As String
For x As Integer = 0 To 9
input = Console.ReadLine()
Console.WriteLine(input & x.ToString())
Next
Or to not use the variable at all like this:
Code:
For x As Integer = 0 To 9
Console.WriteLine(Console.ReadLine() & x.ToString())
Next
Then I'll mark against that, because the code is not as efficient as it could be.
-
Jan 18th, 2017, 12:15 PM
#17
Re: Contest 11 - Sorting Characters
When I know that it is more efficient to declare the variable outside of the loop like this
Obviously the 3rd solution is the 'best'; but in a c++ context, declaring a variable outside the loop would not be considered good practice if the variable was only used within the loop - horses for courses as they say.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 18th, 2017, 12:52 PM
#18
Re: Contest 11 - Sorting Characters
the winner was a Python submission because the code was essentially a one-liner
Yes, but - this has probably been mentioned previously - that is judging on the capabilities of the language, not on the usage of the language. If a particular task can be done more easily/efficiently in one particular language, fine - but that comes back to my point in post #15 re if there are 'good' submissions in different languages then have multiple language 'winners'.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 19th, 2017, 07:47 AM
#19
Re: Contest 11 - Sorting Characters
When the result is posted, would it be possible to provide some simple stats re the entries - eg numbers entered in the various programming languages.
Cheers.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 19th, 2017, 07:56 AM
#20
Re: Contest 11 - Sorting Characters
I agree. It would make more sense to have a winner for each language used. It's not really fair to judge different language entries side by side, as one language could provide a much simpler solution for the same task.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 19th, 2017, 09:43 AM
#21
Re: Contest 11 - Sorting Characters
Perhaps when these contests become larger we will consider judging for each language.
-
Jan 19th, 2017, 11:41 AM
#22
Re: Contest 11 - Sorting Characters
Whoa... contest?
dday9, it would be nice to know in advance when a contest perioid is coming up, but not the details of what it's about.
At least a weeks notice before it starts. You'll attract more participation that way.
Last edited by Peter Porter; Jan 19th, 2017 at 11:45 AM.
-
Jan 19th, 2017, 01:56 PM
#23
Re: Contest 11 - Sorting Characters
I figured with how trivial the contest is, that a week to work up an example should be more than sufficient. But certainly a note taken!
-
Jan 19th, 2017, 02:05 PM
#24
Re: Contest 11 - Sorting Characters
It's not necessarily the time taken to work up an example, it's getting the info that there is going to be a contest to as many members as possible. What about those that only visit this site a couple times a month etc? For future contests, could a bulk PM be done advising of a forthcoming contest?
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 19th, 2017, 03:07 PM
#25
Re: Contest 11 - Sorting Characters
Originally Posted by 2kaud
For future contests, could a bulk PM be done advising of a forthcoming contest?
That's called spamming.
Talk to me before the next contest and we can see about doing a notification or some other notice.
-
Jan 19th, 2017, 03:09 PM
#26
Re: Contest 11 - Sorting Characters
Originally Posted by Peter Porter
dday9, it would be nice to know in advance when a contest perioid is coming up, but not the details of what it's about.
Hmmm..... Noted. And we can discuss ways to address this. I've an ideas I need to ponder.....
-
Jan 24th, 2017, 10:49 PM
#27
Re: Contest 11 - Sorting Characters
I want to thank everyone who participated in the first coding contest for 2017!
I got to the judging a little later than I had hoped to, but it has been judged none-the-less. And the winner for the Sorting Characters contest is...
.paul. for his C# submission! The algorithm was only 1 line using .NET's LINQ, while it was not the fastest in terms of execution(though not the slowest either) the conciseness and ease of readability really made it stand out.
I encourage everyone to check out the submissions, which can be found in the Contest Entries forum. I was very impressed with the quality of code produced and I hope that y'all join us for the next contest!
-
Jan 25th, 2017, 04:34 AM
#28
Re: Contest 11 - Sorting Characters
Personally I'm disappointed that there were only 4 entries for this contest. Obviously previous discussions re a winner for different languages is a non-starter with such a small entry.
Congrats to .paul. , a worthy winner with his one-liner
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 25th, 2017, 04:38 AM
#29
Re: Contest 11 - Sorting Characters
Originally Posted by 2kaud
Personally I'm disappointed that there were only 4 entries for this contest. Obviously previous discussions re a winner for different languages is a non-starter with such a small entry.
Congrats to .paul. , a worthy winner with his one-liner
Thanks...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 25th, 2017, 08:02 AM
#30
Re: Contest 11 - Sorting Characters
Congratulations .paul.!
And thanks to everyone that helped or participated!
-
Jan 25th, 2017, 06:01 PM
#31
Re: Contest 11 - Sorting Characters
I would like some feedback from those who are reading this.
What could we have done differently to attract more contestants?
In the past, I have created a little badge signifying the type of contest and was given to the winner, though the badges weren't professional... I tried my best Do y'all want to see these brought back?
-
Jan 25th, 2017, 07:55 PM
#32
Re: Contest 11 - Sorting Characters
Originally Posted by brad jones
Congratulations .paul.!
And thanks to everyone that helped or participated!
thanks...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 25th, 2017, 07:57 PM
#33
Re: Contest 11 - Sorting Characters
Originally Posted by dday9
I would like some feedback from those who are reading this.
What could we have done differently to attract more contestants?
In the past, I have created a little badge signifying the type of contest and was given to the winner, though the badges weren't professional... I tried my best Do y'all want to see these brought back?
You could advertise the contests in the main forums and earlier. That might attract more entrants
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 26th, 2017, 03:41 AM
#34
Re: Contest 11 - Sorting Characters
I agree with .paul. re earlier advertising that a contest is going to be held. Also the contest itself could be more interesting/challenging. IMO a minimum of about 25 lines in any language (excluding input/output and variable definitions etc). Also from the contest FAQ "..different contests at different difficulty levels". Maybe some thought could be given to this?
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jan 26th, 2017, 03:59 AM
#35
Re: Contest 11 - Sorting Characters
Maybe an additional thread in which members can propose new contests?
-
Jan 26th, 2017, 08:39 AM
#36
Re: Contest 11 - Sorting Characters
Figure out how often you want to do contests, then do them regularly. They might slower at first, but over time they might pick up. For example, you can announce contests the first Monday of every month with a deadline the third month and winners announced on the fourth Monday. Regular cadence over time might help. Then, stick with doing it for a given period (say six months) regardless of the number of entries.
-
Jan 26th, 2017, 11:13 AM
#37
Re: Contest 11 - Sorting Characters
Originally Posted by .paul.
You could advertise the contests in the main forums and earlier. That might attract more entrants
Yeah, this seemed to be the general theme. I intend on making the contests more regular as proposed by brad jones which I think solves this issue.
Originally Posted by 2kaud
Also the contest itself could be more interesting/challenging. IMO a minimum of about 25 lines in any language (excluding input/output and variable definitions etc). Also from the contest FAQ "..different contests at different difficulty levels". Maybe some thought could be given to this?
I've taken Arnoutdv's suggestion of allowing members to propose new contest ideas which I think will help provide more difficult contests.
I have often thought about giving different difficulty levels, but the issue that comes about is that difficulty is subjective. I fear that what would happen is that members would get upset at what I or somebody else considers a "simple" contest when it is actually much more difficult for them.
Originally Posted by Arnoutdv
Maybe an additional thread in which members can propose new contests?
Thank you for the input. I have made a sticky thread here: http://www.vbforums.com/showthread.p...st-Suggestions
Originally Posted by brad jones
Figure out how often you want to do contests, then do them regularly. They might slower at first, but over time they might pick up. For example, you can announce contests the first Monday of every month with a deadline the third month and winners announced on the fourth Monday. Regular cadence over time might help. Then, stick with doing it for a given period (say six months) regardless of the number of entries.
I think that we should start having a contest once every other month. We could allow for the contest to start at the beginning of the first month, end the contest and start judging at the beginning of the second month, and finally announce the winner of the contest of the last week of the 2nd month.
I think that this solves the "not enough time" theme that has been made aware of throughout this thread and it also give a regular schedule for contests.
Also, this is a note as a moderator... we do have a calendar that is only being used for birthdays right now. Whenever we create an announcement for the future contests, could we also add it to the calendar? You don't have to answer this here, we could PM.
-
Jul 27th, 2017, 07:42 AM
#38
Re: Contest 11 - Sorting Characters
Originally Posted by dday9
I want to thank everyone who participated in the first coding contest for 2017!
I encourage everyone to check out the submissions, which can be found in the Contest Entries forum. I was very impressed with the quality of code produced and I hope that y'all join us for the next contest!
That link now shows submissions for Contest 12.
How does one view submissions for Contest 11?
Spoo
-
Jul 27th, 2017, 09:56 AM
#39
Re: Contest 11 - Sorting Characters
That link now shows submissions for Contest 12.
How does one view submissions for Contest 11?
From that link, under Thread Display Options, change Show Threads from Last Month to Beginning then click Show Threads. You'll then see all the submissions for previous contests.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
Jul 27th, 2017, 10:23 AM
#40
Re: Contest 11 - Sorting Characters
2kaud
Thanks.
But now I'm puzzled .. Arno's solution for Contest 11 seems to be VB6 (by his own admission),
which I thought was disallowed ,,
Spoo
Last edited by Spooman; Jul 27th, 2017 at 10:26 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|