Diederik Lucas wrote:My first question! The code I post underneath comes from the book I use. This code lists all the possibilities of Cherry, lemon, Kumquat and rutabaga. Now, what I do not get: How does the computer know I want all the combinations? Why does it not simply print the same combi "cherry, lemon, kumquat, rutabaga" and gets it over with? I do not see what piece of code tells the pc to repeat until all possible combinations are done. Can someone shed some light on this for me please?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Diederik Lucas wrote:So (Symbol leftReel : Symbol.values() = for each Symbol leftReel print out each possible symbol value ---> I get it.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Diederik Lucas wrote:I do try to rollplay a computer when reading code. Still. Its an art to unerstand it fully if you ask me;)
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
and POOF! You're gone! But look, this tiny ad is still here:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|