# Found!



## Filipe Teixeira (May 25, 2021)

I'm trying this: https://github.com/adrianliaw/PyCuber


Spoiler: This message was deleted



I'm working on a project related to 3x3 f2l and I'm looking for a library that models the cube but I'm having a hard time finding it

What I need is something like this:

I input the alg, like R U R' and it spits out the cube state in form of a list or something similar so I can combine various algs and see if it solves

Does anyone know anything similar to this in python? javascript would do the trick too


----------



## qwr (May 25, 2021)

roll your own


----------



## Filipe Teixeira (May 25, 2021)

qwr said:


> roll your own


I'm bad at maths  
developing a cube simulator is too much for me


----------



## qwr (May 25, 2021)

Filipe Teixeira said:


> I'm bad at maths
> developing a cube simulator is too much for me


afaik there's no math that goes into a cube simulator, as compared to a cube solver. You can literally encode each sticker as a number and code in all 6 face turns as permuting arrays of numbers. At least, that's what I read in some intro to rubik's cube theory article I read: http://people.math.harvard.edu/~jjchen/docs/Group Theory and the Rubik's Cube.pdf (good read)

@xyzzy to clarify


----------



## Filipe Teixeira (May 25, 2021)

qwr said:


> afaik there's no math that goes into a cube simulator... At least, that's what I read in some intro to rubik's cube theory article I read: http://people.math.harvard.edu/~jjchen/docs/Group Theory and the Rubik's Cube.pdf (good read)
> 
> @xyzzy to clarify


----------



## qwr (May 25, 2021)

it's okay, just ignore that I linked a Harvard math PDF


----------



## Filipe Teixeira (May 25, 2021)

qwr said:


> it's okay, just ignore that I linked a Harvard math PDF


thanks but I'm a lost case


----------



## qwr (May 26, 2021)

Filipe Teixeira said:


> thanks but I'm a lost case


Do you have any coding experience? Since you linked a python library without an obvious GUI I assume you do.


----------



## xyzzy (May 26, 2021)

qwr said:


> afaik there's no math that goes into a cube simulator, as compared to a cube solver. You can literally encode each sticker as a number and code in all 6 face turns as permuting arrays of numbers.


This is correct, at least if you're just doing a 2D cube representation (e.g. unfolding the sides into a net, just like PyCuber, Cube Explorer, etc.). If you want to make it 3D or have turn animations, you'd have to learn a bit about how rotations in 3D space work.

If you want to make something _really_ general (like, say, pCubes or Twizzle), then you probably need a much better understanding of 3D geometry than the bare minimum needed just to implement a cube (which is like easy mode because everything has integer coordinates).


----------



## qwr (May 26, 2021)

I think even large puzzles that are non-shapeshifting and don't have sticker orientation can get away with one number per sticker. Ofc if there's sticker orientation then there could be multiple numbers per sticker location. Non-trivial shapeshifting or jumbling makes thinks more complicated.


----------



## xyzzy (May 26, 2021)

qwr said:


> I think even large puzzles that are non-shapeshifting and don't have sticker orientation can get away with one number per sticker. Ofc if there's sticker orientation then there could be multiple numbers per sticker location. Non-trivial shapeshifting or jumbling makes thinks more complicated.


You _could_ do it that way, but creating new puzzles becomes super tedious as you have to manually define all of the sticker coordinates and colours. I'm not entirely sure how pCubes works but I believe you get to specify a base shape (a cube, octahedron, etc., or even something completely custom) then cut it up with some planes, specify the legal turning angles, and it automatically defines the stickers given this information.


----------



## qwr (May 26, 2021)

xyzzy said:


> You _could_ do it that way, but creating new puzzles becomes super tedious as you have to manually define all of the sticker coordinates and colours. I'm not entirely sure how pCubes works but I believe you get to specify a base shape (a cube, octahedron, etc., or even something completely custom) then cut it up with some planes, specify the legal turning angles, and it automatically defines the stickers given this information.


True, true. I plan on mainly targeting nxn cubes which require no manual specification at all.


----------



## Filipe Teixeira (May 26, 2021)

qwr said:


> Do you have any coding experience? Since you linked a python library without an obvious GUI I assume you do.


Yes but I don't like reinventing the wheel.
It's too much time put into something that another person already made
pycuber is exactly what I wanted


----------

