robiningelbrecht/twisty-puzzle-scrambler
Composer 安装命令:
composer require robiningelbrecht/twisty-puzzle-scrambler
包简介
Generate, verify and analyse twisty puzzle scrambles
README 文档
README
Tool to generate, verify and analyse scrambles for various twisty puzzles. This is not an official WCA scrambler but good enough for casual use.
Installation
> composer require robiningelbrecht/twisty-puzzle-scrambler
Usage
Standard cube
Generate random scramble
The RandomScramble factory generates scrambles that are WCA compliant (in size).
// R F2 U' R' U2 F R' F2 R' U' $scramble = RandomScramble::twoByTwo(); // R2 F' R2 D2 B R2 F' L2 U2 F' R2 F' U' F2 R D2 F L R U' L' $scramble = RandomScramble::threeByThree(); // F2 L2 F' U2 L2 B2 D' R2 D' R2 U2 L2 R2 U2 R D' F2 L' D2 B' R Uw2 R' B2 Uw2... $scramble = RandomScramble::fourByFour(); // R' Fw Uw Lw2 Dw U L2 B2 R2 Lw' L F2 Dw' B2 R Rw' L2 Bw' Uw2 D' U' L' Bw D... $scramble = RandomScramble::fiveByFive(); // L D' B L2 3Fw' Fw' Uw2 U' R2 3Rw 3Uw Bw' 3Rw2 Rw' Uw2 3Uw2 3Rw' L2 Lw' D F2... $scramble = RandomScramble::sixBySix(); // 3Bw2 3Rw' 3Dw Uw' 3Bw2 3Rw2 Lw' F B' D Lw' 3Bw' D2 Uw2 3Fw U2 3Lw' 3Dw' B Fw'... $scramble = RandomScramble::sevenBySeven();
Or you can generate scrambles yourself
$scramble = CubeScramble::random($scrabmleSize, Size::fromInt($cubeSize))
Reverse scrambles
$scramble = RandomScramble::threeByThree(); $reversedScramble = $scramble->reverse();
Output scramble as human-readable notation
$scramble = RandomScramble::threeByThree(); print_r($scramble->forHumans());
Turn the right layer 180°
Turn the bottom layer 90° clockwise
Turn the back layer 90° counterclockwise
Turn the bottom layer 180°
Turn the left layer 90° counterclockwise
Turn the back layer 90° counterclockwise
Turn the right layer 90° counterclockwise
Turn the back layer 180°
Turn the top layer 90° clockwise
Turn the right layer 180°
...
Validate and analyse a scramble
$scramble = CubeScramble::fromNotation( "B D R2 U F2 U' R2 U' B2 L2 U2 L2 R2 B' F2 R' U L D' U R'", Size::fromInt($cubeSize) );
At that point the scramble is stringable or jsonSerializable.
When the scramble is invalid, a InvalidScramble exception will be thrown.
Pyraminx
// U' B' L' R' U B U R' l' b u' $scramble = RandomScramble::pyraminx(); $scramble = PyraminxScramble::random($scrabmleSize)
Skewb
// B L' R L' B' U R' B' U' $scramble = RandomScramble::skewb(); $scramble = SkewbScramble::random($scrabmleSize)
Megaminx
// R++ D++ R-- D++ R++ D++ R++ D-- R++ D++ U R++ D-- R-- D-- R-- D++ R++ D-- R++ D++ U... $scramble = RandomScramble::megaminx(); $scramble = MegaminxScramble::random($scrabmleSize, $numberOfSequences)
Clock
// UR1+ DR3- DL0+ UL6+ U4- R6+ D1- L6+ ALL2+ y2 U1+ R3+ D1- L4+ ALL3- DR DL UL $scramble = RandomScramble::clock(); $scramble = CockScramble::random()
Sq1
// (4,0)/ (0,3)/ (3,0)/ (-3,0)/ (2,-1)/ (4,-3)/ (0,-3)/ (0,-2)/ (3,-1)/ (2,-1)/ (3,0)/ (-2,0)/ (3,0)/ (0,-5) $scramble = RandomScramble::sq1(); $scramble = Sq1Scramble::random($scrabmleSize)
robiningelbrecht/twisty-puzzle-scrambler 适用场景与选型建议
robiningelbrecht/twisty-puzzle-scrambler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「Rubiks cube」 「Speedcubing」 「Twisty puzzles」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 robiningelbrecht/twisty-puzzle-scrambler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 robiningelbrecht/twisty-puzzle-scrambler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 robiningelbrecht/twisty-puzzle-scrambler 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Allows the use of the more complex GROUP BY clauses in Doctrine ORM. These include GROUPING SETS, CUBE, and ROLLUP.
A collection of monolog handlers using PSR-18 http client
A PHP client for Cube
A unified component library for Laravel applications supporting both Tailwind CSS (with Flowbite) and Bootstrap frameworks
Template Cube Bootstrap Admin Theme
Alfabank REST API integration
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-06