For This Challenge Only!  This is for Raul, Ric and others.  You may respond
immediately. The embargo is lifted.  Work together, ask questions, compare
strategies, ask for advice and share your code at will.

Use whatever will work most efficiently.  No holds barred.  Do not hold back
if you are a very experienced programmer, rather join in the fun.

 

Here's the problem:  design a function pw for powerwash.  Apply  pw  to any
legacy script which is a mess and made you mad when two changes were made.
It is a script that you miss but you moved on without it because it took too
much effort and you abandoned it. The errors all came from a small change of
arguments   x.  becoming  x   and  y.  becoming  y    

 

So here is what is needed.  Apply  powerwash to the offending  .ijs 

 

   pw 'legacymessedup.ijs'

 

The function or several functions taken together will powerwash  your code
in four ways.

 

1.        It will find all instances of  x  and replace them with  xx

2.       It will find all instances of  y  and replace them with yy

3.       It will find all instances of x. and replace them with x

4.       It will find all instances of y. and replace them with y

 

This will not insure that your legacymessedup  script will work.  But it
will prevent the madness of having to do it yourself every time.

 

This one is for my own use and is beyond my skill or energy to tackle.  I
imagine there will be others out there who might appreciate it too.  We
thank you in advance. Also this may have been done since 2001 and  I never
saw it in which case we will move on to Challenge 8.

 

Linda

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to