It is currently Sun Jun 30, 2024 1:25 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: I must have an Endless Loop but can not Understand it
PostPosted: Thu Jan 27, 2022 8:59 am  (#1) 
Offline
GimpChat Member

Joined: Apr 20, 2021
Posts: 13
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


Attachments:
File comment: My Code for my little first Try
Divider001.scm [2.63 KiB]
Downloaded 27 times
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: I must have an Endless Loop but can not Understand it
PostPosted: Thu Jan 27, 2022 9:17 am  (#2) 
Offline
GimpChat Member

Joined: Apr 20, 2021
Posts: 13
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


Top
 Post subject: Re: I must have an Endless Loop but can not Understand it
PostPosted: Thu Jan 27, 2022 2:44 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Oct 23, 2021
Posts: 67
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:
(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:
(define dy1 (+ (random y2 y1) y1)) ; Calculate the higher Division-Point
(define dy2 (+ (random y2 dy1) dy1)) ; Calculate the lower Division-Point

The comment is not sufficient.

Always supply a running example with expected result:
y1=
y2=
dy1 could be ...


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) I Used Gimp To Make a GIF Loop Seamlessly

15

No new posts Attachment(s) Someone Please Help Me Understand Why Is the Gimp Image Size Bigger

4



* Login  



Powered by phpBB3 © phpBB Group