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

Username:   Password: 
 RegisterRegister   
 Colour spectrum problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mirhagk




PostPosted: Mon Dec 14, 2009 12:51 am   Post subject: Colour spectrum problem

What is it you are trying to achieve?
write a program that will display all the colours in a beautiful spectrum like ms paint does for it's colour selection thingy

What is the problem you are having?
its one o'clock in the morning which means i don't know how to cycle through the colours right.


Describe what you have tried to solve this problem
a million different ways to write the code (originally was with dots, and would like to use dots)


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


proc colourmill (col1, col2, col3 : real)
    var c1, c2, c3 : real
    RGB.GetColour (117, c1, c2, c3)
    RGB.SetColour (117, col1, col2, col3)
    colourback (117)
end colourmill
var win := Window.Open ("graphics:max;max")
var x := 0
var y := 0
var X := 0
var Y := 0
var c1, c2, c3 : real
c1 := 0
c2 := 0
c3 := 0
proc incit (lvl : int)
    x += 1
    if x > lvl then
        x := lvl - 10
        y += 1
    end if
end incit
loop
    colourmill (c1, c2, c3)
    %drawdot (x, y, 117)
    drawfillbox (x, y, x + 10, y + 10, 117)
    x += 10
    if x > maxx then
        y += 10
        x := 0
    end if
    if c1 < 1 then
        c1 += 0.05
    elsif c2 < 1 then
        c2 += 0.05
        c1 := 0
    elsif c3 < 1 then
        c3 += 0.05
        c2 := 0
        c1 := 0
    else
        exit
    end if
    %y := 0
end loop




Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: