Comments (2)
Link to page capturing thoughts on how best to approach this
from cubits.
I've had a change of heart with this. I have implemented the basic mechanics to be able to orientate a face while optionally providing a face to lock. This doesn't orientate 2 faces of the cube at once as initially intended but it dawned on me that this type of logic would be better placed in a cube operator (tracked here #4)
So now! the implementation does the following:
- Accepts a source axis (face) and target axis (face) for example Top, Left, Bottom etc
- Accepts an optional face to lock.
- Not providing lock face will attempt to first preserve the front (and back) face, if the front or back is the source or target it will then attempt to preserve the top and bottom. This ensures predictability when orientating faces!!!
- Providing the locked face will then either throw an error if it is not possible (i.e. the source or target IS or will end up being the locked face)
I feel that this is enough functionality to include in the cube. The cube should only be bothered or responsible for manipulating its cube state as a single transaction and not about logic needed to orientate more than 1 face which would be 2 transactions.
What I intend to do is have a cube notation interpreter that will parse cube notation. If the notiation includes something like TDLR (top down left right) or WLGB (White Up, Green Back) then it will interpret the first as an orientation then the second it will check if the first was also an orientation task and presume that the last face was intended to be locked!!
I feel this is a better place for this logic to sit!!
Yes it means the convenience of this is not built directly INTO the cube but as per example13 in the examples folder it is not difficult to implement such a mechanism!
from cubits.
Related Issues (9)
- Implement Cube Operator to separate cube mechanics from operating a cube beyond just rotating layers and the cube as a whole
- Implement a solver that will analyse a cube state then manipulate it to put it back into a solved state
- Protect cubestate by making it read only
- Rotation of a face Clockwise or Anticlockwise is counter intuitive.
- Optimise typescript so that transpiled output is smaller HOT 1
- Make the cube more useful HOT 1
- There are 2 implementations of comparing arrays for likeness. optimise the code by removing 1
- update rotateLayerForColour. change to rotateLayer and allow passing in either a colour OR an orientation OR!!! add a rotateLayerForOrientation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cubits.