Fixed line feed handling which should be treated as like newline in Unefunge-98, but it is unclear.

This commit is contained in:
Julien Dessaux 2021-09-24 18:16:30 +02:00
parent b3f1792ffa
commit 2895308807
2 changed files with 3 additions and 3 deletions

View file

@ -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")

View file

@ -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
}