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

Username:   Password: 
 RegisterRegister   
 i fixed your color program(my first post)
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Genisis




PostPosted: Thu Oct 13, 2005 8:46 am   Post subject: i fixed your color program(my first post)

this is a modified pick a shape and fill it program

%Choose a square or circle
%Choose a colour

put "What object you would like to use"

%See choice of square or circle
drawbox (400, 300, 300, 200, 7)
drawoval (350, 100, 50, 50, 7)


%Use shape as a varibale
var shape : int

%Show text of choices with 1 being Square and 2 being Circle
put "Square - 1 or Circle - 2?"
%Get response
get shape

%clear screen
Draw.Cls

%If square is chosen draw square
if shape = 1 then
drawbox (400, 300, 300, 200, 7)

%if square is not choosen draw circle
else
drawoval (350, 100, 50, 50, 7)
end if

%Pick your colour

var c : int

%Show text of colour choices
if shape = 1 then
put"Choose colour to fill shape 1 - Red 2 - Blue 3 - Random"
end if
if shape = 2 then
put "Choose colour to fill shape 4 - Red 5 - Blue 6 - Random"
end if

%Get answer
get c

%If red- 1 draw redbox
if c = 1 then
drawfillbox (400, 300, 300, 200, 12)

end if

%if blue -2 draw bluebox
if c = 2 then
drawfillbox (400, 300, 300, 200, 1)
end if

%if random -3 draw randombox
if c = 3 then
%loop through colors 1-15
loop
for i : 1..15
color (i)
drawfillbox (400, 300, 300, 200, i)
delay (750)
end for

end loop
end if

% if 4 or 5 it will fill it with red or blue
if c = 4 then
drawfilloval (350, 100, 50, 50,12)
elsif c = 5 then
drawfilloval (350, 100, 50, 50,1)
end if
% if 6 then it will fill the oval with colors 1-15
if c = 6 then
loop
for i :1..15
color (1)
drawfilloval (350, 100, 50, 50,i)
delay (750)
end for

end loop
end if
Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: