try
Code:
program:
t = field('#award');
first_non_empty(
test(and(contains(t, 'Hugo win', '1', ''),
contains(t, 'Nebula nom', '1', '')),
'chocolate', ''),
test(and(contains(t, 'Hugo nom', '1', ''),
contains(t, 'Nebula win', '1', '')),
'chocolate', ''),
test(or(contains(t, 'Hugo win', '1', ''),
contains(t, 'Nebula win', '1', '')),
'orange', ''),
test(or(contains(t, 'Hugo nom', '1', ''),
contains(t, 'Nebula nom', '1', '')),
'goldenrod', ''),
test(and(contains(t, 'Hugo win', '', '1'),
contains(t, 'Nebula win', '', '1'),
contains(t, 'win', '1', '')),
'sandybrown', ''),
test(and(contains(t, 'Hugo nom', '', '1'),
contains(t, 'Nebula nom', '', '1'),
contains(t, 'nom', '1', '')),
'lightsalmon', '')
)
This applies the tests in order
- Hugo win and Nebula nom: chocolate
- Nebula win and Hugo nom: chocolate
- Hugo win or Nebula win: orange
- Hugo nom or Nebula nom: goldenrod
- win and not Hugo win and not Nebula win: sandybrown
- nom and not Hugo nom and not Nebula nom: lightsalmon
else not colored