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

Username:   Password: 
 RegisterRegister   
 RBG - Still Needs Work, But Begining
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Sean




PostPosted: Wed Dec 05, 2007 2:43 pm   Post subject: RBG - Still Needs Work, But Begining

code:

for i : 1 .. 255
    for x : 1 .. 1
        for y : 1 .. 1
            put i
            drawfillbox ((x * 24), (y * 24), (x * 24) + 24, (y * 24) + 24, i)
            end for
    end for
end for


Still needs word, need to get a scroll bar so you can look at what was before. Still working, this is just the test one that I made.

~Sean
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Wed Dec 05, 2007 3:34 pm   Post subject: RE:RBG - Still Needs Work, But Begining

Ask yourself, what value will x and y have every time you run the program? I think you will see some extremely extraneous code there.
Sean




PostPosted: Wed Dec 05, 2007 7:12 pm   Post subject: Re: RBG - Still Needs Work, But Begining

Yes, I know they all equal 24, thats just perametor size, I could change, but will have to do tomorrow. The other values = 48.

code:

for i : 1 .. 255
    for x : 1 .. 1
        for y : 1 .. 1
            put i
            drawfillbox ( 24 ,  24 , 24  + 24,  24 + 24, i)
            end for
    end for
end for
Clayton




PostPosted: Wed Dec 05, 2007 7:26 pm   Post subject: RE:RBG - Still Needs Work, But Begining

How many times does:

code:

for x : 1 .. 1
   ...
end for


iterate for?
Carey




PostPosted: Thu Dec 06, 2007 12:55 pm   Post subject: Re: RBG - Still Needs Work, But Begining

Why don't you try:

code:
for i : 1 .. 255
    put i
    drawfillbox (24, 24, 48, 48, i)
end for
LaZ3R




PostPosted: Thu Dec 06, 2007 2:54 pm   Post subject: RE:RBG - Still Needs Work, But Begining

the x and y for loops are doing nothing. The number is constantly 24 and 48 respectively...

The only use in that would be if the value of x or y was NOT constant and changed each time through the loop.

code:
for i : 1 .. 255
    for x : 1 .. 2
        for y : 1 .. 2
            put i
            drawfillbox ((x * 24), (y * 24), (x * 24) + 24, (y * 24) + 24, i)
            end for
    end for
end for


Try that and see what your code will do.
Sean




PostPosted: Thu Dec 06, 2007 3:21 pm   Post subject: Re: RBG - Still Needs Work, But Begining

I was using a grid system that I created before, and then just added 1s. It creates 2 boxes, if it has 2.
Zampano




PostPosted: Thu Dec 06, 2007 4:21 pm   Post subject: Re: RBG - Still Needs Work, But Begining

Why not this instead?
code:
colour (0)
for c:1..255
    colourback(c)
    put " ",c," "..
end for
Sponsor
Sponsor
Sponsor
sponsor
Sean




PostPosted: Fri Dec 07, 2007 10:24 am   Post subject: Re: RBG - Still Needs Work, But Begining

As I said, I made it quickly and would make a new one.

Still working on a better one, coming soon.
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  [ 9 Posts ]
Jump to:   


Style:  
Search: