电脑技术学习

一棵非常漂亮的圣诞树,是用程序做成的

dn001

<!-- 把如下代码加入<body>区域中 -->
<STYLE>

BLOCKQUOTE {
font-weight:900; line-height:0.75em}

</STYLE>
<BLOCKQUOTE><FONT COLOR=YELLOW><CENTER>

*<BR>

*; *; *<BR>

*; *<BR>

<FONT COLOR=GREEN>

<SCRIPT LANGUAGE="JavaScript">

<!--

var Number=Math.random()*10+3;

var Length=Math.round(Number)

var width=1;

for (i=0; i<=Length; i++)

{

for (x=0; x<=4; x++)

{

for (y=1; y<=width; y++)

{

var NewNumber=Math.random()*15;

var Ornament=Math.round(NewNumber);

if (Ornament<=1)

{

document.write("</FONT><FONT COLOR=RED> ^</FONT><FONT COLOR=GREEN>");

}

if (Ornament>=2){

document.write(" ^");

}

}

document.write("<BR>");

var width=width+1;

}

var width=width-2;

}

//-->

</SCRIPT>

</CENTER></FONT></BLOCKQUOTE>