Jump to content

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 makeTablecut&> LF cut noun define
Printer troubleshooter:
Printer does not print Y Y Y Y N N N N
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.