?? nihongdeng.htm
字號:
<html>
<head>
<title>dhtml demo </title>
<script language="vbscript">
dim lifematrix(),outstring
nox =17
noy =51
redim lifematrix(nox,noy)
sub start()
call initialize_matrix()
call matrix_out()
end sub
sub wholives()
dim tempmat()
redim tempmat(nox,noy)
for i=0 to nox
for j=0 to noy
tempmat(i,j)=lifematrix(i,j)
next
next
for i=1 to nox-1
for j=1 to noy-1
nntotal =(tempmat(i-1,j-1) + tempmat(i,j-1) + tempmat(i+1,j-1) +
tempmat(i-1,j) + tempmat(i+1,j) + tempmat(i-1,j+1) + tempmat(i,j+1) +
tempmat(i+1,j+1))
if lifematrix(i,j) =1 and (nntotal <= 1 or nntotal >= 4) then
lifematrix(i,j) =0
elseif lifematrix(i,j) =0 and(nntotal = 3) then
lifematrix(i,j)=1
elseif lifematrix(i,j)=1 and (nntotal = 3 or nntotal = 2) then
lifematrix(i,j)=1
end if
next
next
call matrix_out()
end sub
sub initialize_matrix()
randomize
for i=0 to nox
for j=0 to noy
lifematrix(i,j)=0
next
next
for i =0 to 300
p=(int(rnd*(nox-1))+1)
q=(int(rnd*(noy-1))+1)
lifematrix(p,q) =1
next
end sub
sub matrix_out()
for i=0 to nox
for j=0 to noy
if lifematrix(i,j)=0 then
outstring = outstring + "="
else
outstring = outstring + "n"
end if
next
outstring = outstring + chr(13)
next
document.all.lifestyle.innertext=outstring
outstring=""
end sub
</script>
<style>
<!--
body {background:black;}
.check{font-family:"webdings";
color:#f0f;
font-size:8pt;
line-height:90%
}
.logo{position:absolute;
filter:alpha(opacity=85);
top:40px;
left:10px;
font-family:impact;
font-weight:bold;
font-size:96px;
text-align:center;
color:#ffffff;
}
.subhead{position:absolute;
top:160px;
left:5px;
font-family:verdana;
font-weight:bold;
font-size:20px;
font-style:italic;
color:#ff0;
}
-->
</style>
<script language="javascript">
function settimer(){
setinterval("wholives()",100,"vbscript");
start();
}
</script>
</head>
<body bgcolor="#000000" onload ="settimer()">
<div align="center" class="check" id="lifestyle"></div>
<div align="center" class="logo">
<p>sway's home</p>
</div>
<div align="center" class="subhead">
<P> a place that you have never imagined.</p>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -