diff options
author | Julien Dessaux | 2021-09-24 18:16:30 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-24 18:16:30 +0200 |
commit | 28953088077132c15dc9d1f254282bb62bd6f215 (patch) | |
tree | 9791b67d1b9f4f437a39f64e5b2fe7271a7dcb06 /pkg | |
parent | Fixed y command, stack and stack stack manipulation bugs (diff) | |
download | gofunge98-28953088077132c15dc9d1f254282bb62bd6f215.tar.gz gofunge98-28953088077132c15dc9d1f254282bb62bd6f215.tar.bz2 gofunge98-28953088077132c15dc9d1f254282bb62bd6f215.zip |
Fixed line feed handling which should be treated as like newline in Unefunge-98, but it is unclear.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/field/field.go | 3 | ||||
-rw-r--r-- | pkg/pointer/exec.go | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/field/field.go b/pkg/field/field.go index 42ade84..fbe987a 100644 --- a/pkg/field/field.go +++ b/pkg/field/field.go @@ -52,6 +52,9 @@ func Load(fd io.Reader) (*Field, error) { } } else { for i := 0; i < n; i++ { + if data[i] == '' { + continue + } if data[i] == '\n' || data[i] == '\r' { if f.ly == 0 && l.l == 0 { return nil, newDecodeError("No instruction on the first line of the file produces an unusable program in Befunge98") diff --git a/pkg/pointer/exec.go b/pkg/pointer/exec.go index 0590482..61b415f 100644 --- a/pkg/pointer/exec.go +++ b/pkg/pointer/exec.go @@ -296,9 +296,6 @@ func (p *Pointer) eval(c int, f *field.Field) (done bool, returnValue *int) { log.Fatalf("Non implemented instruction code %d : %c", c, c) case 't': log.Fatalf("Non implemented instruction code %d : %c", c, c) - case 12: - // Trifunge function that resets in befunge - p.x, p.y = 0, 0 default: handled = false } |