$tianGan = Array (' A ', ' B ', ' C ', ' ding ', ' e ', ' self ', ' Geng ', ' xin ', ' ren ', ' decyl ');
$diZhi = Array (' child ', ' ugly ', ' Yin ', ' Mao ', ' Chen ', ' have ', ' noon ', ' not ', ' shen ', ' unitary ', ' Xu ', ' Hai ');
How to output the following results:
$GZ = Array (
'甲子','乙丑','丙寅','丁卯','戊辰','已巳','庚午','辛未','壬申','癸酉', '甲戌','乙亥','丙子','丁丑','戊寅','已卯','庚辰','辛巳','壬午','癸未', '甲申','乙酉','丙戌','丁亥','戊子','己丑','庚寅','辛卯','壬辰','癸巳', '甲午','乙未','丙申','丁酉','戊戌','已亥','庚子','辛丑','壬寅','癸卯', '甲辰','乙巳','丙午','丁未','戊申','已酉','庚戌','辛亥','壬子','癸丑', '甲寅','乙卯','丙辰','丁巳','戊午','已未','庚申','辛酉','壬戌','癸亥'
);
is the so-called 60 koshien.
Reply content:
$tianGan = Array (' A ', ' B ', ' C ', ' ding ', ' e ', ' self ', ' Geng ', ' xin ', ' ren ', ' decyl ');
$diZhi = Array (' child ', ' ugly ', ' Yin ', ' Mao ', ' Chen ', ' have ', ' noon ', ' not ', ' shen ', ' unitary ', ' Xu ', ' Hai ');
How to output the following results:
$GZ = Array (
'甲子','乙丑','丙寅','丁卯','戊辰','已巳','庚午','辛未','壬申','癸酉', '甲戌','乙亥','丙子','丁丑','戊寅','已卯','庚辰','辛巳','壬午','癸未', '甲申','乙酉','丙戌','丁亥','戊子','己丑','庚寅','辛卯','壬辰','癸巳', '甲午','乙未','丙申','丁酉','戊戌','已亥','庚子','辛丑','壬寅','癸卯', '甲辰','乙巳','丙午','丁未','戊申','已酉','庚戌','辛亥','壬子','癸丑', '甲寅','乙卯','丙辰','丁巳','戊午','已未','庚申','辛酉','壬戌','癸亥'
);
is the so-called 60 koshien.
var tianGan = ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'], diZhi = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'], tianGanLength = tianGan.length, dizhiLength = diZhi.length, i = 0, j = 0, result = []; while (1) { var x = i % tianGanLength, y = j % dizhiLength; if (x == 0 && y == 0 && i) { break; } result.push(tianGan[x] + diZhi[y]); i++; j++; }
The code is out of the way. The general method is to observe the law first of all, if obscure so inconvenient to see can be converted into a number of observations of the law This example is actually ten zodiac overall cycle six times that total 60 times each zodiac count and the earthly +1 judgment exceeds the respective totals back to the first Basically, this is the way to write.