Git Product home page Git Product logo

Comments (2)

markforster avatar markforster commented on August 17, 2024

Link to page capturing thoughts on how best to approach this

from cubits.

markforster avatar markforster commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.