PhilW wrote:- Unless you wish to allow for the possibility of both, then a single parameter WaterBoxes could be used, set to None, Glasses or TastingNotes.
And it could have a value
/Both. Consider the case in which the parameter’s value is some code, probably depending on
Names NameNum get: which would be easier? •••This is the only outstanding WaterBoxes question: two boolean parameters (
WaterBoxesGlasses and
WaterBoxesTastingNotes), or one four-valued parameters (
WaterBoxes)? My slight preference is for former.•••
PhilW wrote:- A single parameter WaterBoxesNumCols or WaterBoxesRowLenMax (or similar) could be commonly used which would suffice for both, while still clearly defining the length of triangle side for use on glass pages, or single row on tasting notes,
This suggests a rectangular layout, which isn’t the plan for the glasses page.
PhilW wrote:- Define a single parameter WaterBoxCount; For tasting note pages, this is a single line; For glasses pages, use rndup(sqrt(2*WaterBoxCount)) to define the long triangle side length (and optionally drop boxes from the top of the triangle if wanted for precise count)
I agree with
WaterBoxesNum. But your formula is wrong (test 1, 3, 5, 6, 9, 10). I’ll use ( √(1+8
n) - 1 )÷2, rounded up, which, without testing, is
WaterBoxesNum 8 mul 1 add sqrt 1.00001 sub 2 div ceiling cvi. (The extra
.00001 is meant to fix PostScript’s single precision. In theory it should not introduce an error of its own until the number of water boxes is infeasibly large. Anyway the code fails for other reasons above 65535 boxes.)