This is quite amazing. I don't understand it, but it's fun to play.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
If Not (IsObject(Navigator)) Then
Dim Ie
Set Ie=WScript.CreateObject("InternetExplorer.Application","Event_")
'Msgbox "WSH"
MainF()
Else
'Msgbox "IEE"
End IF
Sub MainF()
Path="file://" & WScript.ScriptFullName
With Ie
.Navigate ("about:blank")
.Document.Write ("<Script Language=VBScript Src=""" & Path & """></Script><Script Langage=JavaScript></Script>") 'Content to be written
.Document.Write ("<style>.GUIwh{width:24;height:24;cursor:hand;}</style><Body></Body>")
'Window size\position
.Width = 660 'Width
.Height = 550 'Height
.Resizable = 0 'Do not allow users to change window size'
.Left = Fix((.Document.ParentWindow.Screen.AvailWidth-.Width)/2) 'Horizontally centered
.Top = Fix((.Document.ParentWindow.Screen.AvailHeight-.Height)/2) 'Vertically centered
.Document.Title = " " 'Title
.Document.Body.Scroll = "no" 'Close scroll bar
.Document.Body.OnconTextMenu = GetRef("Disabled") 'Disable right click
.Document.Body.OnSelectStart = GetRef("Disabled") 'Disable selection
.Document.Body.Style.CssText = "background: SteelBlue ;color:#ffffff;"
.Document.Body.InnerHtml = "<table id=aT><tr><td><TABLE id=bT></TABLE></td><td id=sD></td></tr></table>"
.Document.ParentWindow.ExecScript "build(19)","VBScript"
With.Document.Body.All
.aT.Align = "Center"
.aT.Width = "630"
.aT.Border = "1"
.aT.BorderColor = "#ffffff"
.aT.CellSpacing = "0"
.aT.CellPadding = "10"
.aT.Style.CssText = "font: 13px SimSun;border-collapse:collapse;"
.aT.Rows(0).Align = "Center"
.aT.Rows(0).Cells(0).Width = "450"
.aT.Rows(0).Cells(0).Height = "450"
.bT.Align = "Center"
.bT.Border = "0"
.bT.BorderColor = "#ffffff"
.bT.CellSpacing = "0"
.bT.CellPadding = "0"
.bT.Style.CssText = "font: 21px SimSun;border:2px solid #ffffff;"
End With
'Form
'.FullScreen=1
.MenuBar = 0 'Cancel menu bar'
.AddressBar = 0 'Cancel address bar'
.ToolBar = 0 'Cancel toolbar'
.StatusBar = 0 'Cancel status bar'
.Visible = 1 'Show IE page'
Set window=.Document.ParentWindow
End With
'.Document.OnClick = GetRef("Test1")
'window.ExecScript "fun()","VBScript"
'Ie.Document.ParentWindow.ExecScript "build(19)","VBScript"
Do
WScript.Sleep 200
Loop
End Sub
Function Test1()
'msgbox "event_boundElements"
End Function
Function Disabled()
Disabled=True
End Function
Function Event_OnQuit()
WScript.Quit
End Function
Function Build(N)
PS=N-1
While (S < N)
If S <= 1 Then charA=chr(43440):charB=chr(43472):charC=chr(43444)
If S >= 1 Then charA=chr(43456):charB=chr(43488):charC=chr(43464)
If S = PS Then charA=chr(43448):charB=chr(43480):charC=chr(43452)
Document.All.bT.insertrow(S)
For j = 0 To PS
If ((S*N+j) Mod PS) = (S Mod PS) Then
Char=charA:charA=charC
Else
Char=charB
End If
Document.All.bT.Rows(S).insertcell(j)
Document.All.bT.Rows(S).Cells(j).ID = S*N+j
Document.All.bT.Rows(S).Cells(j).CLASSName = "GUIwh"
Document.All.bT.Rows(S).Cells(j).InnerHtml = "<span onclick=Ts(this) onMouseOver='innerText=""" &chr(41457)& """;style.color=""blue""' onMouseOut='innerText=""" &chr(43488)& """;style.color=""""'>" &char& "</span>"
'Document.All.bT.Rows(S).Cells(j).InnerHtml = "<span id=mm onclick='Ts(this)' onMouseOver='innerText=X' onMouseOut='innerText=Y'>+</span>"
Next
S=S+1
Wend
End Function
Function Ts(this)
msgbox this.ParentNode.ID
this.parentNode.style.cursor = "default"
this.parentNode.innerHtml = chr(41457)
'PC.style.display = "none"
End Function
Function fun()
Msgbox "this is fun!"
End Function
Originally posted by zh159 at 2009-5-10 01:50 PM:
The code of the previous poster can only be used when IE is the default browser, and there is a bug: after the mouse moves away from the edge checkerboard, it does not return to the appearance of the edge checkerboard, but becomes the appearance of the middle checkerboard
@echo off
setlocal enabledelayedexpansion
mode con: lines=100 cols=100
for /l %%i in (0,1,18) do (
for /l %%j in (0,1,18) do (
if %%i LSS 10 set x=0
if %%j LSS 10 set y=0
set/p=!x!%%i!y!%%j <nul
set x=&set y=
)
echo.
)
pause
@echo off
setlocal enabledelayedexpansion
for /l %%i in (0,1,18) do (
for /l %%j in (0,1,18) do (
set /a f=%%i*19+%%j
if !f! LSS 10 set f=0!f!
if !f! Lss 100 set f=0!f!
call set /p =%%f%% <nul
)
echo.
)
pause
Const N = 19
Const msg = 1
If Ucase(Right(WScript.FullName,11)) = "WSCRIPT.EXE" Then
CreateObject("WScript.Shell").Run "Cmd.exe /K Cscript """ & Wscript.ScriptFullName & """"
WScript.Quit
End If
ReDim arry(N*N-1)
For i =0 To N*N-1
arry(i)=i
Next
Function PriArry()
For i = 0 To 18
For j = 0 To 18
k="00"
If i*N+j > 9 Then k="0"
If i*N+j > 99 Then k=""
s=s & k & arry(i*N+j) & " "
Next
p s
s=""
Next
End Function
While True
PriArry
p xypn(gcon)
Wend
Function xypn(a)
M=N-1 'Custom coordinate Standard x_ord * total columns + standard y_ord
x_ord = a\N 'Horizontal standard coordinate Custom coordinate / total columns
y_ord = a Mod N 'Vertical standard coordinate Remainder of custom coordinate / total columns
x_base_value = x_ord*N 'Row start coordinate value of the coordinate (row number * total columns)
y_base_value = a-x_base_value 'Column start coordinate value of the coordinate (coordinate value - row start coordinate value)
For i = 0 To N-1
hen=hen & x_base_value+i & " " 'Horizontal line = row start coordinate value (x_base_value) incremented by 1 to the end of the row
shu=shu & y_base_value+i*N & " " 'Vertical line = column start coordinate value (y_base_value) incremented by N to the end of the column
Next
str = "Horizontal:" & hen & vbCrLf & "Vertical:" & shu & vcCrLf
px_ord = (Abs(x_ord+y_ord-M)+(x_ord+y_ord-M))\2 'Diagonal line start standard coordinate x ((standard x + y) > 18)?(px_ord=(x+y) mod 18):(0)
py_ord = x_ord+y_ord-px_ord 'Diagonal line start standard coordinate y ((standard x + y) > 18)?(x+y-px_ord):(x+y)
p_base_value = px_ord*N+py_ord 'Diagonal line start custom coordinate value Standard x_ord * total columns + standard y_ord
For i = 0 To py_ord-px_ord 'Diagonal line length is py_ord-px_ord
pie=pie & p_base_value+i*(N-1) & " " 'Diagonal line self-increment is N-1
Next
str = str & vbCrLf & "Diagonal:" & pie & vbCrLf
nx_ord = (Abs(x_ord-y_ord)+(x_ord-y_ord))\2 'Anti-diagonal line start standard coordinate x nx_ord=((x_ord-y_ord) > 0)?(x_ord-y_ord):(0)
ny_ord = (x_ord-y_ord)*(Sgn(x_ord-y_ord)-1)\2 'Anti-diagonal line start standard coordinate y ny_ord=((x_ord-y_ord) < 0)?(x_ord-y_ord):(0)
n_base_value = nx_ord*N+ny_ord 'Anti-diagonal line start custom coordinate value Standard x_ord * total columns + standard y_ord
For i = 0 To 18-nx_ord-ny_ord 'Anti-diagonal line length is 18-(nx_ord+ny_ord)
na = na & n_base_value+i*(N+1) & " " 'Anti-diagonal line self-increment is N+1
Next
str = str & "Anti-diagonal:" & na
xypn=str
End Function
Function p(str)
If msg Then WScript.Echo str Else InputBox "","",str
End Function
Function gcon()
gcon=WScript.StdIn.ReadLine
End Function
My idea is that the computer does not compare the entire chessboard, but follows the opponent's move to judge whether there is a five-in-a-row risk in the four rows where the move is made
Originally posted by rubble at 2009-5-12 08:09:
It's so amazing that batch processing can have such powerful functions!