Split intcode-processor to it's own library, made day 2 work with it

This commit is contained in:
Brian Buller 2019-12-04 14:07:27 -06:00
parent 6c4a6187ff
commit bbfcc6022d
8 changed files with 264 additions and 261 deletions

View File

@ -2,11 +2,11 @@ package main
import (
"fmt"
"log"
"regexp"
"sort"
"strconv"
"strings"
helpers2017 "bitbucket.org/thezeez/advent-of-code-2017/helpers"
)
type Battlefield map[int]Army
@ -48,11 +48,11 @@ func PrepareForBattle(input []string) (Battlefield, Initiative) {
}
group := &Group{
Units: helpers2017.IntOrPanic(description[descriptionCount]),
HitPoints: helpers2017.IntOrPanic(description[descriptionHitPoints]),
AttackDamage: helpers2017.IntOrPanic(description[descriptionDamage]),
Units: Atoi(description[descriptionCount]),
HitPoints: Atoi(description[descriptionHitPoints]),
AttackDamage: Atoi(description[descriptionDamage]),
AttackType: description[descriptionDamageType],
Initiative: helpers2017.IntOrPanic(description[descriptionInitiative]),
Initiative: Atoi(description[descriptionInitiative]),
}
immunities := groupImmunities.FindStringSubmatch(line)
@ -159,3 +159,12 @@ func (b Battlefield) TotalUnits() int {
}
return sum
}
func Atoi(i string) int {
var ret int
var err error
if ret, err = strconv.Atoi(i); err != nil {
log.Fatal("Invalid Atoi")
}
return ret
}

View File

