...
Quote:>The requirement stated as
> "The solution should be ksh93 and should not contain any if statement
>but only _a single substitution_."
>sounds very much like the way a problem is phrased in a textbook or an
>instructor's homework assignment.
>A more general approach which said that a one-liner was desirable and gave
>some justification for the required absence of conditionals which otherwise
>sounds very artificial.
My how times have changed.
There are (at least) 3 general categories of "problems" that are posted to
the net (i.e., newsgroups) in search of answers:
1) "Hey guys (peers), here's an interesting problem. Can you solve
this problem - subject to these assumptions/constraints?" Note that the
communication here is peer-to-peer. And this is as it should be.
2) "Hey guys (gods/experts), I'm a working shmo in over my head.
If I don't solve this problem (which is almost assuredly asked 3 times
a week as well as being covered in all the FAQs) by 5 PM today, my boss
will fire me." Please, please, have pity. And note that I don't care
a fig about the elegance or beauty of the solution - I just have to get
this SOB off my back.
3) "Hey guys (gods/experts), I'm a student (probably in some
god-forsaken 3rd world country) who doesn't have a clue how to do my
homework. Please, please, have pity. And note that I don't care a fig
about the elegance or beauty of the solution - I just want to pass this
class so I can get back to drinking and partying.
In the early days of the net, the problems were all type 1s.
It is a real shame that the 2s and 3s have all but squeezed the 1s out of
existence. Speaking for myself, I shall continue to assume that all
problems posted here are in category #1, unless/until it is proven
conclusively otherwise.