GIMP Chat http://gimpchat.com/ |
|
I must have an Endless Loop but can not Understand it http://gimpchat.com/viewtopic.php?f=9&t=19796 |
Page 1 of 1 |
Author: | ThomasLahme [ Thu Jan 27, 2022 8:59 am ] | ||
Post subject: | I must have an Endless Loop but can not Understand it | ||
Dear Community, I must have build an Endless Loop. My Program which I have attach to this Post, must have an Endless Loop. It seams to run forever without to come to a final Result. I think that I have tested all Subroutines separately, but when I put all together it continues about 300 Seconds. One thing I couldn't have tested is my "Dvider-Wraper" Subroutine. To Test this Subroutine I have chosen a Value of 50 Pixels. I hope anyone could find my basically Mistake so he can help me. A seams to be stupid Thomas Lahme
|
Author: | ThomasLahme [ Thu Jan 27, 2022 9:17 am ] |
Post subject: | Re: I must have an Endless Loop but can not Understand it |
Ok, I have not found the Because of for my Problem with the "If" Construct in GIMP Sheme, but I have found a Workaround with a "Cond" Construct. A Thomas Lahme Who thinks now that he is not so stupid |
Author: | AlSchemist [ Thu Jan 27, 2022 2:44 pm ] |
Post subject: | Re: I must have an Endless Loop but can not Understand it |
Hello divider y1 y2 does not converge. Let suppose that y1 must be inferior to y2. divider introduces two points dy1 and dy2 reducing the distance between y1 and y2. y1 => dy1 => dy2 => y2 However there are only additions in the definitions of dy1 and yd2. so for example dy2 could be greater than the target y2. Fortunately, the program stops before the infinity thanks to: Code: Select all (gimp-image-select-rectangle image 2 0 y 300 dy ) dy could be negative and gimp-image-select-rectangle does not like negative values. One of issues is the call of random. According to C:\Program Files\GIMP 2\share\gimp\2.0\scripts\script-fu-compat.init random has only one parameter. However dy1 and dy2 are defined by: Code: Select all (define dy1 (+ (random y2 y1) y1)) ; Calculate the higher Division-Point The comment is not sufficient. Always supply a running example with expected result: y1= y2= dy1 could be ... |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |