Anonymous user
Decision tables: Difference between revisions
m
→{{header|J}}: require 'strings' for J6; tweak code style
m (→{{header|J}}: tweak 2nd example, add comment on impl) |
m (→{{header|J}}: require 'strings' for J6; tweak code style) |
||
Line 3:
=={{header|J}}==
require 'strings' NB. Backwards compatibility with J6
'''Solution''':<lang j>( , (,.~'_NAMES',L:0~]) ;:'RULES ACTIONS') =: , > split&.|:L:1 }.&.> (split~ (<'Actions:') i.&1@:= {."1) }."1 TAB makeTable noun define▼
▲'''Solution''':<lang j>( , (,.~'_NAMES',L:0~]) ;:'RULES ACTIONS' ) =: , > split&.|:L:1 }.&.> (split~ (<'Actions:') i.&1@:= {."1) }."1 TAB
Printer troubleshooter:
Printer does not print Y Y Y Y N N N N
|