Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Syntax for each flow:
  2. ' SOURCE [AMOUNT] TARGET
  3.  
  4. ' --------------------------------------------------------------------------
  5. ' Round 1
  6. ' Ana got 25 votes, Ben got 20, Che got 15 and Dan got 10.
  7.  
  8. ' Ana, Ben and Che were not the least voted candidates,
  9. ' so they stay for the next round, with all their votes.
  10. Ana r1 [25] Ana r2
  11. Ben r1 [20] Ben r2
  12. Che r1 [16] Che r2
  13.  
  14. ' Dan got the least votes (11) and is eliminated.
  15. ' 5 of his voters picked Ana as second choice,
  16. ' and 4 picked Ben. None picked Che,
  17. ' so these remaining 2 votes (5+4+0+2=11) are discarded.
  18. Dan r1 [5] Ana r2
  19. Dan r1 [4] Ben r2
  20. Dan r1 [2] None r2
  21.  
  22. ' --------------------------------------------------------------------------
  23. ' Round 2
  24. ' Ana now has 25+5=30 votes, Ben has 20+4=24,
  25. ' and Che remains with his original 16 votes.
  26.  
  27. ' Ana and Ben are not the least voted voted candidates,
  28. ' so they stay for the next round, with all their votes.
  29. Ana r2 [*] Ana r3
  30. Ben r2 [*] Ben r3
  31.  
  32. ' Che got the least votes (16) and is eliminated.
  33. ' 11 of his voters picked Ben as a second choice,
  34. ' and 3 picked Ana,
  35. ' The remaining 2 votes (11+3+2=15) are discarded.
  36. Che r2 [3] Ana r3
  37. Che r2 [11] Ben r3
  38. Che r2 [*] None r3
  39.  
  40. ' Now there are only two candidates,
  41. ' so the one with the most votes wins, i.e. Ben.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement