ITPub博客

首页 > IT职业 > IT图书 > JavaScript打造的一棵圣诞树

JavaScript打造的一棵圣诞树

原创 IT图书 作者:chunzhisu 时间:2014-09-19 10:56:19 0 删除 编辑

点击(此处)折叠或打开

  1. <html xmlns=\"http://www.w3.org/1999/xhtml\">
  2. <head>
  3.    <title>JavaScript打造的一棵圣诞树 -石家庄瑜伽老师培训  石家庄拓展</title>
  4. </head>
  5. <body>
  6. <STYLE>

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

  8. </STYLE>
  9. <BLOCKQUOTE><FONT COLOR=YELLOW><CENTER>

  10.     *<BR>

  11. * * *<BR>

  12.   * *<BR>

  13. <FONT COLOR=GREEN>

  14. <SCRIPT LANGUAGE=\"JavaScript\">

  15. <!--

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

  17. var Length=Math.round(Number)

  18. var width=1;

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

  20. {

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

  22.     {

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

  24.         {

  25.         var NewNumber=Math.random()*15;

  26.         var Ornament=Math.round(NewNumber);

  27.         if (Ornament<=1)

  28.         {

  29.         document.write(\" ^\");

  30.         }

  31.         if (Ornament>=2){

  32.         document.write(\" ^\");

  33.         }

  34.         }

  35.     document.write(\"
    \");

  36.     var width=width+1;

  37.     }

  38. var width=width-2;

  39. }

  40. //-->

  41. </SCRIPT>

  42. </CENTER></FONT></BLOCKQUOTE>

  43. <br />

  44. </body>
  45. </html>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29737856/viewspace-1273912/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-07-04

  • 博文量
    95
  • 访问量
    122224