Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Loft, Kitchen and Bedroom Lights
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
danish2525




PostPosted: Fri May 24, 2013 9:28 am   Post subject: Turing Loft, Kitchen and Bedroom Lights

%Loading Bar
colorback (black)
color (white)
cls

put "Press LEFT arrow to Turn ON Kitchen Light"
put "Press RIGHT arrow to Turn ON Bedroom Light"
put "Press DOWN arrow to Turn ON Both Kitchen and Bedroom Light"
put "Press UP arrow to QUIT the program"
for i : 0 .. 300
drawbox (170 + i, 40, 170, 20, white)
delay (30)
locate (22, 40)
put i div 3, "%"
end for


setscreen ("graphics:max;max")

%Font 1 (title)
var font1 : int
font1 := Font.New ("timesnewroman:30")
Font.Draw ("Danish's Loft", 100, 200, font1, black)



%Kitchen and Bedroom
Draw.FillBox (56, 600, 370, 280, green)
Draw.FillBox (370, 600, 690, 280, red)
%Exit Box
Draw.FillBox (850, 20, 950, 100, blue)
locate (38, 110)
put "EXIT"



var chars : array char of boolean
loop

Input.KeyDown (chars)
locate (1, 1)
if chars (KEY_UP_ARROW) then
quit
else

end if

if chars (KEY_RIGHT_ARROW) then
Draw.FillBox (370, 600, 690, 280, 40)
delay (110)
put "The Bedroom light is ON "
else
put "The Bedroom light is OFF"
Draw.FillBox (370, 600, 690, 280, red)
end if

if chars (KEY_LEFT_ARROW) then
Draw.FillBox (56, 600, 370, 280, 48)
delay (110)
put "The Kitchen light is ON "
else
put "The Kitchen light is OFF "
Draw.FillBox (56, 600, 370, 280, green)
end if
if chars (KEY_DOWN_ARROW) then
Draw.FillBox (370, 600, 690, 280, 40)
Draw.FillBox (56, 600, 370, 280, 48)
delay (110)
put "Both Kitc and Bed is ON"

else
put "Both Kitc and Bed is OFF"
Draw.FillBox (56, 600, 370, 280, green)
Draw.FillBox (370, 600, 690, 280, red)
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri May 24, 2013 10:23 am   Post subject: RE:Turing Loft, Kitchen and Bedroom Lights

It would be nice if you'd give an overview of what this is, and why you wanted to share it.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: