Computer Science Canada

boring engineering project

Author:  WhatAmIDoing [ Tue Apr 20, 2004 1:30 pm ]
Post subject:  boring engineering project

This is a good use of GUI and it can be amusing for 15 dec so enjoy the moment.

import GUI
var circle : boolean := false
proc makecircle
circle := true
drawoval (maxx div 2 - 20, maxy div 2, 50, 50, red)
drawfillbox (0, maxy - 100, 200, maxy, white)
end makecircle
proc fillcircle
if circle = true then
var c : int
randint (c, 0, 50)
if c = red or c=white then
c += 1
end if
drawfill (maxx div 2 - 20, maxy div 2, c, red)
else
locate (1, 1)
put "No Circle to fill"
end if
end fillcircle
proc clear
circle := false
drawfilloval (maxx div 2 - 20, maxy div 2, 60, 60, white)
end clear
var box1 := GUI.CreateButton (10, 200, 0, "Make Circle", makecircle)
var box2 := GUI.CreateButton (10, 150, 0, "Clear Circle", clear)
var box3 := GUI.CreateButton (10, 250, 0, "Fill Circle", fillcircle)
var Quit := GUI.CreateButton (10, 100, 0, "Quit", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop

Author:  Delos [ Tue Apr 20, 2004 4:47 pm ]
Post subject: 

Wow...really short 15 seconds.

Try using [code] tags next time...for aesthetics sake.
No, not saké!

Author:  Paul [ Tue Apr 20, 2004 6:28 pm ]
Post subject: 

It'd be more amusing if you'd closed the window.

Author:  WhatAmIDoing [ Fri Apr 23, 2004 8:47 pm ]
Post subject: 

maybe but i did it in 5 min so what ever


: