目录
魔豆8888
1,魔方三要素
2,复原方法
魔豆7788
复原方法
魔豆8888数字版
1,问题模型
2,复原方法 待更新
魔豆8888
1,魔方三要素
(1)组成部件
4种颜色的豆子,每种8个
(2)可执行操作
4个小圈可以旋转,1个大圈也可以旋转
(3)目标态
每个小圈都是同色
2,复原方法
只需要3步:大圈旋转1格+小圈旋转180度+大圈反方向旋转1格,即可实现相邻2个小圈之间只有1个魔豆互换。
这样,任意状态都可以复原了。
魔豆7788
不确定是店里的豆子被人扣走了,还是出厂设置就是这样。
一共只有30个魔豆,即7+7+8+8
复原方法
复原方法同魔豆8888
魔豆8888数字版
1,问题模型
有一个长为8N+8a的序列,记为a1 N1 a2 N2 a3 N3 a4 N4 a5 N5 a6 N6 a7 N7 a8 N8
操作集有5种操作:
(1)a1+N1+a2'+N2构成的子序列循环往右移动1位,其中'表示逆序列,下同
(2)a3+N3+a4'+N4构成的子序列循环往右移动1位
(3)a5+N5+a6'+N6构成的子序列循环往右移动1位
(4)a7+N7+a8'+N8构成的子序列循环往右移动1位
(5)a1+a2+a3+a4+a5+a6+a7+a8构成的子序列循环往右移动a位
2,网页版程序
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>四矩形轮换谜题</title> <style> *{box-sizing:border-box;} body{ margin:0; min-height:100vh; padding:22px 14px 50px; font-family:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif; background:radial-gradient(circle at 20% 0%, #1e293b 0%, #0b1120 65%); color:#e2e8f0; } h1{ text-align:center; font-size:20px; font-weight:600; letter-spacing:3px; margin:6px 0 6px; color:#f1f5f9; } .sub{ text-align:center; font-size:13px; color:#8fa1b8; margin-bottom:20px; line-height:1.7; } .sub code{ background:rgba(255,255,255,.08); padding:1px 6px; border-radius:5px; color:#a5b4fc; font-size:12px; } .panel{ max-width:1180px; margin:0 auto 14px; display:flex; flex-wrap:wrap; gap:10px; justify-content:center; align-items:center; } label.field{ display:flex; align-items:center; gap:6px; font-size:13px; color:#94a3b8; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.09); padding:6px 12px; border-radius:10px; } label.field input{ width:52px; background:transparent; border:none; outline:none; color:#e2e8f0; font-size:14px; font-weight:600; text-align:center; font-family:ui-monospace,monospace; } button{ font-family:inherit; font-size:13px; font-weight:600; color:#e2e8f0; cursor:pointer; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.13); padding:8px 16px; border-radius:10px; transition:.15s; } button:hover{ background:rgba(255,255,255,.14); transform:translateY(-1px); } button:active{ transform:translateY(0) scale(.97); } button.primary{ background:linear-gradient(135deg,#4f46e5,#7c3aed); border-color:transparent; box-shadow:0 4px 14px rgba(99,102,241,.35); } button.primary:hover{ box-shadow:0 6px 20px rgba(99,102,241,.5); } button.op{ min-width:96px; background:rgba(56,189,248,.10); border-color:rgba(56,189,248,.28); color:#bae6fd; } button.op:hover{ background:rgba(56,189,248,.22); } button.op5{ background:rgba(251,191,36,.10); border-color:rgba(251,191,36,.3); color:#fde68a; } button.op5:hover{ background:rgba(251,191,36,.22); } .board-wrap{ max-width:1180px; margin:0 auto 20px; padding:10px; background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.06); border-radius:18px; } .board-wrap svg{ width:100%; height:auto; display:block; } .board-wrap svg rect{ transition: fill .28s ease; } .board-wrap svg g.cell{ cursor:pointer; } .board-wrap svg g.cell:hover rect{ stroke:#fff; stroke-width:2; } .board-wrap svg g.cell rect{ transition: fill .28s ease, stroke .15s; } .status{ text-align:center; font-size:14px; letter-spacing:1px; color:#94a3b8; min-height:22px; font-weight:600; } .status.win{ color:#4ade80; text-shadow:0 0 18px rgba(74,222,128,.5); animation:pop .45s ease; } @keyframes pop{ 0%{transform:scale(.9);} 55%{transform:scale(1.08);} 100%{transform:scale(1);} } </style> </head> <body> <h1>四矩形 · 轮换谜题</h1> <div class="sub"> 每个矩形:上下边长 <code>N</code>,左右边长 <code>a</code>;四个矩形共 8 条平行竖线。<br> 点击任一矩形 → 该矩形外围一周循环右移 1 位;点击「竖线轮换」→ 8 条竖线整体循环右移 a 位。<br> 数字按大小分为 <b style="color:#60a5fa">4</b> 种颜色;目标:让每个数字回到它原来的位置。 </div> <div class="panel"> <label class="field">N <input id="inN" type="number" min="1" max="8" value="3"></label> <label class="field">a <input id="inA" type="number" min="1" max="6" value="2"></label> <button id="btnShuffle" class="primary">打乱</button> <button id="btnReset">复原</button> </div> <div class="board-wrap" id="board"></div> <div class="panel"> <button class="op" style="background-color:transparent">3,N=1,a=1![]()
可以先复原颜色:
![]()
再想办法调整圈内顺序。
公式:
轮换*2
2转
轮换*6
2转
轮换*2
2转
轮换*6
2转*4
4,复原方法 待更新