Last active
October 14, 2018 09:04
-
-
Save coffeemakr/4293e907b23141fa4b71 to your computer and use it in GitHub Desktop.
Pharmacode (Laetus) calculation script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import sys | |
def pharmacode(v): | |
r = '' | |
while v: | |
t = 1 - ( v % 2 ) | |
r = str(t) + r | |
v = (v - t) / 2 | |
return r | |
if __name__ == '__main__': | |
print(pharmacode(int(sys.argv[1]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to calculate the pharmacode value.