Personally, I think the proposed challenge has some interesting
parts. Unfortunately, other parts are dumb or pointless or
needlessly tedious, which is disappointing.
On 22/03/2026 14:38, DFS wrote:
---------------------
Objective
---------------------
deliver a C (and optional 2nd language) program that - from a large
list of unsorted words possibly containing duplicates - extracts 26
sets of 100 random and unique words that each begin with a letter of
the English alphabet.
On 25/03/2026 12:32, Richard Harnden wrote:
On 22/03/2026 14:38, DFS wrote:
---------------------
Objective
---------------------
deliver a C (and optional 2nd language) program that - from a large
list of unsorted words possibly containing duplicates - extracts 26
sets of 100 random and unique words that each begin with a letter of
the English alphabet.
Here's my C attempt.
146 lines, but I like my vertical whitespace.
On 3/27/2026 1:24 PM, Richard Harnden wrote:
On 25/03/2026 12:32, Richard Harnden wrote:
On 22/03/2026 14:38, DFS wrote:
---------------------
Objective
---------------------
deliver a C (and optional 2nd language) program that - from a large
list of unsorted words possibly containing duplicates - extracts 26
sets of 100 random and unique words that each begin with a letter of
the English alphabet.
Here's my C attempt.
146 lines, but I like my vertical whitespace.
Thanks for the submission.
It's 106 lines of code, so it's the shortest yet.
The only part you didn't get quite right was:
"print the 2600 words you identify in column x row order in a grid of
size (200rows x 13cols or 300x9 or 400x7 or 500x6 or 600x4 etc) "
On 2026-03-28 05:52, DFS wrote:
On 3/27/2026 1:24 PM, Richard Harnden wrote:
On 25/03/2026 12:32, Richard Harnden wrote:
On 22/03/2026 14:38, DFS wrote:
---------------------
Objective
---------------------
deliver a C (and optional 2nd language) program that - from a large >>>>> list of unsorted words possibly containing duplicates - extracts 26 >>>>> sets of 100 random and unique words that each begin with a letter
of the English alphabet.
Here's my C attempt.
146 lines, but I like my vertical whitespace.
Thanks for the submission.
It's 106 lines of code, so it's the shortest yet.
The only part you didn't get quite right was:
"print the 2600 words you identify in column x row order in a grid of
size (200rows x 13cols or 300x9 or 400x7 or 500x6 or 600x4 etc) "
Ruminations on the recent "C" challenges...
Some requirements appear to be quite arbitrary.
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C" challenge.
Personally, I think the proposed challenge has some interesting
parts. Unfortunately, other parts are dumb or pointless or
needlessly tedious, which is disappointing.
On 3/28/2026 1:59 AM, Janis Papanagnou wrote:
[...]
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge
implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C" challenge.
I think one word would've sufficed where you used 235: python
[...]
On 2026-03-28 14:05, DFS wrote:
On 3/28/2026 1:59 AM, Janis Papanagnou wrote:
[...]
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge
implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C" challenge.
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
On 2026-03-28 14:05, DFS wrote:...
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
On 2026-03-30 05:26, Janis Papanagnou wrote:
On 2026-03-28 14:05, DFS wrote:...
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
I cannot answer your question, but the way you worded it suggests to me
that you may have parsed his comment incorrectly.
It should be parsed as
"I think one word would've sufficed where you used 235. That word is
python."
On 30/03/2026 10:26, Janis Papanagnou wrote:
On 2026-03-28 14:05, DFS wrote:
On 3/28/2026 1:59 AM, Janis Papanagnou wrote:
[...]
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge
implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C" challenge.
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
The 235 refers to the number of words in your paragraph (I haven't
checked).
On Mon, 30 Mar 2026 12:10:46 +0100
Bart <bc@freeuk.com> wrote:
On 30/03/2026 10:26, Janis Papanagnou wrote:
On 2026-03-28 14:05, DFS wrote:
On 3/28/2026 1:59 AM, Janis Papanagnou wrote:
[...]
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge
implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C" challenge.
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
The 235 refers to the number of words in your paragraph (I haven't
checked).
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to number
235? If by eye sight - it's impressively precise. If by use of word
count utility - it's too imprecise.
On 31/03/2026 10:11, Michael S wrote:
On Mon, 30 Mar 2026 12:10:46 +0100
Bart <bc@freeuk.com> wrote:
On 30/03/2026 10:26, Janis Papanagnou wrote:
On 2026-03-28 14:05, DFS wrote:
On 3/28/2026 1:59 AM, Janis Papanagnou wrote:
[...]
But okay. When
I read about the tasks to implement the first thought that came
up was to use an appropriate language or tool-set, one that fits
better for the task, tasks that at least I consider annoying to
implement them in "C" because that language doesn't support it
well, because of C's primitivity (its low-level'ness). But okay;
we're in a C-group and the residents need feeding. - Why is it
that I consider it annoying in "C"? - Because I'd have liked to
implement such tasks based on existing _building blocks_; like
associative arrays, sensible array data types, and what not.
Instead of constructing and building a car with tools like an
axe and a stone, wouldn't it be a more sensible to create useful
tools in "C" to make such challenges concentrate more on the
actual problem than on how to reinvent the simplest tasks again
and again? - I'd certainly consider it worthwhile to challenge
implementations of building blocks that alleviate C-programmers
from all the boring error-prone and low-level tasks that are
celebrated ad nauseam. - The question I'd ask myself if faced
with (arbitrary or useful) requirements would be what elementary
functions I'd need to construct the solution. Such identified
and isolated features, i.e. their implementation, would have a
persistent value for more than a single arbitrary "C"
challenge.
I think one word would've sufficed where you used 235: python
Sorry, I cannot associate that statement with anything I said. -
What is that "235: python" referring to? - Mind to elaborate?
The 235 refers to the number of words in your paragraph (I haven't
checked).
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to
number 235? If by eye sight - it's impressively precise. If by use
of word count utility - it's too imprecise.
OK, now I have to count them! If I use 'wc' on the original paragraph
that JP wrote, which starts like this:
Some requirements appear to be quite arbitrary. But okay. ...
Then it says 230 words. But there was also another line before that paragraph which was this:
Ruminations on the recent "C" challenges...
If that is included, then 'wc' reports 236 words. (It's also possible
that DFS mistyped the value.)
Presumably your count starts from 'But okay;'; then I get 223 words
too.
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to number
235? If by eye sight - it's impressively precise. If by use of word
count utility - it's too imprecise.
On 3/31/2026 5:11 AM, Michael S wrote:
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to
number 235? If by eye sight - it's impressively precise. If by use
of word count utility - it's too imprecise.
Starting with "But okay. When", I counted on my fingers while moving
my lips. Lost count several times before I dropped it into Notepad++
and did View | Summary.
On Tue, 31 Mar 2026 13:07:48 -0400
DFS <nospam@dfs.com> wrote:
On 3/31/2026 5:11 AM, Michael S wrote:
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to
number 235? If by eye sight - it's impressively precise. If by use
of word count utility - it's too imprecise.
Starting with "But okay. When", I counted on my fingers while moving
my lips. Lost count several times before I dropped it into Notepad++
and did View | Summary.
Now I know that Notepad++ has View | Summary. Thank you.
On 3/31/2026 2:15 PM, Michael S wrote:
On Tue, 31 Mar 2026 13:07:48 -0400
DFS <nospam@dfs.com> wrote:
On 3/31/2026 5:11 AM, Michael S wrote:
I did. There are 223 words.
So, now I have more interesting question - how did DFS come to
number 235? If by eye sight - it's impressively precise. If by use
of word count utility - it's too imprecise.
Starting with "But okay. When", I counted on my fingers while
moving my lips. Lost count several times before I dropped it into
Notepad++ and did View | Summary.
Now I know that Notepad++ has View | Summary. Thank you.
But if I use Notepad++ and replace every space with a \n I get 223
words. Difference of 12. Strange.
Google AI Mode says:
"Notepad++'s View | Summary (or double-clicking the status bar) is
known to produce inaccurate word counts because it uses a simplified algorithm that often misinterprets punctuation, special characters,
and encodings as word boundaries. It is widely considered "totally
wrong" for precise work.
Recommended Workarounds
For an accurate word count, use these more reliable methods:
Regex Count (Most Accurate):
Press Ctrl + F and go to the Mark or Find tab.
In Find what, type: \w+ (this matches alphanumeric word characters).
Set the Search Mode to Regular expression.
Click Count (or Mark All). The accurate word count will appear in the
status bar of that window.
Counting Selected Text Only:
To count a specific section, highlight the text and follow the Regex
Count steps above, making sure to check the In selection box.
Plugins:
NppTextFX2: This updated plugin provides a dedicated "Word Count"
tool under TextFX > TextFX Tools.
PythonScript: Advanced users can use a script (like
StatusBarWordCount) to display a live, accurate count in the status
bar.
Why "Summary" is Inaccurate
Encoding Issues: It may miscount characters in specific encodings
like UCS-2.
Word Definition: Unlike a full word processor, the Summary feature's
basic definition of a "word" often fails to handle contractions (like "don't") or hyphenated words correctly.
Hidden Spaces: It sometimes overcounts by treating multiple spaces or
line returns as extra word breaks."
Overcounting by 12 from a 223-word paragraph is ridiculously wrong.
I'm surprised, since Notepad++ is otherwise a great editor.
Note: if I use the AI suggestion of "Regex Count", it also says 235
words.
223 it is.
Now I had unknown that Notepad++ has View | Summary. Thank you.
[ reporting notepad++ deficiencies ]
I'm surprised, since Notepad++ is otherwise a great editor.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,113 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 492402:23:58 |
| Calls: | 14,249 |
| Files: | 186,315 |
| D/L today: |
85 files (22,085K bytes) |
| Messages: | 2,515,148 |