@ -3,7 +3,7 @@ package main
import (
"bufio"
"fmt"
"git.bullercodeworks.com/brian/adventofcode/intcode-processor"
intcode "git.bullercodeworks.com/brian/adventofcode/2019/intcode-processor"
"log"
"os"
"strconv"
@ -12,31 +12,21 @@ import (
func main() {
inp := StdinToString()
i := intcode.Program
f := func(c rune) bool {
return c == ','
}
var prog []int
for _, v := range strings.FieldsFunc(inp, f) {
for _, v := range strings.Split(inp, ",") {
prog = append(prog, Atoi(v))
}
i := intcode.NewProgram(prog)
i.PrintCode()
//part2(prog)
part1(prog)
part2(prog)
}
func part1(prog []int) {
for i := 0; i < len(prog); i += 4 {
switch prog[i] {
case 1:
prog[prog[i+3]] = add(prog[i+1], prog[i+2], prog)
case 2:
prog[prog[i+3]] = mult(prog[i+1], prog[i+2], prog)
case 99:
printState(prog)
os.Exit(0)
}
p := intcode.NewProgram(prog)
p.Run()
if p.State() == intcode.RET_ERR {
fmt.Println(p.Error())
}
fmt.Println("Part 1:", p.GetProgramValueAt(0))
}
func part2(prog []int) {
@ -45,23 +35,15 @@ func part2(prog []int) {
copy(progcpy, prog)
progcpy[1] = n
progcpy[2] = v
for i := 0; i < len(progcpy); i += 4 {
switch progcpy[i] {
case 1:
progcpy[progcpy[i+3]] = add(progcpy[i+1], progcpy[i+2], progcpy)
case 2:
progcpy[progcpy[i+3]] = mult(progcpy[i+1], progcpy[i+2], progcpy)
case 99:
i = len(progcpy)
}
}
return progcpy[0]
p := intcode.NewProgram(progcpy)
p.Run()
return p.GetProgramValueAt(0)
}
target := 19690720
zeroVal := runProg(0, 0, prog)
nDiff := runProg(1, 0, prog) - zeroVal
vDiff := runProg(0, 1, prog) - zeroVal
fmt.Println(((target - zeroVal) / nDiff), ((target%nDiff)-(zeroVal%nDiff))/vDiff)
fmt.Println("Part 2:", ((target - zeroVal) / nDiff), ((target%nDiff)-(zeroVal%nDiff))/vDiff)
}
func slowestPart2(prog []int) {

View File

@ -2,61 +2,66 @@ Advent of Code
--- Day 2: 1202 Program Alarm ---
On the way to your gravity assist around the Moon, your ship computer beeps angrily about a "1202 program alarm".
On the radio, an Elf is already explaining how to handle the situation: "Don't worry, that's perfectly norma--"
The ship computer bursts into flames.
On the way to your gravity assist around the Moon, your ship computer beeps
angrily about a "1202 program alarm". On the radio, an Elf is already
explaining how to handle the situation: "Don't worry, that's perfectly
norma--" The ship computer bursts into flames.
You notify the Elves that the computer's magic smoke seems to have escaped. "That computer ran Intcode programs
like the gravity assist program it was working on; surely there are enough spare parts up there to build a new
You notify the Elves that the computer's magic smoke seems to have escaped.
"That computer ran Intcode programs like the gravity assist program it was
working on; surely there are enough spare parts up there to build a new
Intcode computer!"
An Intcode program is a list of integers separated by commas (like 1,0,0,3,99). To run one, start by looking at
the first integer (called position 0). Here, you will find an opcode - either 1, 2, or 99. The opcode indicates
what to do; for example, 99 means that the program is finished and should immediately halt. Encountering an
unknown opcode means something went wrong.
An Intcode program is a list of integers separated by commas (like
1,0,0,3,99). To run one, start by looking at the first integer (called
position 0). Here, you will find an opcode - either 1, 2, or 99. The opcode
indicates what to do; for example, 99 means that the program is finished and
should immediately halt. Encountering an unknown opcode means something went
wrong.
Opcode 1 adds together numbers read from two positions and stores the result in a third position. The three
integers immediately after the opcode tell you these three positions - the first two indicate the positions from
which you should read the input values, and the third indicates the position at which the output should be stored.
Opcode 1 adds together numbers read from two positions and stores the result
in a third position. The three integers immediately after the opcode tell
you these three positions - the first two indicate the positions from which
you should read the input values, and the third indicates the position at
which the output should be stored.
For example, if your Intcode computer encounters 1,10,20,30, it should read the values at positions 10 and 20, add
those values, and then overwrite the value at position 30 with their sum.
For example, if your Intcode computer encounters 1,10,20,30, it should read
the values at positions 10 and 20, add those values, and then overwrite the
value at position 30 with their sum.
Opcode 2 works exactly like opcode 1, except it multiplies the two inputs instead of adding them. Again, the three
integers after the opcode indicate where the inputs and outputs are, not their values.
Opcode 2 works exactly like opcode 1, except it multiplies the two inputs
instead of adding them. Again, the three integers after the opcode indicate
where the inputs and outputs are, not their values.
Once you're done processing an opcode, move to the next one by stepping forward 4 positions.
Once you're done processing an opcode, move to the next one by stepping
forward 4 positions.
For example, suppose you have the following program:
1,9,10,3,2,3,11,0,99,30,40,50
For the purposes of illustration, here is the same program split into multiple lines:
For the purposes of illustration, here is the same program split into
multiple lines:
1,9,10,3,
2,3,11,0,
99,
30,40,50
1,9,10,3, 2,3,11,0, 99, 30,40,50
The first four integers, 1,9,10,3, are at positions 0, 1, 2, and 3. Together, they represent the first opcode (1,
addition), the positions of the two inputs (9 and 10), and the position of the output (3). To handle this opcode,
you first need to get the values at the input positions: position 9 contains 30, and position 10 contains 40. Add
these numbers together to get 70. Then, store this value at the output position; here, the output position (3) is
at position 3, so it overwrites itself. Afterward, the program looks like this:
The first four integers, 1,9,10,3, are at positions 0, 1, 2, and 3.
Together, they represent the first opcode (1, addition), the positions of
the two inputs (9 and 10), and the position of the output (3). To handle
this opcode, you first need to get the values at the input positions:
position 9 contains 30, and position 10 contains 40. Add these numbers
together to get 70. Then, store this value at the output position; here, the
output position (3) is at position 3, so it overwrites itself. Afterward,
the program looks like this:
1,9,10,70,
2,3,11,0,
99,
30,40,50
1,9,10,70, 2,3,11,0, 99, 30,40,50
Step forward 4 positions to reach the next opcode, 2. This opcode works just like the previous, but it multiplies
instead of adding. The inputs are at positions 3 and 11; these positions contain 70 and 50 respectively.
Step forward 4 positions to reach the next opcode, 2. This opcode works just
like the previous, but it multiplies instead of adding. The inputs are at
positions 3 and 11; these positions contain 70 and 50 respectively.
Multiplying these produces 3500; this is stored at position 0:
3500,9,10,70,
2,3,11,0,
99,
30,40,50
3500,9,10,70, 2,3,11,0, 99, 30,40,50
Stepping forward 4 more positions arrives at opcode 99, halting the program.
@ -67,54 +72,68 @@ Advent of Code
 2,4,4,5,99,0 becomes 2,4,4,5,99,9801 (99 * 99 = 9801).
 1,1,1,4,99,5,6,0,99 becomes 30,1,1,4,2,5,6,0,99.
Once you have a working computer, the first step is to restore the gravity assist program (your puzzle input) to
the "1202 program alarm" state it had just before the last computer caught fire. To do this, before running the
program, replace position 1 with the value 12 and replace position 2 with the value 2. What value is left at
position 0 after the program halts?
Once you have a working computer, the first step is to restore the gravity
assist program (your puzzle input) to the "1202 program alarm" state it had
just before the last computer caught fire. To do this, before running the
program, replace position 1 with the value 12 and replace position 2 with
the value 2. What value is left at position 0 after the program halts?
Your puzzle answer was 4930687.
--- Part Two ---
"Good, the new computer seems to be working correctly! Keep it nearby during this mission - you'll probably use it
again. Real Intcode computers support many more features than your new one, but we'll let you know what they are
"Good, the new computer seems to be working correctly! Keep it nearby during
this mission - you'll probably use it again. Real Intcode computers support
many more features than your new one, but we'll let you know what they are
as you need them."
"However, your current priority should be to complete your gravity assist around the Moon. For this mission to
succeed, we should settle on some terminology for the parts you've already built."
"However, your current priority should be to complete your gravity assist
around the Moon. For this mission to succeed, we should settle on some
terminology for the parts you've already built."
Intcode programs are given as a list of integers; these values are used as the initial state for the computer's
memory. When you run an Intcode program, make sure to start by initializing memory to the program's values. A
position in memory is called an address (for example, the first value in memory is at "address 0").
Intcode programs are given as a list of integers; these values are used as
the initial state for the computer's memory. When you run an Intcode
program, make sure to start by initializing memory to the program's values.
A position in memory is called an address (for example, the first value in
memory is at "address 0").
Opcodes (like 1, 2, or 99) mark the beginning of an instruction. The values used immediately after an opcode, if
any, are called the instruction's parameters. For example, in the instruction 1,2,3,4, 1 is the opcode; 2, 3, and
4 are the parameters. The instruction 99 contains only an opcode and has no parameters.
Opcodes (like 1, 2, or 99) mark the beginning of an instruction. The values
used immediately after an opcode, if any, are called the instruction's
parameters. For example, in the instruction 1,2,3,4, 1 is the opcode; 2, 3,
and 4 are the parameters. The instruction 99 contains only an opcode and has
no parameters.
The address of the current instruction is called the instruction pointer; it starts at 0. After an instruction
finishes, the instruction pointer increases by the number of values in the instruction; until you add more
instructions to the computer, this is always 4 (1 opcode + 3 parameters) for the add and multiply instructions.
(The halt instruction would increase the instruction pointer by 1, but it halts the program instead.)
The address of the current instruction is called the instruction pointer; it
starts at 0. After an instruction finishes, the instruction pointer
increases by the number of values in the instruction; until you add more
instructions to the computer, this is always 4 (1 opcode + 3 parameters) for
the add and multiply instructions. (The halt instruction would increase the
instruction pointer by 1, but it halts the program instead.)
"With terminology out of the way, we're ready to proceed. To complete the gravity assist, you need to determine
what pair of inputs produces the output 19690720."
"With terminology out of the way, we're ready to proceed. To complete the
gravity assist, you need to determine what pair of inputs produces the
output 19690720."
The inputs should still be provided to the program by replacing the values at addresses 1 and 2, just like before.
In this program, the value placed in address 1 is called the noun, and the value placed in address 2 is called the
verb. Each of the two input values will be between 0 and 99, inclusive.
The inputs should still be provided to the program by replacing the values
at addresses 1 and 2, just like before. In this program, the value placed in
address 1 is called the noun, and the value placed in address 2 is called
the verb. Each of the two input values will be between 0 and 99, inclusive.
Once the program has halted, its output is available at address 0, also just like before. Each time you try a pair
of inputs, make sure you first reset the computer's memory to the values in the program (your puzzle input) - in
Once the program has halted, its output is available at address 0, also just
like before. Each time you try a pair of inputs, make sure you first reset
the computer's memory to the values in the program (your puzzle input) - in
other words, don't reuse memory from a previous attempt.
Find the input noun and verb that cause the program to produce the output 19690720. What is 100 * noun + verb?
(For example, if noun=12 and verb=2, the answer would be 1202.)
Find the input noun and verb that cause the program to produce the output
19690720. What is 100 * noun + verb? (For example, if noun=12 and verb=2,
the answer would be 1202.)
Your puzzle answer was 5335.
Both parts of this puzzle are complete! They provide two gold stars: **
At this point, you should return to your Advent calendar and try another puzzle.
At this point, you should return to your Advent calendar and try another
puzzle.
If you still want to see it, you can get your puzzle input.
@ -122,25 +141,18 @@ Advent of Code
References
Visible links
. https://adventofcode.com/
. https://adventofcode.com/2019/about
. https://adventofcode.com/2019/events
. https://adventofcode.com/2019/settings
. https://adventofcode.com/2019/auth/logout
. Advent of Code Supporter
https://adventofcode.com/2019/support
. https://adventofcode.com/2019
. https://adventofcode.com/2019
. https://adventofcode.com/2019/support
. https://adventofcode.com/2019/sponsors
. https://adventofcode.com/2019/leaderboard
. https://adventofcode.com/2019/stats
. https://adventofcode.com/2019/sponsors
. https://www.hq.nasa.gov/alsj/a11/a11.landing.html#1023832
. https://en.wikipedia.org/wiki/Gravity_assist
. https://en.wikipedia.org/wiki/Halt_and_Catch_Fire
. https://en.wikipedia.org/wiki/Magic_smoke
. https://en.wikipedia.org/wiki/Integer
. https://adventofcode.com/2019
. https://adventofcode.com/2019/day/2/input
Visible links . https://adventofcode.com/ .
https://adventofcode.com/2019/about . https://adventofcode.com/2019/events .
https://adventofcode.com/2019/settings .
https://adventofcode.com/2019/auth/logout . Advent of Code Supporter
https://adventofcode.com/2019/support . https://adventofcode.com/2019 .
https://adventofcode.com/2019 . https://adventofcode.com/2019/support .
https://adventofcode.com/2019/sponsors .
https://adventofcode.com/2019/leaderboard .
https://adventofcode.com/2019/stats . https://adventofcode.com/2019/sponsors
. https://www.hq.nasa.gov/alsj/a11/a11.landing.html#1023832 .
https://en.wikipedia.org/wiki/Gravity_assist .
https://en.wikipedia.org/wiki/Halt_and_Catch_Fire .
https://en.wikipedia.org/wiki/Magic_smoke .
https://en.wikipedia.org/wiki/Integer . https://adventofcode.com/2019 .
https://adventofcode.com/2019/day/2/input

View File

@ -1,3 +0,0 @@
module git.bullercodeworks.com/brian/adventofcode/intcode-processor
go 1.13

View File

@ -1,10 +1,28 @@
package intcode
package intcodeprocessor
import "fmt"
import (
"errors"
"fmt"
)
const (
OP_ADD = 1
OP_MLT = 2
OP_EXT = 99
)
const (
RET_ERR = iota - 1
RET_OK
RET_DONE
)
type Program struct {
code []int
ptr int
state int
error error
}
func NewProgram(prog []int) *Program {
@ -14,6 +32,90 @@ func NewProgram(prog []int) *Program {
return p
}
func (p *Program) CodeString() string {
return fmt.Sprintf("%v", p.code)
func (p *Program) State() int {
return p.state
}
func (p *Program) Error() error {
return p.error
}
func (p *Program) Run() int {
for {
p.state = p.Step()
switch p.state {
case RET_ERR:
return RET_ERR
case RET_DONE:
return RET_DONE
}
}
}
func (p *Program) Step() int {
if len(p.code) < p.ptr {
p.error = errors.New("Pointer Exception")
return RET_ERR
}
switch p.readNext() {
case OP_ADD:
p.add(p.readNextThree())
if p.error != nil {
return RET_ERR
}
return RET_OK
case OP_MLT:
p.mult(p.readNextThree())
if p.error != nil {
return RET_ERR
}
return RET_OK
case OP_EXT:
return RET_DONE
}
return RET_ERR
}
func (p *Program) GetProgramValueAt(idx int) int {
return p.code[idx]
}
func (p *Program) SetProgramValueAt(idx, val int) {
p.code[idx] = val
}
func (p *Program) readNext() int {
if len(p.code) <= p.ptr {
p.error = errors.New("Pointer Exception")
}
p.ptr++
return p.code[p.ptr-1]
}
func (p *Program) readNextTwo() (int, int) {
return p.readNext(), p.readNext()
}
func (p *Program) readNextThree() (int, int, int) {
return p.readNext(), p.readNext(), p.readNext()
}
func (p *Program) add(a1, a2, dest int) {
p.code[dest] = p.code[a1] + p.code[a2]
}
func (p *Program) mult(a1, a2, dest int) {
p.code[dest] = p.code[a1] * p.code[a2]
}
func (p Program) String() string {
var ret string
for k := range p.code {
if k == p.ptr {
ret = fmt.Sprintf("%s [%d]", ret, p.code[k])
} else {
ret = fmt.Sprintf("%s %d", ret, p.code[k])
}
}
return ret
}

View File

@ -1,4 +1,4 @@
package intcode
package intcodeprocessor
import (
"fmt"

49
go.mod
View File

@ -1,40 +1,13 @@
module aoc
require (
9fans.net/go v0.0.0-20181112161441-237454027057 // indirect
bitbucket.org/thezeez/advent-of-code-2017 v0.0.0-20171225063809-1918042ef639
bitbucket.org/thezeez/advent-of-code-2018 v0.0.0-20181225065213-533e12eb8451 // indirect
github.com/alecthomas/gometalinter v2.0.11+incompatible // indirect
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
github.com/cosiner/argv v0.0.1 // indirect
github.com/davidrjenni/reftools v0.0.0-20180914123528-654d0ba4f96d // indirect
github.com/derekparker/delve v1.1.0 // indirect
github.com/fatih/gomodifytags v0.0.0-20180914191908-141225bf62b6 // indirect
github.com/fatih/motion v0.0.0-20180408211639-218875ebe238 // indirect
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf // indirect
github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4 // indirect
github.com/jstemmer/gotags v1.4.1 // indirect
github.com/kisielk/errcheck v1.1.0 // indirect
github.com/klauspost/asmfmt v1.2.0 // indirect
github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mdempsky/gocode v0.0.0-20181127203757-525aa8bb282c // indirect
github.com/nicksnyder/go-i18n v1.10.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/peterh/liner v1.1.0 // indirect
github.com/rogpeppe/godef v1.0.0 // indirect
github.com/sirupsen/logrus v1.2.0 // indirect
github.com/spf13/cobra v0.0.3 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stamblerre/gocode v0.0.0-20181204161302-e160f63d4b91 // indirect
github.com/zmb3/gogetdoc v0.0.0-20181208215853-c5ca8f4d4936 // indirect
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
golang.org/x/sys v0.0.0-20181208175041-ad97f365e150 // indirect
golang.org/x/tools v0.0.0-20181207222222-4c874b978acb // indirect
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20180810215634-df19058c872c // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3 // indirect
)
module git.bullercodeworks.com/brian/adventofcode
go 1.13
require (
github.com/fatih/color v1.7.0
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
github.com/go-gl/glfw v0.0.0-20191125211704-12ad95a8df72
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317
)

108
go.sum
View File

@ -1,90 +1,18 @@
9fans.net/go v0.0.0-20150709035532-65b8cf069318/go.mod h1:diCsxrliIURU9xsYtjCp5AbpQKqdhKmf0ujWDUSkfoY=
9fans.net/go v0.0.0-20181112161441-237454027057 h1:OcHlKWkAMJEF1ndWLGxp5dnJQkYM/YImUOvsBoz6h5E=
9fans.net/go v0.0.0-20181112161441-237454027057/go.mod h1:diCsxrliIURU9xsYtjCp5AbpQKqdhKmf0ujWDUSkfoY=
bitbucket.org/thezeez/advent-of-code-2017 v0.0.0-20171225063809-1918042ef639 h1:DsF/Ldc/v0ftwLoE1WFJ1yAAkzK4XJ0Rx6Ww87AWFdo=
bitbucket.org/thezeez/advent-of-code-2017 v0.0.0-20171225063809-1918042ef639/go.mod h1:0hCXmcMGkJQ6c4PhTVJLrbCvsxRpLoq84HQE8u8fFeY=
bitbucket.org/thezeez/advent-of-code-2018 v0.0.0-20181225065213-533e12eb8451 h1:IFdtuKSjoogiNOcVqsANmYqy3jR2+AYdKolN6fDO2rg=
bitbucket.org/thezeez/advent-of-code-2018 v0.0.0-20181225065213-533e12eb8451/go.mod h1:EmAD0MqW6nbmxrTlT7Lvzjv22xm5tcKgu6k0sBIMf6Y=
git.bullercodeworks.com/brian/adventofcode v0.0.0-20191204150234-ed78ac855a6d h1:sVMHqDXdjDdIFlL5jfm5U9swH+lb/B/ZtzM9+XqEzEs=
github.com/alecthomas/gometalinter v2.0.11+incompatible h1:toROE7pXPU/pUB4lh6ICqUKwpDtmkRCyJIr1nYqmKp0=
github.com/alecthomas/gometalinter v2.0.11+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/cosiner/argv v0.0.1 h1:2iAFN+sWPktbZ4tvxm33Ei8VY66FPCxdOxpncUGpAXE=
github.com/cosiner/argv v0.0.1/go.mod h1:p/NrK5tF6ICIly4qwEDsf6VDirFiWWz0FenfYBwJaKQ=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davidrjenni/reftools v0.0.0-20180914123528-654d0ba4f96d h1:aRvyac5PN1NEfcANJ1tfs8GMs5I9OXsVeg0FJkpXOys=
github.com/davidrjenni/reftools v0.0.0-20180914123528-654d0ba4f96d/go.mod h1:8o/GRMvsb9VyFbSEZGXfa0dkSXml4G23W0D/h9FksWM=
github.com/derekparker/delve v1.1.0 h1:icd65nMp7s2HiLz6y/6RCVXBdoED3xxYLwX09EMaRCc=
github.com/derekparker/delve v1.1.0/go.mod h1:pMSZMfp0Nhbm8qdZJkuE/yPGOkLpGXLS1I4poXQpuJU=
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fatih/gomodifytags v0.0.0-20180914191908-141225bf62b6 h1:iXJdM8Uob6EPOG/PFr5q0J124ysiZdJfACHqICBb3b8=
github.com/fatih/gomodifytags v0.0.0-20180914191908-141225bf62b6/go.mod h1:p2/x7bnOQsbq/deXsDIlj2yLiKFGPkD2nuoYqwn8R4Y=
github.com/fatih/motion v0.0.0-20180408211639-218875ebe238 h1:Qo4RxRMFag+fvDqQ6A3MblYBormptQUZ1ssOtV+EeQ8=
github.com/fatih/motion v0.0.0-20180408211639-218875ebe238/go.mod h1:pseIrV+t9A4+po+KJ1LheSnYH8m1qs6WhKx2zFiGi9I=
github.com/fatih/structtag v1.0.0 h1:pTHj65+u3RKWYPSGaU290FpI/dXxTaHdVwVwbcPKmEc=
github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA=
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf h1:7+FW5aGwISbqUtkfmIpZJGRgNFg2ioYPvFaUxdqpDsg=
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE=
github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4 h1:gmIVMdGlVf5e6Yo6+ZklxdOrvtOvyrAjJyXAbmOznyo=
github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw=
github.com/jstemmer/gotags v1.4.1 h1:aWIyXsU3lTDqhsEC49MP85p2cUUWr2ptvdGNqqGA3r4=
github.com/jstemmer/gotags v1.4.1/go.mod h1:b6J3X0bsLbR4C5SgSx3V3KjuWTtmRzcmWPbTkWZ49PA=
github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/asmfmt v1.2.0 h1:zwsyBYgEdabg32alMful/5pRtMTcR5C5w1LKNg9OD78=
github.com/klauspost/asmfmt v1.2.0/go.mod h1:RAoUvqkWr2rUa2I19qKMEVZQe4BVtcHGTMCUOcCU2Lg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91 h1:hunjgdb3b21ZdRmzDPXii0EcnHpjH7uCP+kODoE1JH0=
github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mdempsky/gocode v0.0.0-20181127203757-525aa8bb282c h1:saoWWUaidAuBfvWlcGr+nhXB+MX4DKxGZ6lrux0Cq2M=
github.com/mdempsky/gocode v0.0.0-20181127203757-525aa8bb282c/go.mod h1:hltEC42XzfMNgg0S1v6JTywwra2Mu6F6cLR03debVQ8=
github.com/nicksnyder/go-i18n v1.10.0 h1:5AzlPKvXBH4qBzmZ09Ua9Gipyruv6uApMcrNZdo96+Q=
github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os=
github.com/peterh/liner v1.1.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/godef v1.0.0 h1:+3JM5juQRFS/Vifg5lMHkAtRELpcGicuZXdBmf7NIhE=
github.com/rogpeppe/godef v1.0.0/go.mod h1:FWOCnfqToTbJkUGS32JdUoCuBBjtBQ3ZawrP7InscsM=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stamblerre/gocode v0.0.0-20181204161302-e160f63d4b91 h1:qbbVAmcNQXZK9o2ilqULvg++8kTyHIIm/n8Mq1szYgI=
github.com/stamblerre/gocode v0.0.0-20181204161302-e160f63d4b91/go.mod h1:EM2T8YDoTCvGXbEpFHxarbpv7VE26QD1++Cb1Pbh7Gs=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/zmb3/gogetdoc v0.0.0-20181208215853-c5ca8f4d4936 h1:+We2eeE8UuACEPcT7Ez1/yK0MN6SAqzy6S2JPxJTycQ=
github.com/zmb3/gogetdoc v0.0.0-20181208215853-c5ca8f4d4936/go.mod h1:ofmGw6LrMypycsiWcyug6516EXpIxSbZ+uI9ppGypfY=
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 h1:Pn8fQdvx+z1avAi7fdM2kRYWQNxGlavNDSyzrQg2SsU=
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 h1:x/bBzNauLQAlE3fLku/xy92Y8QwKX5HZymrMz2IiKFc=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181208175041-ad97f365e150 h1:a+Y1JYYfPXfb6xhWlOV++uijPyhhJy5Y/ROUAOZSre4=
golang.org/x/sys v0.0.0-20181208175041-ad97f365e150/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181207195948-8634b1ecd393/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181207222222-4c874b978acb h1:YIXCxYolAiiPmVSqA4gVUVcHo8Mi1ivU7ANnK9a63JY=
golang.org/x/tools v0.0.0-20181207222222-4c874b978acb/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20180810215634-df19058c872c h1:vTxShRUnK60yd8DZU+f95p1zSLj814+5CuEh7NjF2/Y=
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20180810215634-df19058c872c/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3 h1:LyX67rVB0kBUFoROrQfzKwdrYLH1cRzHibxdJW85J1c=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
github.com/go-gl/glfw v0.0.0-20191125211704-12ad95a8df72 h1:LgLYrxDRSVv3kStk6louYTP1ekZ6t7HZY/X05KUyaeM=
github.com/go-gl/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317 h1:hhGN4SFXgXo61Q4Sjj/X9sBjyeSa2kdpaOzCO+8EVQw=
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=