Piotr Czajkowski 2 years ago
parent
commit
3ff96da105
1 changed files with 4 additions and 3 deletions
  1. 4 3
      13/code.go

+ 4 - 3
13/code.go

@@ -162,12 +162,13 @@ func createBoard(input []point) [][]string {
 
 func printBoard(input []point) {
 	board := createBoard(input)
+	start := len(board[0]) - 1
 	for _, line := range board {
-		for _, c := range line {
-			if c == "" {
+		for i := start; i >= 0; i-- {
+			if line[i] == "" {
 				fmt.Print(" ")
 			} else {
-				fmt.Print(c)
+				fmt.Print(line[i])
 			}
 		}
 		fmt.Println()