The goal of the competition is to solve the challenge presented in as few characters as possible - which somewhat indirectly involves using a smaller number of commands and method calls. Whitespace is ignored in the count, so you can keep the program readable - you just want to use the fewest characters to create your solution.
The way I judge the length is to count any character that does not match the whitespace regular expression. The sum is your score, which you want to keep as low as possible. I also ignore comments.
First Challenge
However, we're going to get more meta than that - the first challenge is to write a script that counts the number of non-whitespace characters in a text file in the fewest non-whitespace characters and outputs it to the command line. The script must be run from the command line with the filename as its argument.
I would establish par for this challenge to be around 60 characters.
If you want to get really fancy, you can make it ignore comments also, but the requirement for the challenge is to assume all characters are significant.
I did the basic requirement in 36 - I'll post the source when we get a couple more responses.
Edit: I ignored single line comments in 67 characters. Let's see what you've got!
Edit: Updated numbers after I realized I was being redundant.
Updated the rules.
This post has been edited by xclite: 03 February 2011 - 02:17 PM

New Topic/Question
Reply





MultiQuote









|