%sets the screen to graphics mode
setscreen ("graphics:vga")
%draws a grid for easier placement to start
for h : 0 .. maxx by 10
for i : 0 .. maxy by 10
drawdot (h, i, white)
end for
end for
%draws the "box"
drawfillbox (390, 380, 570, 80, 255)
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 4)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
%box to end
locatexy (25, 32)
put "end"
drawbox (10, 10, 60, 60, 255)
var ch : string (1)
var c : int
var x, y, button : int
locate (1, 1)
put "Press any numerical key"
loop
mousewhere (x, y, button)
if hasch then
getch (ch)
if strintok (ch) then
c := strint (ch)
locatexy (370, 70)
put "The character entered is a: ", ch
%number box display
if c = 1
then
%top
drawfilloval (480, 350, 60, 10, 7)
%top left
drawfilloval (420, 290, 10, 60, 7)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 7)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 7)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 2
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 7)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 4)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 7)
elsif c = 3
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 7)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 4
then
%top
drawfilloval (480, 350, 60, 10, 7)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 7)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 5
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 7)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 6
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 7)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 4)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 7
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 7)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 7)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 7)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 8
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 4)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 9
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 4)
%bottom left
drawfilloval (420, 170, 10, 60, 7)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
elsif c = 0
then
%top
drawfilloval (480, 350, 60, 10, 4)
%top left
drawfilloval (420, 290, 10, 60, 4)
%top right
drawfilloval (540, 290, 10, 60, 4)
%middle
drawfilloval (480, 230, 60, 10, 7)
%bottom left
drawfilloval (420, 170, 10, 60, 4)
%bottom
drawfilloval (480, 110, 60, 10, 4)
%bottom right
drawfilloval (540, 170, 10, 60, 4)
end if
end if
end if
exit when 10 < x and x < 60 and 10 < y and y < 60 and button = 1
end loop
|