From fc3d8ccb1f808cab660750fe4a136e7dd384d36b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 12 Feb 2018 05:39:36 +0100 Subject: full words --- core.go | 8 ++++---- core_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core.go b/core.go index df89425..72aab2c 100644 --- a/core.go +++ b/core.go @@ -100,20 +100,20 @@ func (c *Core) readAt(addr uint16) uint16 { func (c *Core) Run() { for { ins := c.Decode() - err := c.Eval(ins) + err := c.Evaluate(ins) if err == ErrStop { return } } } -// Decode instruction +// Decode instruction at current program counter position func (c *Core) Decode() Instruction { return Decode(c.memory[c.pc]) } -// Eval instruction -func (c *Core) Eval(ins Instruction) error { +// Evaluate instruction +func (c *Core) Evaluate(ins Instruction) error { c.pc++ switch v := ins.(type) { case Literal: diff --git a/core_test.go b/core_test.go index e263136..22c4fdb 100644 --- a/core_test.go +++ b/core_test.go @@ -120,7 +120,7 @@ func TestEval(t *testing.T) { t.Run(fmt.Sprint(tc.ins), func(t *testing.T) { state := New(&mocConsole{}) for _, ins := range tc.ins { - state.Eval(ins) + state.Evaluate(ins) } cmp(t, *state, tc.end) }) -- cgit v1.2.3