|
|
David Frank wrote in message ...
>we can go on to a 2nd challenge thats been running concurrently over in
>comp.lang.fortran.
>Posted only for PLI'er info, there wont be a PL/I translation.
>
><<<<<<<
>Since its my challenge I am narrowing the acceptable solutions in reduce.f90
>as follows:
>
>1. the output string must contain a blank last char (if input string has 1
>or more trailing blanks)
> by output of a null char after just 1 trailing blank char is output.
>2. the solution must use array syntax, no scalar processing with do loops
>3. Fast/Legible/Brief is a goal.
>
>My current solution that meets these revised specs, uses 3 statements:
This does not meet your specification:
Line 2 uses a user function of 19 statements (fails spec #3).
>pad = char(0) ! allow pack to use null chars to pad its output
>a = Copy(line) ! copy line to char array
>outline = line(1:1) // Copy( PACK(a(2:), a(2:)/=' '.or.a(1:)/=' ',pad) )
|
|