If you need more parameters, the form is

name a;b;c;d  NB. or ;<d if d is boxed

name =: {{ 'a b c d' =. y
...}}

This avoids global names.  If you have a global name, you will have to take care saving and restoring it at the proper places.

Henry Rich

On 7/21/2022 1:34 PM, 'Viktor Grigorov' via Programming wrote:
Typos can make this unreadable, I apologize. Here it is corrected:
Looking through the code for my sudoku solver, I think I found the (or a) reason why it wasn't working. I keep track of all unsolved cells' 
possble values. If a cell gets solved, the cells of its face, row, column get updated by removing the value of just solved cell  using 
"e.". Each updated cell's face, row, column would then as well need to be updated. I'm currently doing this with one global 
variable holding for the the just solved cell's value, and loops, wherein the recursion is: if you remove the, say, "3" from the 
possibilities of "2 3" of one cell in the face or row or column of just solved one (whose value is now 3), this global value 
would assume the value of "2". I would like this variable to return to its value of "3" after the call to the verb with 
its value "2" end.

This is the difficulty of working with at most 2 arguments (of the same type), 
right? What does one usually do when encountering such a problem? Pass a box with 
>1 elements and interally assign private variables eachtime, and on each 
necessary recurssion pass everything as ordered list of boxes, or is there a way 
of editting the scope of a to-be-called verb (or part of sentence)?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to