Re: Lucia - OpenSource AudioGame engine written in Python
Well, if the ratio of current posts to Karma is total post / karma, the Python function to calculate Karma would be like so:
def calculate_karma(total_posts, karma_per_post):
return total_posts / karma_per_post
I added the second parameter to make the function a little more flexible.
If we know the total karma but not the user post count and assuming that the user gets 20 posts before somebody adds to their ego, the function to calculate post count would be as follows:
def calculate_total_posts(total_karma, karma_rate = 20):
return total_karma * karma_rate
Again, the second parameter is there to add flexibility.
All the situations above rely on you knowing two pieces of information. You cannot, for example, calculate total postsa if you can't reliably predict the user's karma rate.
Hope it helps. Let me know if I misunderstood you and if I need to provide more explanations.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector