Simplified instruction pointer delta handling
This commit is contained in:
parent
11dac6494d
commit
270a3845cd
4 changed files with 12 additions and 19 deletions
|
@ -3,16 +3,19 @@ package pointer
|
|||
import "git.adyxax.org/adyxax/gofunge/pkg/field"
|
||||
|
||||
type Pointer struct {
|
||||
x int
|
||||
y int
|
||||
delta *Delta
|
||||
// the position
|
||||
x int
|
||||
y int
|
||||
// The delta
|
||||
dx int
|
||||
dy int
|
||||
// The Storage offset
|
||||
sox int
|
||||
soy int
|
||||
}
|
||||
|
||||
func NewPointer() *Pointer {
|
||||
return &Pointer{delta: NewDelta(1, 0)}
|
||||
return &Pointer{dx: 1}
|
||||
}
|
||||
|
||||
func (p Pointer) Split() *Pointer {
|
||||
|
@ -20,5 +23,5 @@ func (p Pointer) Split() *Pointer {
|
|||
}
|
||||
|
||||
func (p *Pointer) Step(f field.Field) {
|
||||
p.x, p.y = f.Step(p.x, p.y, p.delta.x, p.delta.y)
|
||||
p.x, p.y = f.Step(p.x, p.y, p.dx, p.dy)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue