code: func (m *symbol) penalty1() int {
  	penalty := 0
  
  	for x := 0; x < m.symbolSize; x++ {
  		lastValue := m.get(x, 0)
  		count := 1
  
  		for y := 1; y < m.symbolSize; y++ {
  			v := m.get(x, y)
  
  			if v != lastValue {
  				count = 1
  				lastValue = v
  			} else {
  				count++
  				if count == 6 {
  					penalty += penaltyWeight1 + 1
  				} else if count > 6 {
  					penalty++
  				}
  			}
  		}
  	}
  
  	for y := 0; y < m.symbolSize; y++ {
  		lastValue := m.get(0, y)
  		count := 1
  
  		for x := 1; x < m.symbolSize; x++ {
  			v := m.get(x, y)
  
  			if v != lastValue {
  				count = 1
  				lastValue = v
  			} else {
  				count++
  				if count == 6 {
  					penalty += penaltyWeight1 + 1
  				} else if count > 6 {
  					penalty++
  				}
  			}
  		}
  	}
  
  	return penalty
  }
docs: // penalty1 returns the penalty score for "adjacent modules in row/column with
  // same colour".
  //
  // The numbers of adjacent matching modules and scores are:
  // 0-5: score = 0
  // 6+ : score = penaltyWeight1 + (numAdjacentModules - 5)