Rubik's cube translation

castironpi at gmail.com castironpi at gmail.com
Tue Apr 1 08:32:24 EDT 2008


On Apr 1, 1:00 am, Tim Roberts <t... at probo.com> wrote:
> castiro... at gmail.com wrote:
>
> >What if this is connected:
>
> >>>> D
> >array([[1, 2, 3],
> >       [4, 5, 6],
> >       [6, 7, 8]])
> >>>> E
> >array([[6, 7, 8],
> >       [0, 0, 0],
> >       [0, 0, 0]])
>
> >-->
>
> >>>> D
> >array([[1, 2, 3],
> >       [4, 5, 6],
> >       [6, 7, 8]])
> >>>> E
> >array([[6, 7, 8],
> >       [0, 0, 0],
> >       [0, 0, 0]])
> >>>> numpy.rot90( D )
> >array([[3, 6, 8],
> >       [2, 5, 7],
> >       [1, 4, 6]])
> >-->
> >>>> E
> >array([[1, 4, 6],
> >       [0, 0, 0],
> >       [0, 0, 0]])
>
> >?
>
> If you don't want changes to D to affect E, then you need to disconnect
> them when you create them.  If you create D and E so that they contain
> references to the same lists, then this kind of thing will happen.

Basically, I need to change both D row 3 and E row 1 at the same time.



More information about the Python-list mailing list