diff --git a/frog-2.py b/frog-2.py index c0b0eec..525a77d 100644 --- a/frog-2.py +++ b/frog-2.py @@ -1,5 +1,8 @@ +import random +import sys + def frog(final_dist=100,max=6): - + # I wrote this quickly in a pub # Don't judge me @@ -7,8 +10,6 @@ def frog(final_dist=100,max=6): while total_dist <= final_dist: - import random - cap = 10**max trials = 0 @@ -33,6 +34,14 @@ def frog(final_dist=100,max=6): total_dist += 1 return "DONE" - - - \ No newline at end of file + +def main(args): + """ + Read the first command line as 'final_dist' + Read the second command line as 'max' + """ + frog(*[int(a) for a in args[1:3]]) + +if __name__ == '__main__': + main(sys.argv) +