Advertisement
clockworkpc

Swing Dancing Flowchart (bisect)

Apr 30th, 2011
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. #!/usr/bin/python
  2. #/home/clockworkpc/Documents/bin/swing_footwork.py
  3.  
  4. #
  5. # Released under a GPLv3 Licence by Clockwork PC 2011  
  6. #
  7. # www.clockworkpc.com.au
  8. #
  9. # You are entitled to the following four freedoms:
  10. # Freedom 0: To run this program for any purpose
  11. # Freedom 1: To study how this program works and change it to make it do what you wish
  12. # Freedom 2: To redistribute copies so you can help your neighbour
  13. # Freedom 3: To distribute copies of your modified version to others
  14. #
  15. ###
  16.  
  17. from bisect import bisect
  18. cut_points = [120, 180, 300]
  19. kinds = ['Blues', 'Lindy!', 'Charleston or 6-beat', 'Balboa']
  20. bpm = int(raw_input('How fast is the music?'))
  21. style = kinds[bisect(cut_points, bpm)]
  22. if bpm < 80:
  23.     print 'Get a room.'
  24. else:
  25.     print style
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement