Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I don't understand what you mean by "The Hex function in python doesn't do that".
hex(10)
'0xa'
hex(12)
'0xc'
I get the same on Python 2.7 and 3.6. Or did I miss something?
well you can always rely on printf
%x
(or%X
for uppercase) :"%x" % my_digit
Otherwise
(list(range(0,10)) + [char(c) for c in range(ord('A'), ord('Z')])[my_digit]
will work up to base 36, but I think you were looking for the first one.apart from the base 2, it would be quite easy to implement random tests for the other bases up to 16, without big modifications of the test suite, tho. That would be a good addition to your kata!
I see, so I assume that I'm supposed to use A-F. The Hex function in python doesn't do that - is there something built in?
google is your friend... https://en.wikipedia.org/wiki/Hexadecimal
(and no need to scream like that... x) )
This comment is hidden because it contains spoiler information about the solution
There's something suspicious in this code. Does it just award the win to the robot with the most amount of tactics? I don't think that's going to cover all cases, just most of them.
make every output an int - LCM is an int, LCM/numerator is an int. Don't let floats creep into your results ANYWHERE. That worked for me.
make every output an int - LCM is an int, LCM/numerator is an int. Don't let floats creep into your results ANYWHERE. That worked for me.
make every output an int - LCM is an int, LCM/numerator is an int. Don't let floats creep into your results ANYWHERE. That worked for me.
make every output an int - LCM is an int, LCM/numerator is an int. Don't let floats creep into your results ANYWHERE. That worked for me.
This comment inspired me to keep going with my work.
Runs fine on my machine for large numbers. xrange is big enough to account for largest b which is b**2 = n. @ecolban what's your take on the xrange? What should it be?