func createFullCaveMap(input [][]int) [][]int {
	multiplier := 5
	fullMap := make([][]int, len(input)*multiplier)
	for i := 0; i < len(input)*multiplier; i++ {
		x := i
		var xinc int
		if x >= len(input) {
			x = i % len(input)    // relative position of this row relative to original matrix
			xinc = i / len(input) // copy number of this row
		}
		fullMap[i] = make([]int, len(input[x])*multiplier)
		for j := 0; j < len(input[x])*multiplier; j++ {
			y := j
			var yinc int
			if y >= len(input[x]) {
				y = j % len(input[x])    // relative position of column relative to original matrix
				yinc = j / len(input[x]) // copy number of this column
			}
			//fmt.Println(i, j, x, y)
			val := input[x][y]
			if xinc > 0 || yinc > 0 {
				val = val + xinc + yinc
				// If value is greater than 9 it resets to 1 (and NOT 0!)
				if val > 9 {
					val = val%10 + 1
				}
				//fmt.Println("Changed: ", input[x][y], " to ", val, " at ", i, j, xinc, yinc)
			}
			fullMap[i][j] = val
			//fmt.Print(val)
		}
		//fmt.Println()
	}
	return fullMap
}
// Copy over a 2D matrix 'multiplier' times to both right and below
// Also increment the value by the copy number and reset >9 values to 1
Copy over a 2D matrix 'multiplier' times to both right and below
Also increment the value by the copy number and reset >9 values to 1
// Copy over a 2D matrix ' multiplier ' times to both right and below // Also increment the value by the copy number and reset > 9 values to 1
func createFullCaveMap(input [][]int) [][]int {
	multiplier := 5
	fullMap := make([][]int, len(input)*multiplier)
	for i := 0; i < len(input)*multiplier; i++ {
		x := i
		var xinc int
		if x >= len(input) {
			x = i % len(input)    
			xinc = i / len(input) 
		}
		fullMap[i] = make([]int, len(input[x])*multiplier)
		for j := 0; j < len(input[x])*multiplier; j++ {
			y := j
			var yinc int
			if y >= len(input[x]) {
				y = j % len(input[x])    
				yinc = j / len(input[x]) 
			}
			val := input[x][y]
			if xinc > 0 || yinc > 0 {
				val = val + xinc + yinc
				if val > 9 {
					val = val%10 + 1
				}
			}
			fullMap[i][j] = val
		}
	}
	return fullMap
}
func createFullCaveMap ( input [ ] [ ] int ) [ ] [ ] int { multiplier := 5 fullMap := make ( [ ] [ ] int , len ( input ) * multiplier ) for i := 0 ; i < len ( input ) * multiplier ; i ++ { x := i var xinc int if x >= len ( input ) { x = i % len ( input ) xinc = i / len ( input ) } fullMap [ i ] = make ( [ ] int , len ( input [ x ] ) * multiplier ) for j := 0 ; j < len ( input [ x ] ) * multiplier ; j ++ { y := j var yinc int if y >= len ( input [ x ] ) { y = j % len ( input [ x ] ) yinc = j / len ( input [ x ] ) } val := input [ x ] [ y ] if xinc > 0 || yinc > 0 { val = val + xinc + yinc if val > 9 { val = val % 10 + 1 } } fullMap [ i ] [ j ] = val } } return fullMap }
Copy over a 2D matrix 'multiplier' times to both right and below
Also increment the value by the copy number and reset >9 values to 1
Copy over a 2D matrix ' multiplier ' times to both right and below Also increment the value by the copy number and reset > 9 values to 1
// relative position of this row relative to original matrix // copy number of this row // relative position of column relative to original matrix // copy number of this column //fmt.Println(i, j, x, y) // If value is greater than 9 it resets to 1 (and NOT 0!) //fmt.Println("Changed: ", input[x][y], " to ", val, " at ", i, j, xinc, yinc) //fmt.Print(val) //fmt.Println()