Mayedl10 / BFIL

Brainfuck intermediate language
Do What The F*ck You Want To Public License
4 stars 0 forks source link

[I am stupid]: either `read`, `copy`, or `vout` broken (original title: `vout` currently a destructive action) #1

Closed Mayedl10 closed 7 months ago

Mayedl10 commented 8 months ago
memsize 0x8000
reserve ?0 ~ ?15 # don't forget to reserve! #

alias ?0 as curChar

loads ?1 ~ 8 <~ 1 2 3 4 5 6 7 8

load ?9 <- 32

load curChar <- 1

whileNotZero curChar

    read curChar
    aout 1 curChar
    aout 1 ?9
    vout 1 curChar <~> ?9

endLoop

terminates loop even if curChar is supposed to not be 0

Mayedl10 commented 8 months ago

copy may also be broken but I'm not sure. this works fine

read ?0
vout 1 ?0 ~~ ?1
read ?0
vout 1 ?0 ~~ ?1
read ?0
vout 1 ?0 ~~ ?1

but doing the same with "copy" instead of "vout" doesn't.

maybe it is read's fault?

memsize 0x8000
reserve ?0 ~ ?15 # don't forget to reserve! #

load ?1 ~ 32

read ?0
vout 1 ?0 ~ ?1
read ?0
vout 1 ?0 ~ ?1
read ?0
vout 1 ?0 ~ ?1

this outputs 000 with input as "12\0" when it should output "1 2 " or smth like that

OH MY GOD WHY IS EVERYTHING BROKEN

Mayedl10 commented 7 months ago

I think it may be because of copy

Mayedl10 commented 7 months ago

OH MY GOD I AM STUPID

In the original problem code, I reserved 0-15 but then used these exact cells for data storage soxnaöfdnmaxönjsoöfcamx