RE: Challenging Loop problem SOLVED
Great job guys! Drop this into the code to see the colors displayed: cfoutput cfloop index=val list=#colorList# div style=float: left; background:###val#;width: 50px; height:50px;/div /cfloop /cfoutput !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 11:49 AM To: CF-Talk Subject: RE: Challenging Loop problem SOLVED As promised the completed task of this strange harmonic looping project. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262002 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem.
Regardless of the hexidecimal generation. The pattern is taught to first year statistic students. It is just a permutation set of all possible combinations of three items that allow repeats. If you have three items with three slots, that means that you have have 3 comibnations in each slot, so 3^3 possibilities. The pattern changes exponentially based upon the number of slots and items. 4 items with three slots goes to 4^3 and thus 64. So, you have this huge change for adding item ball to the permutation set. Ben's explanation showed the proof of the pattern. A harmonic permutation would have more than one permutation set working together. Teddy On 11/28/06, Ian Skinner [EMAIL PROTECTED] wrote: Some sort of hexadecimal generator? YUP! Andy wins the prize. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262007 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
It is just a permutation set of all possible combinations of three items that allow repeats. But it was NOT a set of all possible combinations. For example 000, 888 and FFF were not desired results for my problem. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262034 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
3^3 would be all possibilities though. There were exclusions I believe. ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Teddy Payne [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 9:47 AM To: CF-Talk Subject: Re: Challenging Loop problem. Regardless of the hexidecimal generation. The pattern is taught to first year statistic students. It is just a permutation set of all possible combinations of three items that allow repeats. If you have three items with three slots, that means that you have have 3 comibnations in each slot, so 3^3 possibilities. The pattern changes exponentially based upon the number of slots and items. 4 items with three slots goes to 4^3 and thus 64. So, you have this huge change for adding item ball to the permutation set. Ben's explanation showed the proof of the pattern. A harmonic permutation would have more than one permutation set working together. Teddy On 11/28/06, Ian Skinner [EMAIL PROTECTED] wrote: Some sort of hexadecimal generator? YUP! Andy wins the prize. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262037 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem SOLVED
If you would like to display the colors in a circle: div id=colorWheel cfscript for (deg = 0; deg LT listLen(colorList); deg = deg + 1) { xp = 250 + 200*cos(360/listLen(colorList))*deg)+270)*pi())/180); yp = 250 + 200*sin(360/listLen(colorList))*deg)+270)*pi())/180); writeOutput('div style=width: 20px; height: 20px; background-color: ##' ListGetAt(colorList,deg + 1) '; position: absolute; top: ' round(yp)-10 'px; left: ' round(xp)-10 'px;/div' chr(13) chr(10)); } /cfscript /div -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262054 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem SOLVED
Ha! Very nice. ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 11:51 AM To: CF-Talk Subject: RE: Challenging Loop problem SOLVED If you would like to display the colors in a circle: div id=colorWheel cfscript for (deg = 0; deg LT listLen(colorList); deg = deg + 1) { xp = 250 + 200*cos(360/listLen(colorList))*deg)+270)*pi())/180); yp = 250 + 200*sin(360/listLen(colorList))*deg)+270)*pi())/180); writeOutput('div style=width: 20px; height: 20px; background-color: ##' ListGetAt(colorList,deg + 1) '; position: absolute; top: ' round(yp)-10 'px; left: ' round(xp)-10 'px;/div' chr(13) chr(10)); } /cfscript /div -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262065 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem.
Then I missed that condition. If the premise is the absence of triple multiplicities, then you will hav items^slots - itemslots, thus 3^3 - the permutations were one item has all three items slots sets. 3^3 - 3 and thus 24. This changes quickly if you have more items than slots and have to determine which multiplicities you want to exclude. Teddy On 11/29/06, Ian Skinner [EMAIL PROTECTED] wrote: It is just a permutation set of all possible combinations of three items that allow repeats. But it was NOT a set of all possible combinations. For example 000, 888 and FFF were not desired results for my problem. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262072 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem SOLVED
VERY nice Ian!!! !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 11:51 AM To: CF-Talk Subject: RE: Challenging Loop problem SOLVED If you would like to display the colors in a circle: div id=colorWheel cfscript for (deg = 0; deg LT listLen(colorList); deg = deg + 1) { xp = 250 + 200*cos(360/listLen(colorList))*deg)+270)*pi())/180); yp = 250 + 200*sin(360/listLen(colorList))*deg)+270)*pi())/180); writeOutput('div style=width: 20px; height: 20px; background-color: ##' ListGetAt(colorList,deg + 1) '; position: absolute; top: ' round(yp)-10 'px; left: ' round(xp)-10 'px;/div' chr(13) chr(10)); } /cfscript /div ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262078 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem SOLVED
That is pretty damn neat. I made a web safe color wheel just for fun =) http://www.opensourcecf.com/color_wheel.cfm Looks like Ian's got MAD math skills! Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262090 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem SOLVED
Looks like Ian's got MAD math skills! Rick No, I had to get a refresher course from the House of Fusion tutors on how to plot the circumference of a circle. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262094 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem SOLVED
Rick if you use this loop solution it will produce the colors in the proper order. (Generating this code was the purpose of this thread.) cfscript /* Create sequence of color hues. Thanks to Jim Wright of the House of Fusion discussion list for his invaluable assistance in creating this algorithm. */ thelist = 00,33,66,99,CC,FF; //Do this to seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually y = -1; //The direction we are starting in the list x = 2; //The position we are starting with p = 3; //Number of columns colorList = ; p1 = listlast(thelist); for (lp = 2; lp LTE p; lp = lp + 1) variables[p lp] = listfirst(thelist); l = listfind(thelist,variables[p x]); //Create hex value for current Hue hex = ; for (lp = 1; lp LTE p; lp = lp + 1) hex = hex variables[p lp]; colorList = listAppend(colorList, hex); do //iterate until start value is returned. { while (((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist { y = y * -1; if (x EQ 1) x = p; else x = x - 1; l = listfind(thelist,variables[p#x#]); } l = l + y; variables[p x] = listgetat(thelist,l); //Create hex value for current Hue hex = ; for (lp = 1; lp LTE p; lp = lp + 1) hex = hex variables[p lp]; colorList = listAppend(colorList, hex); } while (listFirst(colorList) NEQ hex); colorList = listDeleteAt(colorList,listLen(colorList));// remove repeat of first value. /cfscript -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262095 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem SOLVED
My very small addition :) !--- Rick Root wrote this code to generate a list of web safe colors --- cfsilent cfset colorlist = cfset color_codes = 00,33,66,99,CC,FF cfloop from=1 to=6 step=1 index=RED cfloop from=1 to=6 step=1 index=GREEN cfloop from=1 to=6 step=1 index=BLUE cfset thiscolor = #ListGetAt(COLOR_CODES,RED)##ListGetAt(COLOR_CODES,GREEN)##ListGetAt(COLOR_CODES,BLUE)# cfset colorlist = listappend(colorlist,thiscolor) /cfloop /cfloop /cfloop /cfsilent script function displayColor(thisColor) { document.colorPicker.curColor.value = '#'+thisColor; } /script div id=colorWheel cfscript // Ian Skinner wrote this code and posted it to cf-talk for (deg = 0; deg LT listLen(colorList); deg = deg + 1) { xp = 250 + 200*cos(360/listLen(colorList))*deg)+270)*pi())/180); yp = 275 + 200*sin(360/listLen(colorList))*deg)+270)*pi())/180); writeOutput('div style=width: 10px; height: 10px; background-color: ##' ListGetAt(colorList,deg + 1) '; position: absolute; top: ' round(yp)-10 'px; left: ' round(xp)-10 'px; onMouseOver=displayColor('''ListGetAt(colorList,deg + 1)''')/div' chr(13) chr(10)); } /cfscript /div form name=colorPicker div id=colorDisplay style=position:absolute;top:250; left:200 input type=text name=curColor value= size=7 /div /form -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 2:54 PM To: CF-Talk Subject: Re: Challenging Loop problem SOLVED That is pretty damn neat. I made a web safe color wheel just for fun =) http://www.opensourcecf.com/color_wheel.cfm Looks like Ian's got MAD math skills! Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262099 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem SOLVED
see, we can all waste our time on stuff that is completely worthless :) Turetsky, Seth wrote: My very small addition :) !--- Rick Root wrote this code to generate a list of web safe colors --- cfsilent cfset colorlist = cfset color_codes = 00,33,66,99,CC,FF cfloop from=1 to=6 step=1 index=RED cfloop from=1 to=6 step=1 index=GREEN cfloop from=1 to=6 step=1 index=BLUE cfset thiscolor = #ListGetAt(COLOR_CODES,RED)##ListGetAt(COLOR_CODES,GREEN)##ListGetAt(COLOR_CODES,BLUE)# cfset colorlist = listappend(colorlist,thiscolor) /cfloop /cfloop /cfloop /cfsilent script function displayColor(thisColor) { document.colorPicker.curColor.value = '#'+thisColor; } /script div id=colorWheel cfscript // Ian Skinner wrote this code and posted it to cf-talk for (deg = 0; deg LT listLen(colorList); deg = deg + 1) { xp = 250 + 200*cos(360/listLen(colorList))*deg)+270)*pi())/180); yp = 275 + 200*sin(360/listLen(colorList))*deg)+270)*pi())/180); writeOutput('div style=width: 10px; height: 10px; background-color: ##' ListGetAt(colorList,deg + 1) '; position: absolute; top: ' round(yp)-10 'px; left: ' round(xp)-10 'px; onMouseOver=displayColor('''ListGetAt(colorList,deg + 1)''')/div' chr(13) chr(10)); } /cfscript /div form name=colorPicker div id=colorDisplay style=position:absolute;top:250; left:200 input type=text name=curColor value= size=7 /div /form -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 29, 2006 2:54 PM To: CF-Talk Subject: Re: Challenging Loop problem SOLVED That is pretty damn neat. I made a web safe color wheel just for fun =) http://www.opensourcecf.com/color_wheel.cfm Looks like Ian's got MAD math skills! Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262118 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem SOLVED
Oh, but can't we. I added a nice little gif mask that trims the divisions into a neat and clean circle. :-) Rick wrote: see, we can all waste our time on stuff that is completely worthless :) Turetsky, Seth wrote: My very small addition :) -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262123 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
It's just nested list loops (or index loops depending on how you execute). The trick is just to figure out what the pattern is. I can't quite see the pattern is, but once you figure it out, the technicals of the CFLoops are the easy part. You figure out the patterns, we can help you with the CFLoop. Maybe this will help, overnight I realize what I'm wanting to do is similar to compass directions. I.E. N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, Does that help anybody? -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261858 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
I agree. I can't see the pattern. Also, there are combinations you didn't show in the example. Where would those fall in the pattern, like aaa, or bbb. ~Brad Not allowed. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261859 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
Can anyone take it from here Anyone see the pattern? It looks harmonic to me, but there are patterns that CANNOT happen then, so I am not sure how to determine the first row. You described it better then I ever could. To help clarify there will always only be three columns. All that changes in the larger lists is the possible numbers in each column. In an earlier post I commented that I realized that my pattern is similar to compass directions. I.E. N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, Mine just has more combinations, but it is also circular at the end of the pattern one is back at the beginning. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261862 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
Thanks Jim that gives me a pretty good starting point. I just need to figure out how to make it only go through the pattern once. Then enhance it so that it can expand the pattern to more then 3 values per column. As mentioned in an earlier response, my pattern always has three columns, but it would be nice if I could have N possible values per column. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261865 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem.
Ian Skinner wrote: Then enhance it so that it can expand the pattern to more then 3 values per column. As mentioned in an earlier response, my pattern always has three columns, but it would be nice if I could have N possible values per column. The original assumed the same number of columns as values in the list...this disconnects the two...I think it works, but I didn't put much effort into checking... cfset thelist = 0,8,16,32,64 / !---Do this to seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually--- cfset y = -1!---The direction we are starting in in the list--- cfset x = 2!---The position we are starting with--- cfset p = 3!---Number of columns--- cfset p1 = listlast(thelist) cfloop index=lp from=2 to=#p# cfset p#lp# = listfirst(thelist) /cfloop cfoutput cfset l = listfind(thelist,variables[p#x#]) cfloop index=lp from=1 to=#p##variables[p#lp#]#./cfloopBR cfloop index=n from=1 to=50!---however many times you want to iterate--- cfset nn = 1 cfloop condition=((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist))) cfset nn = nn + 1cfif nn GT len(thelist)There seems to be an infinite loop.cfabort/cfif!---just in case my logic was off--- cfset y = y * -1 cfif x IS 1cfset x = pcfelsecfset x = x - 1/cfif cfset l = listfind(thelist,variables[p#x#]) /cfloop cfset l = l + y cfset p#x# = listgetat(thelist,l) cfloop index=lp from=1 to=#p##variables[p#lp#]#./cfloopBR /cfloop /cfoutput ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261868 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
Ian, Given an existing list, can you calculate the next item in a list? nextItem(ACC) - ABC nextItem(ACC,ABC) - AAC nextItem(ACC,ABC,AAC) - BAC If you can make the nextItem() function work, this function should build out the list. function buildList(list) { if (nextItem(list) eq listFirst(list)) return list; return buildList(listAppend(list, nextItem(list)); } Once we figure out how the pattern works, I'm sure we can help you with the nextItem function as well. Patrick -- Patrick McElhaney 704.560.9117 ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261869 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
Thanks again Jim, that looks pretty good on first blush. I was still working my brain through your first example. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261870 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
Patrick Well Jim seems to have nailed the pattern. I'm currently testing the results of his algorithm to make sure it works across various lists of values. So far it has been performing very well. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261872 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
Ian Skinner wrote: Thanks again Jim, that looks pretty good on first blush. I was still working my brain through your first example. Hope it works for you...if you can tell us, I'm curious to find out what this is used for. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261873 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem.
On 11/27/06, Ben Nadel [EMAIL PROTECTED] wrote: The patterns is the same. The columns are changing in harmonic motion (so to speak). Sharp eye, Ben! I can see the pattern when I line up the sequence like this. ACC ABC AAC BAC CAC CAB CAA CBA CCA BCA ACA BCA Okay, I think I have an idea how to make my nextItem() function work. Figure out which row changed last. (If there's only one item in the list, assume the second row changed last.) If the row moved up (A-B): - if it's not at the highest point (C): - move it up (B-C) - return - elseif it moved down (C-B) - if it's not at the lowest point (A): - move it down (B-A) - return - else - if you're on the last row: - go to the first row - else: - go to the next row Start over (recurse) at If the row moved up... Patrick -- Patrick McElhaney 704.560.9117 ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261875 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
Hope it works for you...if you can tell us, I'm curious to find out what this is used for. Yeah I'll let everybody know when I'm done. I was curious if anybody would guess from the patterns. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261878 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
Ian Skinner wrote: Yeah I'll let everybody know when I'm done. I was curious if anybody would guess from the patterns. My first thought when looking at them was that they had something to do with DNA sequencing (of course, then the list would be A,C,G,T). ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261886 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
My first thought when looking at them was that they had something to do with DNA sequencing (of course, then the list would be A,C,G,T). Nothing nearly that complicated or significant. The numbers would probably give a better hint then the letters. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261887 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem SOLVED
As promised the completed task of this strange harmonic looping project. cfscript /* Create sequence of color hues. Thanks to Jim Wright of the House of Fusion discussion list for his invaluable assistance in creating this algorithm. */ thelist = 00,44,88,CC,FF; //Do this to seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually y = -1; //The direction we are starting in the list x = 2; //The position we are starting with p = 3; //Number of columns colorList = ; p1 = listlast(thelist); for (lp = 2; lp LTE p; lp = lp + 1) variables[p lp] = listfirst(thelist); l = listfind(thelist,variables[p x]); //Create hex value for current Hue hex = ; for (lp = 1; lp LTE p; lp = lp + 1) hex = hex variables[p lp]; colorList = listAppend(colorList, hex); do //iterate until start value is returned. { while (((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist { y = y * -1; if (x EQ 1) x = p; else x = x - 1; l = listfind(thelist,variables[p#x#]); } l = l + y; variables[p x] = listgetat(thelist,l); //Create hex value for current Hue hex = ; for (lp = 1; lp LTE p; lp = lp + 1) hex = hex variables[p lp]; colorList = listAppend(colorList, hex); } while (listFirst(colorList) NEQ hex); colorList = listDeleteAt(colorList,listLen(colorList));// remove repeat of first value. /cfscript -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261891 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
Some sort of hexadecimal generator? !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 10:42 AM To: CF-Talk Subject: RE: Challenging Loop problem. My first thought when looking at them was that they had something to do with DNA sequencing (of course, then the list would be A,C,G,T). Nothing nearly that complicated or significant. The numbers would probably give a better hint then the letters. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261895 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
Some sort of hexadecimal generator? YUP! Andy wins the prize. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261896 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
nice compsci homework question! quick google on 'generating combinations' http://www.google.com/search?q=generating+combinationsstart=0ie=utf-8oe=utf-8client=firefox-arls=org.mozilla:en-US:official yields all kinds of nifty stuff. http://www.thescripts.com/forum/thread161838.html looks like a promising algorithm. wish I had time to jump on this, but alas the day end draws near! DK On 11/27/06, Ian Skinner [EMAIL PROTECTED] wrote: Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261785 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Challenging Loop problem.
I'm not touching this with a 50' pole. However, I'm interested to see the result. Douglas Knudsen wrote: nice compsci homework question! quick google on 'generating combinations' http://www.google.com/search?q=generating+combinationsstart=0ie=utf-8oe=utf-8client=firefox-arls=org.mozilla:en-US:official yields all kinds of nifty stuff. http://www.thescripts.com/forum/thread161838.html looks like a promising algorithm. wish I had time to jump on this, but alas the day end draws near! DK On 11/27/06, Ian Skinner [EMAIL PROTECTED] wrote: Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261786 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
cfset thelist = a,b,c / cfoutput cfloop list=#thelist# index=a cfloop list=#thelist# index=b cfloop list=#thelist# index=c #a##b##c# /cfloop /cfloop /cfloop /cfoutput ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261787 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
This won't do it in the proper order... -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 5:09 PM To: CF-Talk Subject: RE: Challenging Loop problem. cfset thelist = a,b,c / cfoutput cfloop list=#thelist# index=a cfloop list=#thelist# index=b cfloop list=#thelist# index=c #a##b##c# /cfloop /cfloop /cfloop /cfoutput ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261789 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
It's just nested list loops (or index loops depending on how you execute). The trick is just to figure out what the pattern is. I can't quite see the pattern is, but once you figure it out, the technicals of the CFLoops are the easy part. You figure out the patterns, we can help you with the CFLoop. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261790 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Challenging Loop problem.
I should have paid a little more attention. I didnt see the order requirement. I see no rhyme or reason to the order of what you want to generate though. Is there any? What I posted would generate something closer to... AAA, AAB, AAC, ABA, ABB, ABC, etc... ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 5:09 PM To: CF-Talk Subject: RE: Challenging Loop problem. cfset thelist = a,b,c / cfoutput cfloop list=#thelist# index=a cfloop list=#thelist# index=b cfloop list=#thelist# index=c #a##b##c# /cfloop /cfloop /cfloop /cfoutput ...:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261791 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
I agree. I can't see the pattern. Also, there are combinations you didn't show in the example. Where would those fall in the pattern, like aaa, or bbb. ~Brad -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:20 PM To: CF-Talk Subject: RE: Challenging Loop problem. I should have paid a little more attention. I didn't see the order requirement. I see no rhyme or reason to the order of what you want to generate though. Is there any? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261792 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
Wait a minute, even the different lists Ian gave as examples in the original post don't match up --- In the letters one, the third to last and the last letter groups are both BCA. But in the numbers one, the third to last is 8 0 16 while the last is 16 0 8. So something is amiss in one or the other of those lists. I agree this will be very tough as there is little apparent pattern in the lists. I am curious as to why you need to do this? -- Josh - Original Message - From: Bobby Hartsfield [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Monday, November 27, 2006 2:20 PM Subject: RE: Challenging Loop problem. I should have paid a little more attention. I didn't see the order requirement. I see no rhyme or reason to the order of what you want to generate though. Is there any? What I posted would generate something closer to... AAA, AAB, AAC, ABA, ABB, ABC, etc... ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 5:09 PM To: CF-Talk Subject: RE: Challenging Loop problem. cfset thelist = a,b,c / cfoutput cfloop list=#thelist# index=a cfloop list=#thelist# index=b cfloop list=#thelist# index=c #a##b##c# /cfloop /cfloop /cfloop /cfoutput ...:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261793 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
The patterns is the same. The columns are changing in harmonic motion (so to speak). The other difference bewteen the two sets is that the first one starts C A A and the second one starts A C C. Once the first line is established, the patterns follows in a harmonic motion. The patterns seems to start with the second column. It counds UP or DOWN in the list until it cannot go any further. Then the NEXT column to the left starts to change (while the rest of the columns stay the same). It moves UP or DOWN (whatever direciton is OPPOSITE the dirction of the first active column) until it can no longer change (Max n-1 rows). Then the active column moves to the left once (or wraps to the last column) and repeats. I don't think the first row is important. I think the first row just dictates where in the pattern it starts. Take a look at the number example: 16 0 0 16 8 0 16 16 0 8 16 0 0 16 0 0 16 8 0 16 16 0 8 16 0 0 16 8 0 16 16 0 16 16 0 8 16 0 0 16 8 0 16 16 0 8 16 0 0 16 0 0 16 8 0 16 16 0 8 16 0 0 16 8 0 16 16 0 16 16 0 8 16 0 0 16 8 0 16 16 0 8 16 0 0 16 0 I have replaces the CHANGING columns with X and the staying the same columns with .. - - - .. x . .. x . x . . x . . .. . x .. . x .. x . .. x . x . . x . . .. . x .. . x .. x . .. x . x . . x . . .. . x .. . x .. x . .. x . x . . x . . .. . x .. . x .. x . .. x . x . . x . . Notice the Active column keeps moving left then wraps. I can't quite figure out the patterns, but that is basically what is going on. Not sure how a FOURTH column would fit into it, but I am guessing the active patterns would be: .. x . . .. x . . .. x . . x . . . x . . . x . . . .. . . x .. . . x .. . . x .. . x . .. . x . .. . x . .. x . . .. x . . .. x . . x . . . x . . . x . . . .. . . x .. . . x .. . . x .. . x . .. . x . .. . x . .. x . . .. x . . .. x . . x . . . x . . . I bet that the number of times the active column changes is always N-1 before it switches. Can anyone take it from here Anyone see the pattern? It looks harmonic to me, but there are patterns that CANNOT happen then, so I am not sure how to determine the first row. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Josh Nathanson [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 5:41 PM To: CF-Talk Subject: Re: Challenging Loop problem. Wait a minute, even the different lists Ian gave as examples in the original post don't match up --- In the letters one, the third to last and the last letter groups are both BCA. But in the numbers one, the third to last is 8 0 16 while the last is 16 0 8. So something is amiss in one or the other of those lists. I agree this will be very tough as there is little apparent pattern in the lists. I am curious as to why you need to do this? -- Josh - Original Message - From: Bobby Hartsfield [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Monday, November 27, 2006 2:20 PM Subject: RE: Challenging Loop problem. I should have paid a little more attention. I didn't see the order requirement. I see no rhyme or reason to the order of what you want to generate though. Is there any? What I posted would generate something closer to... AAA, AAB, AAC, ABA, ABB, ABC, etc... ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 5:09 PM To: CF-Talk Subject: RE: Challenging Loop problem. cfset thelist = a,b,c / cfoutput cfloop list=#thelist# index=a cfloop list=#thelist# index=b cfloop list=#thelist# index=c #a##b##c# /cfloop /cfloop /cfloop /cfoutput ...:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 4:34 PM To: CF-Talk Subject: Challenging Loop problem. Say I have the following values: A,B,C How could I programically create the following list in this order? ACC,ABC,AAC,BAC,CAC,CAB,CAA,CBA,CCA,BCA,ACA,BCA Or the same thing with the numbers 0,8,16: 16 0 0,16 8 0,16 16 0,8 16 0,0 16 0,0 16 8,0 16 16,0 8 16,0 0 16,8 0 16,16 0 16,16 0 8 Now do the same thing, but with any number of values between 1 and 16. IE. AB(0 16), ABC(0 8 16), ABCDE(0,4,8,12,16) I don't even have a clue on how to start. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please
Re: Challenging Loop problem.
Try this out... cfset thelist = 0,8,16 !---Seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually--- cfset p1 = listlast(thelist) cfloop index=lp from=2 to=#listlen(thelist)# cfset p#lp# = listfirst(thelist) /cfloop cfset y = -1!---The direction we are starting in in the list--- cfset x = 2!---The position we are starting at--- cfoutput cfset l = listfind(thelist,variables[p#x#]) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR cfloop index=n from=1 to=50!---however many times you want to iterate--- cfset c = 1 cfloop condition=((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist))) cfset c = c + 1cfif c GT len(thelist)We are looping, no more changes seem possible.cfabort/cfif cfset y = y * -1 cfif x IS 1cfset x = listlen(thelist)cfelsecfset x = x - 1/cfif cfset l = listfind(thelist,variables[p#x#]) /cfloop cfset l = l + y cfset p#x# = listgetat(thelist,l) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR /cfloop /cfoutput ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261810 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Challenging Loop problem.
Jim...You have way too much time on your hands :) Pretty damn interesting!! That would have made my brain explode!! Doug B. - Original Message - From: Jim Wright [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Monday, November 27, 2006 8:30 PM Subject: Re: Challenging Loop problem. Try this out... cfset thelist = 0,8,16 !---Seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually--- cfset p1 = listlast(thelist) cfloop index=lp from=2 to=#listlen(thelist)# cfset p#lp# = listfirst(thelist) /cfloop cfset y = -1!---The direction we are starting in in the list--- cfset x = 2!---The position we are starting at--- cfoutput cfset l = listfind(thelist,variables[p#x#]) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR cfloop index=n from=1 to=50!---however many times you want to iterate--- cfset c = 1 cfloop condition=((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist))) cfset c = c + 1cfif c GT len(thelist)We are looping, no more changes seem possible.cfabort/cfif cfset y = y * -1 cfif x IS 1cfset x = listlen(thelist)cfelsecfset x = x - 1/cfif cfset l = listfind(thelist,variables[p#x#]) /cfloop cfset l = l + y cfset p#x# = listgetat(thelist,l) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR /cfloop /cfoutput ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261811 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Challenging Loop problem.
Nice :-) ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 10:31 PM To: CF-Talk Subject: Re: Challenging Loop problem. Try this out... cfset thelist = 0,8,16 !---Seed the list with values, by default the first element is the last value in the list, and all of the others are the first value in the list, could also be set manually--- cfset p1 = listlast(thelist) cfloop index=lp from=2 to=#listlen(thelist)# cfset p#lp# = listfirst(thelist) /cfloop cfset y = -1!---The direction we are starting in in the list--- cfset x = 2!---The position we are starting at--- cfoutput cfset l = listfind(thelist,variables[p#x#]) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR cfloop index=n from=1 to=50!---however many times you want to iterate--- cfset c = 1 cfloop condition=((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist))) cfset c = c + 1cfif c GT len(thelist)We are looping, no more changes seem possible.cfabort/cfif cfset y = y * -1 cfif x IS 1cfset x = listlen(thelist)cfelsecfset x = x - 1/cfif cfset l = listfind(thelist,variables[p#x#]) /cfloop cfset l = l + y cfset p#x# = listgetat(thelist,l) cfloop index=lp from=1 to=#listlen(thelist)##variables[p#lp#]#./cfloopBR /cfloop /cfoutput ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261814 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4