Steve Howell wrote:
I forgot this one:

def obfuscated_triager(rolls, pins,
        lookup = ['normal'] * 10 + ['strike'] + [None] * 9 + ['spare']
        ):
    return lookup[rolls * pins]

Bah...no need to be _quite_ so obscure:
  def triager(rolls, pins):
    return {
      (1, 10):'strike',
      (2,10):'spare',
      (2,0):'wow, you stink',
      }.get((rolls, pins), 'normal')


;-)

-tkc



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to