refactor user defined keypad

This commit is contained in:
2024-08-24 21:02:50 -05:00
parent 1a7dc45ab9
commit 3bf2b4d71f
19 changed files with 273 additions and 190 deletions

View File

@@ -147,7 +147,7 @@ func IdentityArray(arrLen int) []int {
func ListToMatrix(listArr []int, numbCols int) ([][]int, error) {
if len(listArr)%numbCols != 0 {
return nil, errors.New(fmt.Sprintf("Array is not evenly divisible by number of columns: %d mod %d = %d", len(listArr), numbCols, len(listArr)%numbCols))
panic(fmt.Sprintf("Array is not evenly divisible by number of columns: %d mod %d = %d", len(listArr), numbCols, len(listArr)%numbCols))
}
numbRows := len(listArr) / numbCols
matrix := make([][]int, numbRows)