PDA

View Full Version : Doesn't work in Jython


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.

zonedabone
02-13-2010, 07:26 AM
Alice's Jython module is incomplete. no advanced functions are majorly supported.

zonedabone
02-13-2010, 07:31 AM
Sadly, Alice's Jython module isn't capable of accessing the print buffer. This must be done by the external GUI. Try this program.

Niteshifter
02-13-2010, 02:46 PM
I see now. Assign variables and call print from the outside.

Thanks.

zonedabone
02-13-2010, 03:29 PM
Yep. no problem!