Niteshifter
02-13-2010, 12:07 AM
Not really sure what the problem is with this (as there's no debugger in Alice), but I've gone over syntax errors and logic errors to find that there's nothing wrong with it, however I still get errors. Here's the code:
def hx(n):
a = ['0','1','2','3','4','5','6','7','8','9','A','B','C ','D','E','F']
x = n % 16
y = ''
if (n-x) == 0:
y = a[x]
else:
y = hx((n-x)/16) + a[x]
return y
print hx(65565)
Output should be '1001D' however I just get the error screen, so I bet I'm missing something, or Jython isn't able to handle something in this piece.
def hx(n):
a = ['0','1','2','3','4','5','6','7','8','9','A','B','C ','D','E','F']
x = n % 16
y = ''
if (n-x) == 0:
y = a[x]
else:
y = hx((n-x)/16) + a[x]
return y
print hx(65565)
Output should be '1001D' however I just get the error screen, so I bet I'm missing something, or Jython isn't able to handle something in this piece.