MAC vendor lookup: Difference between revisions

→‎{{header|APL}}: move demo code into program instead of output section
(→‎{{header|APL}}: move demo code into program instead of output section)
Line 90:
vendors ⍪← ⊆vendorLookup1 burger ⍝ then look up the next vendor and append
:EndFor
⍝ end function definition</lang>
 
⍝ demo data
{{Out}}
<pre> macList ← '88:53:2E:67:07:BE' 'D4:F4:6F:C9:EF:8D' 'FC:FB:FB:01:FA:21'
macList ⍪← '4c:72:b9:56:fe:bc' '00-14-22-01-23-45'
 
⍝ look up the vendors (takes a while with the 2-second delay between lookups)
vendorList ← vendorLookup macList
(⍴ vendorList)[1] 1⍴ vendorList
 
Intel Corporate
⍝ the result is an array (a 1-row by N-column matrix). to print out one vendor
⍝ per line, we reshape it to be N rows by 1 column instead.
⎕←(⍴ vendorList)[1] 1⍴1 ⍴ vendorList</lang>
 
{{Out}}
<pre> Intel Corporate
Apple, Inc.
Cisco Systems, Inc
1,480

edits