This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem of logic  RSS feed

 
Martin Thibault
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello every body,

I trying to create 140 colors like that where R , G, B start to 40 and up gradually to 240 like that:
(40,40,40)
(40,40,80)
...
(40,40,240)
(40,80,40)
(40,80,80)
....
(240,240,240)

But i have a problem of logic .. I know i can find a solution with modulo operation, but it's never work...
Somebody can give me a solution (or part of solution) please ?

Thank's a lot !
 
Campbell Ritchie
Sheriff
Posts: 53769
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

There are several ways you can solve that problem. Start by writing it down in French (Thibault sounds French to me), with both an explanation of the problem and a suggestion how you would sole that if you had to do it on paper. Also record which order you need the colours in.

By the way: why did you say there are 140 colours?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!