21 game: Difference between revisions

m
→‎{{header|J}}: added nowiki tags around '' and fixed a closing <tt> tag
m (→‎{{header|J}}: added nowiki tags around '' and fixed a closing <tt> tag)
Line 2,749:
putStrLn $ (snd names) ++ " has won the game"</lang>
=={{header|J}}==
The main definition <tt>g21</tt> starts the game. J doesn't support niladic verbs. Although the <tt>y</tt> argument has no effect, it must be given. The empty literal vector <nowiki>''</nowiki> types quickly, hence often used to trigger niladic verbs. g21 does not superfluously penalize final sums exceeding 21.
<lang J>
g21=: summarize@play@setup ::('g21: error termination'"_)
7,813

edits