Guest User

Untitled

a guest
May 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. from collections import namedtuple
  2.  
  3. Direction = namedtuple('Direction', 'Left Up Diagonal Stop')
  4. Direction.Stop = "stop"
  5. Direction.Left = "left"
  6. Direction.Up = "up"
  7. Direction.Diagonal = "diagonal"
  8.  
  9.  
  10. def get_directions(match, insert, delete, maximum):
  11. options = [(insert, Direction.Left), (match, Direction.Diagonal), (delete, Direction.Up)]
  12. return [d[1] for d in options if d[0] == maximum]
Add Comment
Please, Sign In to add comment