View.Set ("graphics:1000,300;offscreenonly")
var boxCol, boxRad, boxX, boxY, button, cnt, driveCol, fontcol, ground, growX, growY,
inc, mouseX, mouseY, pass : int
var font : int := Font.New ("comic sans ms:15")
var stop : int := Font.New ("comic sans ms:50")
boxCol := brightred
cnt := 0
driveCol := red
ground := 10
growX := 0
inc := 35
boxRad := inc div 2
var existant : string := ""
var drive : array 1 .. 26 of char
var done : boolean := false
var keys : array char of boolean
for i : 'A' .. 'Z'
%if Dir.Exists (i + ":/") then
%put i
cnt += 1
drive (cnt) := i
%end if
end for
var boxes : array 1 .. cnt of int
for i : 1 .. cnt
boxes (i) := inc * i
end for
procedure Pause
cls
Input.Flush
loop
exit when hasch
Font.Draw ("PAUSED", maxx div 2 - 100, maxy div 2, stop, Rand.Int (0, 255))
Font.Draw ("(press any key to continue)", maxx div 2 - 95, maxy div 2 - 50, font, black)
View.Update
end loop
done := false
end Pause
loop
drawfillbox (0, 0, maxx, maxy, 11)
Mouse.Where (mouseX, mouseY, button)
Input.KeyDown (keys)
drawfilloval (mouseX, mouseY, 10, 10, boxCol)
drawfillbox (370, 110, 620, 290, white)
drawbox (370, 110, 620, 290, black)
Font.Draw ("Hello " + Sys.GetUserName, maxx div 2 - 95, maxy div 2, font, black)
Font.Draw ("on " + Sys.GetComputerName, maxx div 2 - 110, maxy div 2 - 20, font, black)
for i : 1 .. cnt
growX += inc
if Dir.Exists (drive (i) + ":/") then
driveCol := Rand.Int (0, 255)
else
driveCol := brightred
end if
drawfillbox (growX - inc div 2, ground, inc + growX, ground + inc, driveCol)
drawbox (growX - inc div 2, ground, inc + growX, ground + inc, black)
Font.Draw (drive (i), growX - inc div 2 div 2, 20, font, white)
if button = 1 and mouseX > boxes (i) - boxRad and mouseX < boxes (i) + boxRad and
Dir.Exists (drive (i) + ":/") and mouseY > 10 and mouseY < 45
then
put drive (i)
if Sys.Exec (drive (i) + ":/") then
end if
done := true
exit
elsif button = 0 and mouseX > boxes (i) - boxRad and mouseX < boxes (i) + boxRad
and mouseY > 10 and mouseY < 45 then
locate (4, 1)
if Dir.Exists (drive (i) + ":/") then
fontcol := 33
existant := " exists!"
else
fontcol := brightred
existant := " does not exist"
end if
Font.Draw (drive (i) + existant /*+ " (" + (intstr (File.DiskFree (drive (i))) + ") ")*/,
maxx div 2 - 75, maxy div 2 + 35, font, fontcol)
end if
end for
if done or keys (KEY_ESC) then
Pause
end if
growX := 0
locate (1, 1)
Font.Draw (intstr (mouseX), maxx div 2 - 50, maxy - 30, font, black)
Font.Draw (intstr (mouseY), maxx div 2 + 10, maxy - 30, font, black)
% colour (black)
% for i : 1 .. cnt
% put boxes (i), " " ..
% end for
locate (5, 55)
Font.Draw ("DRIVES", maxx div 2 - 80, maxy - 75, font, black)
for i : 1 .. cnt
if Dir.Exists (drive (i) + ":/") then
colour (33)
Font.Draw (drive (i), maxx div 2 - 15 + i * 8, maxy - 75, font, 33)
end if
end for
View.Update
cls
if button = 1 then
boxCol := 55
else
boxCol := brightred
end if
end loop
|