Neoplastic Plasma Medusa

    rubiks-cube-scramble
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    rubiks-cube-scramble

    A Rubiks Cube Scramble Generator

    Installation

    npm install rubiks-cube-scramble
    yarn add rubiks-cube-scramble

    Usage

    import scrambleGenerator from "rubiks-cube-scramble";
     
    export const Scrambler = () => {
      const [scramble, setScramble] = useState();
     
      const handleScramble = () => {
        setScramble(scrambleGenerator());
      };
     
      return (
        <div>
          <strong>{scramble}</strong>
          <button onClick={() => handleScramble}>Scramble!</button>
        </div>
      );
    };
    Output: "D F2 B2 D2 R' B F' R L U2 F U R' B L B' F2 D F R'"

    Options

    import scrambleGenerator from "rubiks-cube-scramble";
     
    const scramble;
     
    // generate scramble with 30 turns
    scramble = scrambleGenerator({ turns: 30 });
    // generate scramble in array type
    scramble = scrambleGenerator({ array: true });

    Install

    npm i rubiks-cube-scramble

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.95 kB

    Total Files

    6

    Last publish

    Collaborators

    • troykessler