<?
$rule = array(
array(0,1,2,3,4,5,6,7,8,9
),
array(10,11,12,13,14,15,16,17,18,19),
array(20,21,22,23,24,25,26,27,28,29),
array(30,31,32,33,34,35,36,37,38,39),
array(40,41,42,43,44,45,46,47,48,49),
array(50,51,52,53,54,55,56,57,58,59),
array(60,61,62,63,64,65,66,67,68,69),
array(70,71,72,73,74,75,76,77,78,79),
array(80,81,82,83,84,85,86,87,88,89),
array(90,91,92,93,94,95,96,97,98,99),
/* 21
array( 0, 1, 2, 3,10,11,12,20,21,30),
array( 4,13,14,22,23,24,31,32,33,34),
array( 5, 6, 7, 8,15,16,17,25,26,35),
array( 9,18,19,27,28,29,36,37,38,39),
array(40,41,42,43,44,50,51,52,53,54),
array(45,46,47,48,49,55,56,57,58,59),
array(60,61,62,63,70,71,72,80,81,90),
array(64,73,74,82,83,84,91,92,93,94),
array(65,66,67,68,75,76,77,85,86,95),
array(69,78,79,87,88,89,96,97,98,99)
*/
// 22
array( 0, 1, 2,10,11,12,20,21,30,31),
array( 3, 4, 5, 6,13,14,15,16,24,25),
array( 7, 8, 9,17,18,19,28,29,38,39),
array(22,32,40,41,42,50,51,52,62,72),
array(23,26,33,34,35,36,43,44,45,46),
array(53,54,55,56,63,64,65,66,73,76),
array(27,37,47,48,49,57,58,59,67,77),
array(60,61,70,71,80,81,82,90,91,92),
array(74,75,83,84,85,86,93,94,95,96),
array(68,69,78,79,87,88,89,97,98,99)
);
$initstr = "0123456789A";
//入门
//$dushu =
"040000219500002704007018630206100903410250070750063102062004097094376021005900400";
//中级
//$dushu =
"000040306070000514401360900000958030107200058830700260020095040308072005540000721";
//$dushu =
"000596000700008216036107800074380000320001009861040037013670008290810050000050370";
//专家
//$dushu =
"608004007010000980020901300700006590400138060002000008906000004031400809000720000";
//终级
//$dushu =
"050100006020000503040900000000080902002060400507030000000005020308000050200007010";
//$dushu =
"090100050100030000000090008000010000060302090471080000700050000020000600000008045";
//$dushu =
"028406000000018000009000300050000009070000400000069010601200004000300000000000250";
$dushu =
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
init($arrdu,$dushu,$initstr);
/*
foreach(array(36,61) as $i)$arrdu[$i] =
'01'; //1
foreach(array(18,27,41,49,50,58,63,67,72,85,89) as $i)$arrdu[$i] =
'023'; //2
foreach(array(1,9,10,23,32,38,45,54,76,83,94,98) as $i)$arrdu[$i] =
'0456'; //3
foreach(array(5,14,16,81,90) as $i)$arrdu[$i] = '0789A';//4
23->2
456->3
789A->4
2 4 1 A 8 7 6 3 9 5
5 9 3 1 7 4 8 A 2 6
7 8 6 4 2 1 5 3 A 9
6 9 5 A 3 2 1 7 4 8
1 2 8 7 A 4 6 5 9 3
3 6 5 9 4 1 7 A 2 8
A 1 4 2 6 8 5 3 7 9
9 6 3 2 7 1 4 A 5 8
5 7 9 4 8 2 6 A 1 3
8 3 A 1 5 9 6 7 4 2
替换后
2 3 1 4 4 4 3 2 4 3
3 4 2 1 4 3 4 4 2 3
4 4 3 3 2 1 3 2 4 4
3 4 3 4 2 2 1 4 3 4
1 2 4 4 4 3 3 3 4 2
2 3 3 4 3 1 4 4 2 4
4 1 3 2 3 4 3 2 4 4
4 3 2 2 4 1 3 4 3 4
3 4 4 3 4 2 3 4 1 2
4 2 4 1 3 4 3 4 3 2
*/
foreach(array(18,59) as $i)$arrdu[$i] =
'01'; //1
foreach(array(11,20,22,46,53,79,84) as $i)$arrdu[$i] =
'023'; //2
foreach(array(0,6,15,49,50,77,88,99,93) as $i)$arrdu[$i] =
'0456'; //3
foreach(array(3,9,14,27,29,40,43,56,70,72,81,85,90,96) as
$i)$arrdu[$i] = '0789A';//4
?>
|