无标题文档
紫微斗数核心排盘代码 源码 开源 ===周易排盘软件开源代码===
红易紫微预测网www.homeyi.com
//——————————-
//求出 命宫和身宫 homeyi.com 红易紫微预测网
<%’命宫和身宫,
dim Minggong(11)
dim shenGong(11)
MingGIndex=(m-1-hIndex+12)mod 12
ShenGIndex=(m-1+HiNdex+12)mod 12
for i=0 to 11
shengong(i)=”  ”
next
minggong(MinggIndex)=”<font color=yellow><span style=’background-color: #ff0000′>命</span></font>”
shengong(shengIndex)=”<font color=yellow><span style=’background-color: #ff0000′>身</span></font>” homeyi.com 红易紫微预测网
‘排12宫,以命工为基准,逆排
for i=1 to 11
MgIndex=(MinggIndex-i+12)mod 12
minggong(mgindex)=segong(i-1)
next
%> homeyi.com 红易紫微预测网
//———————————————————–
<%’五行局和五行纳音
wxIndex=(minggindex+2)mod 12
wxgz=dptg(wxindex)&dz(wxindex)
wxNayin=nayins(wxgz) homeyi.com 红易紫微预测网
select case right(trim(wxnayin),1)
case “火” WxJU=”火六局”
Jindex=6
case “土” wxju=”土五局”
Jindex=5
case “水” wxju=”水二局”
Jindex=2
case “木” wxju=”木三局”
Jindex=3
case “金” wxju=”金四局”
Jindex=4
end select
‘call nayin(“癸未”)
%>
//——————————————–
//求紫微星所在位置 及其他星曜的宫位
<%’安紫薇诸星
dim zwxing(11)
dim tfxing(11)
zwTemp=d mod jindex ‘余��
zwInt=d\jindex ‘商 homeyi.com 红易紫微预测网
if zwTemp=0 then
zwindex=(zwInt-1) mod 12
else if zwInt=0 then
select case jindex
case 6 zwindex=12 mod (7+zwTemp-1)
case 5 zwindex=12 mod (4+zwTemp-1)
case 4 zwindex= 12 mod (9+zwTemp-1)
case 3 zwindex=12 mod (2+zwTemp-1)
case 2 zwindex=12 mod (11+zwTemp-1)
end select
else
select case jindex
case 6
select case zwTemp
case 5 zwindex=(11+zwInt) mod 12
case 4 zwindex=(2+zwInt) mod 12
case 3 zwindex=(9+zwInt) mod 12
case 2 zwindex=(4+zwInt) mod 12
case 1 zwindex=(7+zwInt) mod 12
end select homeyi.com 红易紫微预测网
case 5
select case zwTemp
case 4 zwindex=(11+zwInt) mod 12
case 3 zwindex=(2+zwInt) mod 12
case 2 zwindex=(9+zwInt) mod 12
case 1 zwindex=(4+zwInt) mod 12
end select
case 4
select case zwTemp
case 3 zwindex=(11+zwInt) mod 12
case 2 zwindex=(2+zwInt) mod 12
case 1 zwindex=(9+zwInt) mod 12
end select
case 3 homeyi.com 红易紫微预测网
select case zwTemp
case 2 zwindex=(11+zwInt) mod 12
case 1 zwindex=(2+zwInt) mod 12
end select
case 2 zwindex=(11+zwInt) mod 12
end select
end if
end if ‘分三种情况求出紫薇星的落宫
zwxing(zwindex)=”紫微”
select case ytg
case “乙” zwxing(zwindex)=”紫微【科】”
case “壬” zwxing(zwindex)=”紫微【权】”
end select
tianjiindex=(zwindex+11)mod 12
zwxing(tianjiindex)=”天机”
select case ytg
case “乙” zwxing(tianjiindex)=”天机【禄】”
case “丙” zwxing(tianjiindex)=”天机【权】”
case “丁” zwxing(tianjiindex)=”天机【科】”
case “戊” zwxing(tianjiindex)=”天机【忌】”
end select
taiyangindex=(zwindex+9)mod 12
zwxing(taiyangindex)=”太阳”
select case ytg
case “甲” zwxing(taiyangindex)=zwxing(taiyangindex)&”【忌】”
case “庚” zwxing(taiyangindex)=zwxing(taiyangindex)&”【禄】”
case “辛” zwxing(taiyangindex)=zwxing(taiyangindex)&”【权】”
end select homeyi.com 红易紫微预测网
wuquindex=(zwindex+8)mod 12 homeyi.com 红易紫微预测网
if minggindex=3 or minggindex=5 then
zwxing(wuquindex)=”武曲(命主)”
else
zwxing(wuquindex)=”武曲”
end if
select case ytg
case “甲” zwxing(wuquindex)=zwxing(wuquindex)&”【科】”
case “己” zwxing(wuquindex)=zwxing(wuquindex)&”【禄】”
case “庚” zwxing(wuquindex)=zwxing(wuquindex)&”【权】”
case “壬” zwxing(wuquindex)=zwxing(wuquindex)&”【忌】”
end select
zwxing((zwindex+7)mod 12)=”天同”
select case ytg
case “丙” zwxing((zwindex+7)mod 12)=”天同【禄】”
case “丁” zwxing((zwindex+7)mod 12)=”天同【权】”
case “庚” zwxing((zwindex+7)mod 12)=”天同【科】”
end select
zwxing((zwindex+4)mod 12)=”廉贞”
select case ytg
case “甲” zwxing((zwindex+4)mod 12)=”廉贞【禄】”
case “丙” zwxing((zwindex+4)mod 12)=”廉贞【忌】”
end select
‘天府八星
TfIndex=(12-zwindex)mod 12
tfxing(tfindex)=”天府”
taiyinindex=(tfindex+1)mod 12
tfxing(taiyinindex)=”太阴”
select case ytg homeyi.com 红易紫微预测网
case “丁” tfxing(taiyinindex)=tfxing(taiyinindex)&”【禄】”
case “庚” tfxing(taiyinindex)=tfxing(taiyinindex)&”【忌】”
case “癸” tfxing(taiyinindex)=tfxing(taiyinindex)&”【科】”
case “戊” tfxing(taiyinindex)=tfxing(taiyinindex)&”【权】”
end select
tanlangindex=(tfindex+2)mod 12 homeyi.com 红易紫微预测网
if minggindex=10 then
tfxing(tanlangindex)=”贪狼(命主)”
else
tfxing(tanlangindex)=”贪狼”
end if
select case ytg
case “戊” tfxing(tanlangindex)= tfxing(tanlangindex)&”【禄】”
case “己” tfxing(tanlangindex)= tfxing(tanlangindex)&”【权】”
case “癸” tfxing(tanlangindex)= tfxing(tanlangindex)&”【忌】”
end select
jumenindex=(tfindex+3)mod 12
if minggindex=11 or minggindex=9 then
tfxing(jumenindex)=”巨门(命主)”
else
tfxing(jumenindex)=”巨门”
end if homeyi.com 红易紫微预测网
select case ytg
case “丁” tfxing(jumenindex)=tfxing(jumenindex)&”【忌】”
case “辛” tfxing(jumenindex)=tfxing(jumenindex)&”【禄】”
case “癸” tfxing(jumenindex)=tfxing(jumenindex)&”【权】”
end select
tfxing((tfindex+4)mod 12)=”天相”
tianliangindex=(tfindex+5)mod 12
if ytg=”乙” then
tfxing(tianliangindex)=”天梁【权】”
else
tfxing(tianliangindex)=”天梁”
end if
tfxing((tfindex+6)mod 12)=”七杀”
if minggindex=4 then
tfxing((tfindex+10)mod 12)=”破军(命主)”
else
tfxing((tfindex+10)mod 12)=”破军”
end if
select case ytg
case “甲” tfxing((tfindex+10)mod 12)=tfxing((tfindex+10)mod 12)&”【权】”
case “癸” tfxing((tfindex+10)mod 12)=tfxing((tfindex+10)mod 12)&”【禄】”
end select
%>
<%’文昌文曲,文昌逆数到生时,文曲顺数到生时
dim wenchang(11)
wenchang((12-hindex+10)mod 12)=”文昌”
select case ytg
case “丙” wenchang((12-hindex+10)mod 12)=”文昌【科】”
case “辛” wenchang((12-hindex+10)mod 12)=”文昌【忌】”
end select
if minggindex=1 or minggindex=7 then
wenchang((hindex+4)mod 12)=”文曲(命主)” homeyi.com 红易紫微预测网
else
wenchang((hindex+4)mod 12)=”文曲”
end if
select case ytg
case “己” wenchang((hindex+4)mod 12)=wenchang((hindex+4)mod 12)&”【忌】”
case “辛” wenchang((hindex+4)mod 12)=wenchang((hindex+4)mod 12)&”【科】”
end select
engindex=(12-hindex+10+d-2)mod 12 ‘恩光序号文昌顺数到生日,退后一步是恩光,文曲顺数到生日,退后一步天贵扬
tianguiindex=(((hindex+4)mod 12)+d-2)mod 12’天贵序号
djindex=(11+hindex)mod 12
tkindex=(11-hindex+12)mod 12
apindex=(hindex+6)mod 12 ‘台铺
hxindex=(hindex+8)mod 12 ‘诰乡
if wenchang(apindex)<>”” then
wenchang(apindex) =wenchang(apindex)&”台铺”
else
wenchang(apindex) =”台铺”
end if
if wenchang(hxindex)<>”” then
wenchang(hxindex) =wenchang(hxindex)&”诰乡”
else
wenchang(hxindex) =”诰乡”
end if
if wenchang(djindex)<>”” then ‘安地劫
wenchang(djindex)=wenchang(djindex)&”地劫”
else
wenchang(djindex)=”地劫” homeyi.com 红易紫微预测网
end if
if wenchang(tkindex)<>”” then ‘安天空劫
wenchang(tkindex)=wenchang(tkindex)&”天空劫”
else
wenchang(tkindex)=”天空劫”
end if
%>
<%’火灵二星
dim huoling(11)
select case right(ygz,1)
case “寅”,”午”,”戌” hxbg=”丑卯”
xiaoxian=”辰”
case “申”,”子”,”辰” hxbg=”寅戌”
xiaoxian=”戌”
case “亥”,”卯”,”未” hxbg=”酉戌”
xiaoxian=”丑”
case “巳”,”酉”,”丑” hxbg=”卯戌”
xiaoxian=”未”
‘ case 再从始处来起子
‘ case 顺至生时是炎乡。
end select
hgindex=dzorder(left(hxbg,1)) ‘火星起宫
lgindex=dzorder(hxbg) ‘灵星起宫
hgindex=(hgindex+hindex-1)mod 12
lgindex=(lgindex+hindex-1)mod 12
huoling(hgindex)=”火星”
huoling(lgindex)=”铃星”
‘起月系星星
zpindex=(4+m-1)mod 12 ‘左辅
youbiindex=(10-m+1+12)mod 12 ‘右弼
tianyindex=(m)mod 12
tianxindex=(9+m-1)mod 12
if huoling(zpindex)<>”” then
huoling(zpindex)=huoling(zpindex)&”左辅”
else
huoling(zpindex)=”左辅”
end if
if ytg=”壬” then homeyi.com 红易紫微预测网
huoling(zpindex)=huoling(zpindex)&”【科】”
end if
if huoling(youbiindex)<>”” then
huoling(youbiindex)=huoling(youbiindex)&”右弼”
else
huoling(youbiindex)=”右弼”
end if ‘以上为作辅右臂
if ytg=”戊” then
huoling(youbiindex)=huoling(youbiindex)&”【权】”
end if
if huoling(tianyindex)<>”” then
huoling(tianyindex)=huoling(tianyindex)&”天姚”
else
huoling(tianyindex)=”天姚”
end if
if huoling(tianxindex)<>”” then
huoling(tianyindex)=huoling(tianxindex)&”天刑”
else
huoling(tianxindex)=”天刑”
end if
select case m
case 1,5,9 tianmindex=8
tianwindex=5
case 7,11,3 tianmindex=2
tianwindex=2
case 4,8,12 tianmindex=5
tianwindex=8
case 2,10,6 tianmindex=11
tianwindex=11
end select
if huoling(tianmindex)<>”” then
huoling(tianmindex)=huoling(tianmindex)&”天马”
else
huoling(tianmindex)=”天马”
end if
if huoling(tianwindex)<>”” then
huoling(tianwindex)=huoling(tianwindex)&”天巫”
else
huoling(tianwindex)=”天巫”
end if
select case m
case 1,2 jieshenindex=8
case 3,4 jieshenindex=10
case 5,6 jieshenindex=0
case 7,8 jieshenindex=2
case 9,10 jieshenindex=4
case 11,12 jieshenindex=6
end select
select case m
case 1 tianyueindex=10
yinshaindex=2
case 2 tianyueindex=5
yinshaindex=0
case 3 tianyueindex=4 homeyi.com 红易紫微预测网
yinshaindex=10
case 4 tianyueindex=2
yinshaindex=8
case 5 tianyueindex=7
yinshaindex=6
case 6 tianyueindex=3
yinshaindex=4
case 7 tianyueindex=11
yinshaindex=2
case 8 tianyueindex=7
yinshaindex=0
case 9 tianyueindex=2
yinshaindex=10
case 10 tianyueindex=6
yinshaindex=8
case 11 tianyueindex=10
yinshaindex=6
case 12 tianyueindex=2
yinshaindex=4
end select
if huoling(jieshenindex)<>”” then
huoling(jieshenindex)=huoling(jieshenindex)&”解神”
else
huoling(jieshenindex)=”解神”
end if
if huoling( homeyi.com 红易紫微预测网 tianyueindex)<>”” then
huoling(tianyueindex)=huoling(tianyueindex)&”天月”
else
huoling(tianyueindex)=”天月”
end if
select case ytg
case “乙” huoling(tianyueindex)=huoling(tianyueindex)&”【忌】”
case “戊” huoling(tianyueindex)=huoling(tianyueindex)&”【权】”
end select
if huoling(yinshaindex)<>”” then
huoling(yinshaindex)=huoling(yinshaindex)&”阴煞”
else
huoling(yinshaindex)=”阴煞”
end if
%>
<% ‘日系星星三台三台从左辅上起初一,顺行至本生日安之
‘八座从右弼上起初一,逆行至本生日安之
santindex=(zpindex+d-1)mod 12
bazuoindex=(youbiindex-((d-1) mod 12)+12)mod 12
if wenchang(santindex)<>”” then
wenchang(santindex)=wenchang(santindex)&”三台”
else
wenchang(santindex)=”三台”
end if
if wenchang(bazuoindex)<>”” then
wenchang(bazuoindex)=wenchang(bazuoindex)&”八座”
else
wenchang(bazuoindex)=”八座”
end if
if wenchang(engindex)<>”” then
wenchang(engindex)=wenchang(engindex)&”恩光”
else
wenchang(engindex)=”恩光”
end if
if wenchang(tianguiindex)<>”” then
wenchang(tianguiindex)=wenchang(tianguiindex)&”天贵”
else
wenchang(tianguiindex)=”天贵”
end if
%> homeyi.com 红易紫微预测网
<%’干系星星 甲寅乙卯丙禄巳,丁己午兮禄所至,庚禄居申辛禄酉,壬禄在亥癸禄子
select case left(ygz,1)
case “甲” luncun=”寅”
case “乙” luncun=”卯”
case “丙” luncun=”巳”
case “丁”,”己” luncun=”午”
case “庚” luncun=”申”
case “辛” luncun=”酉”
case “壬” luncun=”亥”
case “癸” luncun=”子”
case “戊” luncun=”丑”
end select
lcindex=dzorder(luncun)-1
lcindex=(lcindex+10)mod 12
qingyindex=(lcindex+1)mod 12
tuoluoindex=(lcindex+11)mod 12
if minggindex=0 or minggindex=8 then
mingzhu=”禄存(命主)”
else
mingzhu=”禄存”
end if
if zwxing(lcindex)<>”” then
zwxing(lcindex)=zwxing(lcindex)&””&mingzhu
else
zwxing(lcindex)=mingzhu
end if homeyi.com 红易紫微预测网
if zwxing(tuoluoindex)<>”” then
zwxing(tuoluoindex)=zwxing(tuoluoindex)&”陀罗”
else
zwxing(tuoluoindex)=”陀罗”
end if
if zwxing(qingyindex)<>”” then
zwxing(qingyindex)=zwxing(qingyindex)&”擎羊”
else
zwxing(qingyindex)=”擎羊”
end if
select case left(ygz,1)
case “甲”,”戊”,”庚” tiankui=”丑”
tianji=”未”
case “乙”,”己”
tiankui=”子”
tianji=”申”
‘寅申乡
case “丙”,”丁”
tiankui=”亥”
tianji=”酉”
‘”巳”酉
case “壬”,”癸”
tiankui=”卯”
tianji=”巳”
‘巳亥
case “辛” homeyi.com 红易紫微预测网
tiankui=”午”
tianji=”寅”
‘午虎
end select
tiankuiindex=dzorder(tiankui)-1
tianjiindex=dzorder(tianji)-1
tiankuiindex=(tiankuiindex+10)mod 12
tianjiindex=(tianjiindex+10)mod 12
‘response.Write(tiankui&tianji)
if zwxing(tiankuiindex)<>”” then
zwxing(tiankuiindex)=zwxing(tiankuiindex)&”天魁”
else
zwxing(tiankuiindex)=”天魁”
end if
if zwxing(tianjiindex)<>”” then
zwxing(tianjiindex)=zwxing(tianjiindex)&”天钺”
else
zwxing(tianjiindex)=”天钺”
end if
select case left(ygz,1)
case “甲” tianguan=7
tianfu=9
case “乙” tianguan=4
tianfu=8
case “丙” tianguan=5
tianfu=0
case “丁” tianguan=2
tianfu=11
case “戊” tianguan=3
tianfu=3
case “己” tianguan=9
tianfu=2
case “庚” tianguan=11
tianfu=6
case “辛” tianguan=7
tianfu=5
case “壬” tianguan=10
tianfu=6
case “癸” tianguan=6
tianfu=5
end select
tianfuindex=(tianfu+10)mod 12
tianguanindex=(tianguan+10)mod 12
if zwxing(tianfuindex)<>”” then
zwxing(tianfuindex)=zwxing(tianfuindex)&”天福”
else
zwxing(tianfuindex)=”天福”
end if
if zwxing(tianguanindex)<>”” then
zwxing(tianguanindex)=zwxing(tianguanindex)&”天官”
else
zwxing(tianguanindex)=”天官”
end if
%>
//流年星耀的宫位
//—————————————–
<%dim boshis(11) ’12博士
‘response.Write(orders)
if orders then
for i=0 to 11
boshis((lcindex+2+i)mod 12)=boshi(i)
next
else
for i=0 to 11
boshis((lcindex+14-i)mod 12)=boshi(i)
next
end if
ydzorder=dzorder(ygz)
tianxuindex=(6+ydzorder-1)mod 12
tiankuindex=(19-ydzorder)mod 12
longciindex=(4+ydzorder-1)mod 12
fenggeindex=(15-ydzindex)mod 12
hongluanindex=(16-ydzorder)mod 12
tianxiindex=(hongluanindex+6)mod 12
boshis(tianxuindex)=boshis(tianxuindex)&”天虚”
boshis(tiankuindex)=boshis(tiankuindex)&”天哭”
boshis(longciindex)=boshis(longciindex)&”龙池”
boshis(fenggeindex)=boshis(fenggeindex)&”凤阁”
boshis(hongluanindex)=boshis(hongluanindex)&”红鸾”
boshis(tianxiindex)=boshis(tianxiindex)&”天喜”
‘response.write boshis(hongluanindex)&hongluanindex
select case right(ygz,1)
case “寅”,”卯”,”辰” guchen=”巳”
guaxiu=”丑”
case “巳”,”午”,”未” guchen=”申”
guaxiu=”辰”
case “申”,”酉”,”戌” guaxiu=”亥”
guchen=”未”
case “亥”,”子”,”丑” guchen=”寅”
guaxiu=”戌”
end select
guchenindex=dzorder(guchen)-1
guaxiuindex=dzorder(guaxiu)-1 homeyi.com 红易紫微预测网
boshis(guchenindex)=boshis(guchenindex)&”孤辰”
boshis(guaxiuindex)=boshis(guaxiuindex)&”寡宿”
ygzorders=dzorder(ygz)
‘select case (ygzorder-1)mod 3
‘ case 0 beilianindex=(21-ygzorder)mod 12
‘ case 1 beilianindex=(23-ygzorder)mod 12
‘case 2 beilianindex=(25-ygzorder)mod 12
‘end select
beilianindex=(ygzorders+8)mod 12
select case right(ygz,1)
case “子”,”午”,”卯”,”酉” poshui=”巳”
case “寅”,”申”,”巳”,”亥” poshui=”酉”
case “辰”,”戌”,”丑”,”未” poshui=”丑”
end select
poshuiindex=dzorder(poshui)-1
boshis(poshuiindex)=boshis(poshuiindex)&”破碎”
boshis(beilianindex)=boshis(beilianindex)&”蜚廉”
tiancaiindex=(((minggindex+2)mod 12)+ydzorder-1)mod 12
tianshouindex=(((shengindex+2)mod 12)+ydzorder-1)mod 12
boshis(tiancaiindex)=boshis(tiancaiindex)&”天才”
boshis(tianshouindex)=boshis(tianshouindex)&”天寿” homeyi.com 红易紫微预测网
%>
<%select case wxju
case “水二局” changsh=”申”
case “木三局” changsh=”亥”
case “金四局” changsh=”巳”
case “土五局” changsh=”申”
case “火六局” changsh=”寅”
end select
changshindex=dzorder(changsh)-1
if orders then
for i=0 to 11
dptg((i+changshindex)mod 12)=changsheng(i)&””&dptg((i+changshindex)mod 12)
next
else
for i=0 to 11
dptg((changshindex-i+12)mod 12)=changsheng(i)&””&dptg((changshindex-i+12)mod 12)
next
end if
%>
<%select case left(ygz,1) homeyi.com 红易紫微预测网
case “甲”,”己” jiekong=”申酉”
case “乙”,”庚” jiekong=”午未”
case “丙”,”辛” jiekong=”辰巳”
case “丁”,”壬” jiekong=”寅卯”
case “戊”,”癸” jiekong=”子丑”
end select
jieluindex=dzorder(left(jiekong,1))-1
kongmangindex=dzorder(jiekong)-1
if wenchang(jieluindex)<>”” then
wenchang(jieluindex)=wenchang(jieluindex)&”截路空亡”
else
wenchang(jieluindex)=”截路”
end if
if wenchang(kongmangindex)<>”” then
wenchang(kongmangindex)=wenchang(kongmangindex)&”空亡”
else
wenchang(kongmangindex)=”空亡” homeyi.com 红易紫微预测网
end if
%>
<%call xunkong(ygz,xk,xunshou)
select case xunshou
case “甲子” xunzhong=”戌亥”
case “甲戌” xunzhong=”申酉”
case “甲申” xunzhong=”午未”
case “甲午” xunzhong=”辰巳”
case “甲辰” xunzhong=”寅卯”
case “甲寅” xunzhong=”子丑”
end select
xunzhongindex=dzorder(left(xunzhong,1))-1
kongwangindex=dzorder(xunzhong)-1
if wenchang(xunzhongindex)<>”” then
wenchang(xunzhongindex)=wenchang(xunzhongindex)&”旬中”
else
wenchang(xunzhongindex)=”旬中”
end if
if wenchang(kongwangindex)<>”” then
wenchang(kongwangindex)=wenchang(kongwangindex)&”空亡”
else
wenchang(kongwangindex)=”空亡”
end if
%> homeyi.com 红易紫微预测网
www.homeyi.com 红易紫微预测网
Copyright © 2002-2012 Homeyi Corporation, All Rights Reserved
[苏ICP证05059388号] 红易紫微预测网 版权所有©