亂轉公式的規則 - 魔術方塊

By Frederica
at 2012-06-26T10:49
at 2012-06-26T10:49
Table of Contents
我寫過亂數程式,基本上我把不能連接的分開存放
既然你有在寫app, 我寫這樣應該看得懂邏輯吧
<?php
$scramble = array();
$scramble[] = array("R","R'","R2");
$scramble[] = array("L","L'","L2");
$scramble[] = array("U","U'","U2");
$scramble[] = array("D","D'","D2");
$scramble[] = array("F","F'","F2");
$scramble[] = array("B","B'","B2");
$i = 0;
$last = 6;//只要>5即可
while ($i < $times){
$ind = rand(0,5);
$ind2 = rand(0,2);
if ($ind == $last){continue;}//不重覆判斷
$this->go($scramble[$ind][$ind2]);
$last = $ind;
++$i;
}
※ 引述《janice001 (真理)》之銘言:
: 是這樣的。
: 我寫了一個有關魔術方塊的app
: 我記得亂轉公式的產生規則就只有
: 不要跟上一步一樣還有不要是對面的
: ex 上一步是Up 這一步就不可以是up 跟 down
: 我這樣理解沒錯吧?!
: 請問那兒有相關資料可以看一下呢?
: 我搜尋wca的規則 亂轉公式的部份也是參照其程式
: 謝謝各位>"<
--
好 嗎 ▲ ◤ ˋ ◤ ˋ ▎ φhacoolman
好 養一隻邊境牧羊犬, 嗎 / ● ● \ ▲ 養嘛養嘛養嘛
好就能常常換新手機喔! 嗎 ▊/ ◣ ◤ ◣ ◤ \ ▏ 嘛養嘛養嘛
好 嗎 │ │ ▍ 嘛養嘛養嘛
好邊境不養嗎好邊境不◥嗎▊ \ │ ▎ (●ω●)
好邊境不養嗎好邊境不養嗎 \ ︶︶ / ▏嘿~嘿~嘿~
--
Tags:
魔術方塊
All Comments

By Kyle
at 2012-06-27T18:06
at 2012-06-27T18:06

By Dinah
at 2012-06-28T14:05
at 2012-06-28T14:05

By Emma
at 2012-06-30T09:19
at 2012-06-30T09:19

By James
at 2012-07-03T21:07
at 2012-07-03T21:07

By Freda
at 2012-07-07T02:49
at 2012-07-07T02:49

By Annie
at 2012-07-07T22:56
at 2012-07-07T22:56

By Belly
at 2012-07-09T16:49
at 2012-07-09T16:49

By Ivy
at 2012-07-10T23:59
at 2012-07-10T23:59
Related Posts
亂轉公式的規則

By Mary
at 2012-06-25T19:07
at 2012-06-25T19:07
Yau Method 組邊影片教學

By Anonymous
at 2012-06-20T16:07
at 2012-06-20T16:07
3x3x3 tomtim 9.83

By Quintina
at 2012-06-18T17:01
at 2012-06-18T17:01
高雄聚會

By Oliver
at 2012-06-17T21:39
at 2012-06-17T21:39
好久沒玩方塊了,好久沒回台灣了。

By Wallis
at 2012-06-16T11:55
at 2012-06-16T11:55