Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write into google's spreadsheet to round robin phrases based on a counter #6

Open
lgarest opened this issue Sep 28, 2018 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@lgarest
Copy link
Collaborator

lgarest commented Sep 28, 2018

Current behavior
The script puts the selected phrase based on the following criteria:
#day of the year % #phrases
The problem w/ this approach is that when we add phrases, the result calculation deviates the desired selected phrase as seen in this schema:

num phrase
21 this is row 21
.. ..
28 this is row 28

day_of_the_year=273
len(phrases)=35
result=day_of_the_year % len(phrases) # 273 % 35 = 28
output:this is row 28

If we increment by one the phrases:
len(phrases)=36
result=day_of_the_year % len(phrases) # 273 % 36 = 21
output: this is row 21

Desired scenario
• Implement an algorithm to read the phrases and their # of ocurrences
• Pick the phrases w/ lower # of ocurrences
• Pick one randomly from that subgroup

@lgarest lgarest added bug Something isn't working enhancement New feature or request labels Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant