Skip to content

Helpers

Defined in: blueprint/helpers.ts:7

Helper functions for constructing count arrays used in conditions. Accessed via vi.helpers.

new Helpers(neighborhoodName?): Helpers

Defined in: blueprint/helpers.ts:8

Neighborhood

Helpers

between(min, max): number[]

Defined in: blueprint/helpers.ts:40

Generates a range of whole numbers from min to max (inclusive).

number

The start of the range (must be ≥ 0).

number

The end of the range (must be ≤ 8 and greater than min). For cross neighborhoods, should not exceed 4.

number[]

An array of numbers from min to max.


even(): number[]

Defined in: blueprint/helpers.ts:64

Returns all even count values (zero included) for the current neighborhood type.

number[]

[0, 2, 4, 6, 8] for square, [0, 2, 4] for cross.


not(value): number[]

Defined in: blueprint/helpers.ts:16

Returns every valid count value except the ones specified.

A number or array of numbers to exclude.

number | number[]

number[]

An array of all valid count values minus the excluded ones.


odd(): number[]

Defined in: blueprint/helpers.ts:73

Returns all odd count values for the current neighborhood type.

number[]

[1, 3, 5, 7] for square, [1, 3] for cross.