<script language="VBScript" runat="server">

Class gameBugs

    Public bugs(), bugsTotal, iCurr, x, y

    Sub Class_Initialize
        ReDim bugs(0)
        bugsTotal = 0
        iCurr = 0
    End Sub
        
    Function Addbugs(strArgu)
        Dim i
        ReDim Preserve bugs(UBound(bugs)+1)
        bugs(UBound(bugs)) = strArgu
        bugsTotal = bugsTotal+1
    End Function

    Function Check(pX,pY)
        On Error Resume Next
        Dim i, arrCurrBugs, arrCurrPos, sX, sY
        arrCurrBugs = Split(bugs(iCurr), "|")
        For i=0 To UBound(arrCurrBugs)
            arrCurrPos = Split(arrCurrBugs(i), ",")
            sX = CInt(arrCurrPos(0))
            sY = CInt(arrCurrPos(1))
            If Abs(pX-sX)<18 And Abs(pY-sY)<18 Then
                Check = True
                x = sX : y = sY
                Exit Function
            End If
        Next
        Check = False
    End Function
    
    Function bugsCount()
        bugsCount = UBound( Split( bugs(iCurr), "|" ) ) + 1
    End Function
    
    Function bugsString()
        bugsString = bugs(iCurr)
    End Function

End Class

Public Function WriteLn(strOut)
    Response.Write( strOut & vbCrLf )
End Function

Public Sub SetCookies(cName,cValue)
    Response.Cookies(cName) = cValue
    Response.Cookies(cName).Expires = Date+999
End Sub

Public Function GetCookies(cName)
    GetCookies=Request.Cookies(cName)
End Function

</script>

<!--#include file="data.txt"-->