[Tutor] First realscript + Game of Life
carloslara at web.de
Fri Nov 10 08:39:46 CET 2006
> I think you're talking to someone else here, cause I have no idea what
> you mean.
> Copy binary numbers from memory?
> You mean from any arbitrary memory location you want?
> That sounds a lot like C++ pointers to me.
That was based on this:
> Hi Carlos,
> I hope this module would help you with the binary conversion part:
> def tobits(inte,size = 3):
> """Copy an integer's bits from memory"""
> for i in range(size):
> s += str((inte & (1<<i)) >>i)
> #bits are extracted right-to-left
> s = s[::-1] #reverse the result string
> print s
> return list(s)
>>>> >>>test = tobits(30,8)
> ['0', '0', '0', '1', '1', '1', '1', '0']
But probably (surely) my interpretation is wrong. Hehe
> 89+11 = 100, which is longer than the list.
More information about the Tutor