Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

If I flip the order of operations in @Sebungifto's code, the execution will fail.

+[,.]

The execution should stop when there is a read operation but no more input exists.  

There should be no any judgements to the execution position of the source code. And zero should not be inputed as a fallback.

Not sure I agree with that. I think reading a null character is a valid operation and terminating execution there would be too limiting. Many of the other challenges depend on you being able to read the input until it's completed, i.e. until a null character is read and breaks you out of the loop, allowing you to perform further operations on the read values. You wouldn't be able to do that if the program stopped there or the cell wasn't changed, which would trap you in an infinite loop that keeps on printing the last read character.

I suppose I could allow the result even with an additional null character printed, but making special allowances doesn't seem in the spirit of the challenge. It's to print that exact string, not that string plus null, so in this case and with the way my interpreter works, I wouldn't consider yours a valid solution since it produces output that is not exactly equal. Other interpreters might handle this differently, but this makes the most sense to me for mine.

I agree with you if you are writing an command line interpretor for brainfuck. But this is a game.

Maybe I am taking the game "Human Resource Machine" into consideration. That's weird when I produced an output as expected but the game did not finished.

(1 edit)

Well, it's an educational game ;) but you make a valid point, visually the problem isn't clear, the outputs look the same except for the pointer being one cell further down, which probably doesn't read like it should be an issue. So what I guess I can do is visualize the null character in the output, then at least it should be clearer what's happened and what needs fixing.

ETA: And that's done. Looks much better and clearer, thanks!