Page 1 of 1

Bug: CF::MaxShapes

Posted: Tue Nov 14, 2017 11:45 pm
by kipling

Code: Select all

CF::MaxShapes=3
startshape S
shape S{
	SQUARE[]
	S[x 1.1]
	}
Please fix. 😀
(Can't seem to attach an image - this used to be possible, but I can only link to an image)

Re: Bug: CF::MaxShapes

Posted: Wed Nov 15, 2017 9:29 am
by MtnViewJohn
The dreaded off-by-one error. Even if fixed you would still see extra shapes in some conditions:

Code: Select all

CF::MaxShapes=3
startshape S
shape S{
	SQUARE[]
	SQUARE[]
	S[x 1.1]
}
will always have an even number of shapes because the maxshapes check is in the wrong place. How crucial is it for CF::MaxShapes to be exact? I can check in another place.

Re: Bug: CF::MaxShapes

Posted: Wed Nov 15, 2017 9:53 am
by kipling
I wasn't serious about "please fix". So "How crucial" = ε.
I just noticed it when trying to land an exact shape count for the hearts design, so I wrote a MWE.
My workaround in that design is an explicit "-1" in the code.
Yes, everyone should count from 0 to N except when they count from 1 to N-1.

Re: Bug: CF::MaxShapes

Posted: Wed Nov 15, 2017 5:28 pm
by MtnViewJohn
Ha ha. I won't fix it then. I wouldn't want to break your work-around. :lol: