put ""
put "Welcome to Ivan Drawing Pad", skip, skip
put "Note some features:"
put " 1) Click on the tool that you wish to use"
put " 2) When you are done with the tool, press 'End' and select a new tool"
put " 3) Select a colour on the bottom of the screen"
put " 4) You can only use the fill bucket in other colours"
put " 5) No, there is NOT an undo button. I am a programmer, not a genius"
put " 6) Are there glitches? Of course! Nothing is perfect and I haven't the time to fix them"
put " 8) Enjoy", skip, skip
put "Creator: Ivan Cajic"
put "Course: TIK 20O"
put "Teacher: Mr. Jone"
put "Date: January 12, 2005"
var continue : string (1)
locatexy (10, 10)
put "Press any key to continue"
locatexy (220, 20)
getch (continue)
cls
var x2, y2, button2, xx2, yy2, button3, x, y, button : int
Draw.ThickLine (20, 100, 20, 350, 5, black)
Draw.ThickLine (20, 350, 70, 350, 5, black)
Draw.ThickLine (70, 350, 70, 100, 5, black)
Draw.ThickLine (20, 100, 70, 100, 5, black)
drawfill (30, 340, 23, black)
proc pencil (x, y : int)
drawfillbox (25, 346, 41, 325, 103)
drawfillbox (30 + x, 340 + y, 36 + x, 345 + y, 90)
drawbox (30 + x, 340 + y, 36 + x, 345 + y, black)
drawfillbox (30 + x, 340 + y, 36 + x, 330 + y, yellow)
drawbox (30 + x, 340 + y, 36 + x, 330 + y, black)
drawline (30 + x, 330 + y, 33 + x, 325 + y, black)
drawline (36 + x, 330 + y, 33 + x, 325 + y, black)
drawfill (34 + x, 328 + y, 43, black)
Draw.ThickLine (32 + x, 326 + y, 34 + x, 326 + y, 2, black)
end pencil
proc bucket
drawfillbox (45, 325, 64, 346, 103)
drawline (50, 335, 58, 340, black)
drawline (58, 340, 64, 332, black)
drawline (64, 332, 56, 326, black)
drawline (56, 326, 50, 335, black)
drawfill (60, 330, 3, black)
drawarc (52, 330, 4, 10, 40, 180, black)
drawarc (50, 330, 2, 10, 10, 190, black)
drawfill (53, 338, black, black)
Draw.ThickLine (54, 330, 61, 334, 3, black)
drawline (51, 332, 60, 338, black)
end bucket
proc brush
drawfillbox (25, 315, 41, 294, 103)
drawarc (32, 305, 3, 11, 0, 185, black)
drawfillbox (27, 307, 37, 303, 6)
drawbox (27, 307, 37, 303, black)
drawfillbox (27, 302, 37, 296, white)
drawbox (27, 302, 37, 296, black)
drawline (29, 296, 29, 301, black)
drawline (32, 296, 32, 300, black)
drawline (35, 296, 35, 300, black)
drawfill (32, 313, 6, black)
drawline (35, 307, 29, 307, 6)
end brush
proc erase
drawfillbox (45, 315, 64, 294, 103)
drawfillbox (47, 295, 58, 299, 92)
drawbox (47, 295, 58, 299, black)
drawline (47, 299, 53, 308, black)
drawline (53, 308, 62, 308, black)
drawline (58, 299, 62, 308, black)
drawline (62, 308, 62, 302, black)
drawline (62, 302, 58, 295, black)
drawfill (53, 303, 93, black)
drawfill (60, 301, 93, black)
end erase
proc can
drawfillbox (25, 284, 41, 263, 103)
drawline (40, 268, 33, 278, black)
drawline (40, 268, 34, 264, black)
drawline (33, 278, 27, 274, black)
drawline (27, 274, 34, 264, black)
drawfillarc (30, 276, 4, 5, 30, 290, white)
drawarc (30, 276, 4, 5, 30, 290, black)
drawfill (34, 270, brightblue, black)
Draw.ThickLine (26, 280, 30, 279, 2, black)
drawdot (39, 282, black)
drawdot (37, 280, black)
drawdot (35, 278, black)
drawdot (35, 282, black)
drawdot (35, 278, black)
drawdot (39, 278, black)
end can
proc line
drawfillbox (45, 284, 64, 263, 103)
Draw.ThickLine (47, 266, 62, 281, 2, black)
end line
proc oval
drawfillbox (25, 253, 41, 232, 103)
drawoval (33, 242, 7, 7, black)
drawoval (33, 241, 7, 7, black)
end oval
proc square
drawfillbox (45, 253, 64, 232, 103)
drawbox (48, 250, 61, 235, black)
drawbox (47, 249, 60, 236, black)
end square
square
oval
line
can
erase
brush
pencil (0, 0)
bucket
var xx, yy : int
var col : int := 2
var a, b : int := 10
drawfillbox (25, 200, 64, 220, 103)
Draw.Text ("End", 30, 210, defFontID, black)
drawbox (25, 5, 525, 40, black)
drawbox (85, 55, maxx - 15, maxy - 15, black)
drawfill (1, 1, grey, black)
colourback (grey)
put "Press 'c' to clear and 'q' to quit"
drawbox (85, 55, maxx - 15, maxy - 15, black)
for i : 0 .. 15
a := a + 30
drawfillbox (a, b, a + 20, b + 20, i)
drawbox (a, b, a + 20, b + 20, black)
end for
loop
var chars : array char of boolean
Input.KeyDown (chars)
if chars ('c') then
drawfillbox (85 + 1, 55 + 1, maxx - 16, maxy - 16, white)
elsif chars ('q') then
return
end if
mousewhere (x, y, button)
if x > 45 and x < 64 and y < 252 and y > 232 and button = 1 then
var xw, yw, xxw, yyw, b1w, b2w : int := 0
loop
mousewhere (xw, yw, b1w)
if b1w = 1 then
loop
mousewhere (xxw, yyw, b2w)
if b2w = 1 and yyw > 65 and xxw > 95 and xxw < maxx - 25 and yyw < maxy - 25 then
drawbox (xw, yw, xxw, yyw, black)
end if
if b2w not= 1 then
drawbox (xw, yw, xxw, yyw, black)
exit
end if
if yyw > 65 and xxw > 95 and xxw < maxx - 25 and yyw < maxy - 25 then
drawbox (xw, yw, xxw, yyw, white)
end if
end loop
end if
exit when xw > 25 and yw > 200 and xw < 64 and yw < 220 and b1w = 1
end loop
end if
if x > 25 and x < 41 and y < 252 and y > 232 and button = 1 then
var xa, ya, xxa, yya, b1a, b2a : int
loop
mousewhere (xa, ya, b1a)
if b1a = 1 and ya > 65 and xa > 95 and xa < maxx - 25 and ya < maxy - 25 then
mousewhere (xa, ya, b1a)
drawdot (xa, ya, black)
loop
mousewhere (xxa, yya, b2a)
if b2a = 1 and yya > 65 and xxa > 95 and xxa < maxx - 25 and yya < maxy - 25 then
drawoval (xa, ya, xxa - xa, yya - ya, black)
end if
if b2a not= 1 then
drawoval (xa, ya, xxa - xa, yya - ya, black)
exit
end if
if yya > 65 and xxa > 95 and xxa < maxx - 25 and yya < maxy - 25 then
drawoval (xa, ya, xxa - xa, yya - ya, white)
end if
end loop
end if
exit when xa > 25 and ya > 200 and xa < 64 and ya < 220 and b1a = 1
end loop
end if
if x > 45 and x < 64 and y > 263 and y < 284 and button = 1 then
var xe, ye, btnNumber, btnUpDown, buttons : int
var nx, ny : int
loop
Mouse.ButtonWait ("down", xe, ye, btnNumber, btnUpDown)
nx := xe
ny := ye
loop
if nx > 65 and ny > 95 and nx < maxx - 25 and ny < maxy - 25 then
Draw.Line (xe, ye, nx, ny, 0)
end if
exit when Mouse.ButtonMoved ("up")
Mouse.Where (nx, ny, buttons)
if nx > 65 and ny > 95 and nx < maxx - 25 and ny < maxy - 25 then
Draw.Line (xe, ye, nx, ny, black)
end if
end loop
if nx > 65 and ny > 95 and nx < maxx - 25 and ny < maxy - 25 then
Draw.Line (xe, ye, nx, ny, black)
end if
exit when xe > 25 and ye > 200 and xe < 64 and ye < 220 and button = 1
end loop
end if
if x < 41 and x > 25 and y < 284 and y > 263 and button = 1 then
loop
mousewhere (x, y, button)
if y > 65 and x > 95 and x < maxx - 25 and y < maxy - 25 and button = 1 then
for i : 1 .. 3
randint (xx, x - 12, x + 12)
randint (yy, y - 12, y + 12)
drawdot (xx, yy, black)
end for
delay (1)
end if
exit when x > 25 and y > 200 and x < 64 and y < 220 and button = 1
end loop
end if
if x < 64 and x > 45 and y < 315 and y > 294 and button = 1 then
loop
Input.KeyDown (chars)
if chars ('c') then
drawfillbox (85 + 1, 55 + 1, maxx - 16, maxy - 16, white)
end if
mousewhere (x, y, button)
if y > 65 and x > 95 and x < maxx - 25 and y < maxy - 25 then
drawbox (x - 10, y - 10, x + 10, y + 10, black)
delay (50)
drawbox (x - 10, y - 10, x + 10, y + 10, white)
end if
if y > 65 and x > 95 and x < maxx - 25 and y < maxy - 25 and button = 1 then
drawfillbox (x - 10, y - 10, x + 10, y + 10, white)
end if
exit when x > 25 and y > 200 and x < 64 and y < 220
end loop
end if
if x < 41 and x > 25 and y < 346 and y > 325 and button = 1 then
loop
Input.KeyDown (chars)
if chars ('c') then
drawfillbox (85 + 1, 55 + 1, maxx - 16, maxy - 16, white)
end if
mousewhere (x2, y2, button2)
if y2 > 65 and x2 > 95 and x2 < maxx - 15 and y2 < maxy - 15 and button2 = 1 then
delay (30)
mousewhere (xx2, yy2, button3)
drawline (x2, y2, xx2, yy2, black)
end if
exit when x2 > 25 and y2 > 200 and x2 < 64 and y2 < 220
and button2 = 1
end loop
end if
if x < 41 and x > 25 and y < 315 and y > 294 and button = 1 then
loop
Input.KeyDown (chars)
if chars ('c') then
drawfillbox (85 + 1, 55 + 1, maxx - 16, maxy - 16, white)
end if
mousewhere (x2, y2, button2)
if y2 > 65 and x2 > 95 and x2 < maxx - 15 and y2 < maxy - 15 and button2 = 1 then
delay (30)
mousewhere (xx2, yy2, button3)
Draw.ThickLine (x2, y2, xx2, yy2, 3, black)
end if
exit when x2 > 25 and y2 > 200 and x2 < 64 and y2 < 220
and button2 = 1
end loop
end if
if x > 45 and x < 64 and y > 325 and y < 346 and button = 1 then
loop
Input.KeyDown (chars)
if chars ('c') then
drawfillbox (85 + 1, 55 + 1, maxx - 16, maxy - 16, white)
end if
mousewhere (x, y, button)
if button = 1 and y > 65 and x > 95 and x < maxx - 15 and y < maxy - 15 then
drawfill (x, y, col, black)
end if
if button = 1 then
if whatdotcolour (x, y) = 0 then
col := 0
elsif whatdotcolour (x, y) = 1 then
col := 1
elsif whatdotcolour (x, y) = 2 then
col := 2
elsif whatdotcolour (x, y) = 3 then
col := 3
elsif whatdotcolour (x, y) = 4 then
col := 4
elsif whatdotcolour (x, y) = 5 then
col := 5
elsif whatdotcolour (x, y) = 6 then
col := 6
elsif whatdotcolour (x, y) = 7 then
col := 7
elsif whatdotcolour (x, y) = 8 then
col := 8
elsif whatdotcolour (x, y) = 9 then
col := 9
elsif whatdotcolour (x, y) = 10 then
col := 10
elsif whatdotcolour (x, y) = 11 then
col := 11
elsif whatdotcolour (x, y) = 12 then
col := 12
elsif whatdotcolour (x, y) = 13 then
col := 13
elsif whatdotcolour (x, y) = 14 then
col := 14
elsif whatdotcolour (x, y) = 15 then
col := 15
end if
end if
exit when x > 25 and y > 200 and x < 64 and y < 220
end loop
end if
if button = 1 then
if whatdotcolour (x, y) = 0 then
col := 0
elsif whatdotcolour (x, y) = 1 then
col := 1
elsif whatdotcolour (x, y) = 2 then
col := 2
elsif whatdotcolour (x, y) = 3 then
col := 3
elsif whatdotcolour (x, y) = 4 then
col := 4
elsif whatdotcolour (x, y) = 5 then
col := 5
elsif whatdotcolour (x, y) = 6 then
col := 6
elsif whatdotcolour (x, y) = 7 then
col := 7
elsif whatdotcolour (x, y) = 8 then
col := 8
elsif whatdotcolour (x, y) = 9 then
col := 9
elsif whatdotcolour (x, y) = 10 then
col := 10
elsif whatdotcolour (x, y) = 11 then
col := 11
elsif whatdotcolour (x, y) = 12 then
col := 12
elsif whatdotcolour (x, y) = 13 then
col := 13
elsif whatdotcolour (x, y) = 14 then
col := 14
elsif whatdotcolour (x, y) = 15 then
col := 15
end if
end if
end loop
|