|
|
|
@ -97,22 +97,15 @@ func Reduce[T any](slc []T, fn func(T, T) T) T {
|
|
|
|
|
return slc[0]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Generate numbers in a range - start (inclusive) to end (exclusive)
|
|
|
|
|
func genRange[T character](start, end T) []T {
|
|
|
|
|
// Generate numbers in a range - start to end (both inclusive)
|
|
|
|
|
func genRangeInclusive[T character](start, end T) []T {
|
|
|
|
|
toRet := make([]T, end-start)
|
|
|
|
|
for i := start; i < end; i++ {
|
|
|
|
|
for i := start; i <= end; i++ {
|
|
|
|
|
toRet[i-start] = i
|
|
|
|
|
}
|
|
|
|
|
return toRet
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Generate numbers in a range - start to end (both inclusive)
|
|
|
|
|
func genRangeInclusive[T character](start, end T) []T {
|
|
|
|
|
toRet := genRange(start, end)
|
|
|
|
|
toRet = append(toRet, end)
|
|
|
|
|
return toRet
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Returns a rune-slice containing all possible cases of the given rune, given the
|
|
|
|
|
// 'caseInsensitive' boolean variable.
|
|
|
|
|
// If this variable is false, the rune is returned as-is, without modifications.
|
|
|
|
|