首页 > 编程 > HTML > 正文

hta 实现的五子棋界面

2020-01-25 19:35:39
字体:
来源:转载
供稿:网友

这篇文章主要介绍了hta 实现的五子棋界面,需要的朋友可以参考下

保存为 五子棋.hta,运行即可看到效果

 

 
  1. <html> 
  2. <title>五子棋界面 - zh159</title> 
  3. <hrad> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  5. <HTA:APPLICATION 
  6. ID="MyhyliApp" 
  7. APPLICATIONNAME="五子棋界面 - zh159" 
  8. BORDER="thin" 
  9. BORDERSTYLE="" 
  10. VERSION="1.0" 
  11. SCROLL="no" 
  12. ICON="C:/WINDOWS/System32/wuauclt.exe" 
  13. INNERBORDER="no" 
  14. CONTEXTMENU="no" 
  15. CAPTION="yes" 
  16. MAXIMIZEBUTTON="no" 
  17. MINIMIZEBUTTON="yes" 
  18. SHOWINTASKBAR="yes" 
  19. SINGLEINSTANCE="yes" 
  20. SYSMENU="yes" 
  21. WINDOWSTATE="normal" 
  22. NAVIGABLE="yes" 
  23. /> 
  24. </hrad> 
  25.  
  26. <script language="javascript"></script> 
  27. <script language="VBScript"></script> 
  28.  
  29. <style> 
  30. .GUIwh {width:24;height:24;cursor:hand;} 
  31. </style> 
  32.  
  33. <body background="bg.gif" scroll="no" style="background: SteelBlue ;color:#ffffff;"> 
  34.  
  35. <table align="center" width="630" border="1" cellspacing="0" cellpadding="10" borderColor="#ffffff" style="font: 13px 宋体;border-collapse:collapse;"> 
  36. <tr align="center"> 
  37. <td width="450" height="450"> 
  38. <table border="0" cellspacing="0" cellpadding="0" borderColor="#ffffff" style="font: 21px 宋体;border:2px solid #ffffff;"> 
  39. <script language="VBScript"> 
  40. str = "ABCDEFGHIJKLMNOPQRS" 
  41. For i = 1 To Len(str) 
  42. with document 
  43. .write "<tr align='center'>" 
  44. For n = 1 To Len(str) 
  45. stri = MID(str,i,1) 
  46. strn = MID(str,n,1) 
  47. tdstr = "<td id='GUI_" & strn & stri & "' class='GUIwh'><span onclick='Test(this)' onMouseOver='innerText=""●"";style.color=""blue""' onMouseOut='innerText=""┼"";style.color=""""'>┼</span></td>" 
  48. s = "┼" 
  49.  
  50. If (stri = "A" and strn = "A") Then .write Replace(tdstr,s,"┌") 
  51. If stri = "A" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┬") 
  52. If (stri = "A" and strn = "S") Then .write Replace(tdstr,s,"┐") 
  53.  
  54. If not (stri = "A" or stri = "S") Then If strn = "A" Then .write Replace(tdstr,s,"├") 
  55. If not (stri = "A" or stri = "S" or strn = "A" or strn = "S") Then .write tdstr 
  56. If not (stri = "A" or stri = "S") Then If strn = "S" Then .write Replace(tdstr,s,"┤") 
  57.  
  58. If (stri = "S" and strn = "A") Then .write Replace(tdstr,s,"└") 
  59. If stri = "S" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┴") 
  60. If (stri = "S" and strn = "S") Then .write Replace(tdstr,s,"┘") 
  61. Next 
  62. .write "</tr>" 
  63. end with 
  64. Next 
  65. </script> 
  66. </table> 
  67. </td> 
  68. <td> 
  69. <span id="PC"><button>电脑先下</button><br><br>直接点击为玩家先下</span> 
  70. </td> 
  71. </tr> 
  72. </table> 
  73. </body> 
  74.  
  75. <script language="VBScript"> 
  76. width = 660 
  77. height = 550 
  78. window.resizeTo width, height 
  79. ileft=(window.screen.width-width)/2 
  80. itop=(window.screen.height-height)/2 
  81. window.moveTo ileft,itop 
  82.  
  83. Sub Test(this) 
  84. this.parentNode.style.cursor = "default" 
  85. this.parentNode.innerHtml = "●" 
  86. PC.style.display = "none" 
  87. End Sub 
  88.  
  89. Sub Title 
  90. Document.title = "五子棋 - zh159 - " & FormatDateTime(Now, 1) & " " & WeekdayName(WeekDay(now)) & " " & FormatDateTime(Now, 3) 
  91. End Sub 
  92.  
  93. Title:setInterval "Title()",500 
  94. </script> 
  95.  
  96. </html> 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表