aboutsummaryrefslogtreecommitdiff
path: root/pkg/field
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-24 01:26:49 +0200
committerJulien Dessaux2021-09-24 01:26:49 +0200
commitda7e7dae2b690308fb7ff3aba34145233c740bce (patch)
treec836da7165fa8ef26f7d7342c08635f0a35b0065 /pkg/field
parentImplemented commands until helloworld works \o/ (diff)
downloadgofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.tar.gz
gofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.tar.bz2
gofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.zip
Made the interpreter pass most of the mycology test suite
Diffstat (limited to 'pkg/field')
-rw-r--r--pkg/field/utils.go4
-rw-r--r--pkg/field/utils_test.go6
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/field/utils.go b/pkg/field/utils.go
index 4c4774c..1bd2b2b 100644
--- a/pkg/field/utils.go
+++ b/pkg/field/utils.go
@@ -96,3 +96,7 @@ func (f *Field) Set(x, y, v int) {
}
}
}
+
+func (f Field) Dump() (int, int, int, int) {
+ return f.x, f.y, f.lx, f.ly
+}
diff --git a/pkg/field/utils_test.go b/pkg/field/utils_test.go
index 9c1f7c7..837f9fb 100644
--- a/pkg/field/utils_test.go
+++ b/pkg/field/utils_test.go
@@ -329,3 +329,9 @@ func TestGetAndSetOnEmptyLines(t *testing.T) {
field.Set(0, -1, 'c')
require.Equal(t, &f, field)
}
+
+func TestDump(t *testing.T) {
+ // nothing to test really
+ f := Field{}
+ f.Dump()
+}