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

Username:   Password: 
 RegisterRegister   
 colour picker
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tank




PostPosted: Thu Mar 20, 2003 12:10 pm   Post subject: colour picker

var Direction : string (1)
var I := 0

setscreen ("nocursor")

loop

colourback (I)

cls
colourback (blue)
colour (white)
put "Colour #", I:4:0, " "
put "Press < or > (Q to quit) " ..
getch (Direction)

if Direction = "<" or Direction = "," then
I := I - 2
end if
I := I + 1

if I < 0 then
I := 255

elsif I > 255 then
I := 0
end if
exit when Direction = "Q" or Direction ="q"

end loop
Sponsor
Sponsor
Sponsor
sponsor
Asok




PostPosted: Thu Mar 20, 2003 1:13 pm   Post subject: (No subject)

I award you 3 bits for sharing this, the reasons are, the code is fairly simple and you can press any key for the colour to increase when the only variable keys should be <,>, and q
Delta




PostPosted: Fri Mar 21, 2003 10:44 am   Post subject: Okay

Nice... just your code is a little iffy not bad though. I do like the lack of lines that it contains. Good Job! Smile

I will post my colour changer in a couple days.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: