#2 Proper usage of range
This commit is contained in:
parent
81edc8962d
commit
c9b05e7026
@ -6,8 +6,8 @@ import (
|
||||
)
|
||||
|
||||
func (solver *Solver) print_solutions() {
|
||||
for solutions := range solver.solutions {
|
||||
log.Printf("\nSolution #%d:", solutions+1)
|
||||
fmt.Println(solver.solutions[solutions])
|
||||
for solution_index, solution := range solver.solutions {
|
||||
log.Printf("\nSolution #%d:", solution_index+1)
|
||||
fmt.Println(solution)
|
||||
}
|
||||
}
|
||||
|
@ -41,9 +41,9 @@ func (solver *Solver) find_blocks(row *string, rows *[]int) {
|
||||
selection = nil
|
||||
}
|
||||
|
||||
for block := range curr_blocks {
|
||||
for _, block := range curr_blocks {
|
||||
|
||||
curr_row := strconv.Itoa(curr_blocks[block])
|
||||
curr_row := strconv.Itoa(block)
|
||||
|
||||
if func_row[letter] == curr_row[letter] {
|
||||
found_row, _ := strconv.Atoi(curr_row)
|
||||
|
Loading…
x
Reference in New Issue
Block a user