0

HAND←DEAL N;ROWS;SCORES
ROW←N×7
HAND←N 7⍴CHARS[?ROWS ⍴ 36]
This is a function I have created in APL. User specifies value of N (1-5) which determines the amount of license plates this program generates. The license plates are then stored in 'HANDS'

I want to create a different function which will score the plates generated in DEAL. The plates in DEAL were stored in HANDS. How can I have my different function operate on HANDS? From a completely different function where HANDS is unrecognized?

collinskewl2
  • 75
  • 1
  • 3

1 Answers1

1

I hope I understood your question correctly. When you wrote function DEAL, you decided to name the argument N and the result HAND.

But when using DEALin another function, you are totally free in how you name the result it calculates: XYZ007←DEAL 7 is perfectly valid.

And if you want a different function to operate on that, that function should provide a possibility to pass a right (and left) argument, where you could pass your HANDS or my XYZ007and whatever else.

And if you need to pass more than 2 arguments, you should learn about nested arrays because then you can (with all 'modern' APLs) write stuff like res←SuperCalc (A B C D E F)

MBaas
  • 7,248
  • 6
  • 44
  • 61
  • 1
    If that answered your question, it would be nice if you marked this as the solution, so that others know the question has been answered. If my answer was not what you were looking for, could you pls. comment so that I can refine accordingly...? – MBaas Mar 09 '15 at 12:16