Timeline for Interpret brainfuck
Current License: CC BY-SA 2.5
30 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 25, 2022 at 10:48 | comment | added | xiver77 | It's an old post, but you don't need the parentheses in (a)?b:c. You can write a?b:c. | |
| Feb 18, 2011 at 2:54 | history | edited | snmcdonald | CC BY-SA 2.5 | added 322 characters in body |
| Feb 18, 2011 at 1:45 | comment | added | MtnViewMark | @snmcdonald - comma needs to read from stdin, probably via getchar(). | |
| Feb 17, 2011 at 5:34 | history | edited | snmcdonald | CC BY-SA 2.5 | deleted 36 characters in body |
| Feb 17, 2011 at 5:26 | comment | added | snmcdonald | @MtnViewMark: I have updated the comma operator. I made this a community wiki due to the feedback I was receiving. Please feel free to improve upon this question. | |
| Feb 17, 2011 at 4:39 | history | edited | snmcdonald | CC BY-SA 2.5 | deleted 358 characters in body |
| Feb 17, 2011 at 3:53 | comment | added | MtnViewMark | @snmcdonald: It did compile, and run, but try executing PRIME.BF: You'll notice that your code doesn't implement the comma (,) operation (which reads from standard input). BF programs are interactive and process input. -- As for reading the program, 999 is way too short: PRIME.BF is >4k, and many BF programs are even larger. Finally, the original post was corrected within 10min of posting. | |
| Feb 17, 2011 at 2:34 | comment | added | snmcdonald | @MtnViewMark: As noted the original solution was geared to the original post which did not specify that it was read from a file. I am not certain why it did not compile for you. My solutions all compiled and ran successfully. Perhaps I am using undefined behavior (meta.codegolf.stackexchange.com/questions/21/…). | |
| Feb 17, 2011 at 2:30 | history | edited | snmcdonald | CC BY-SA 2.5 | added 350 characters in body |
| Feb 16, 2011 at 14:51 | history | edited | snmcdonald | CC BY-SA 2.5 | added 397 characters in body |
| Feb 16, 2011 at 14:49 | history | rollback | snmcdonald | Rollback to Revision 7 | |
| Feb 16, 2011 at 14:47 | history | edited | snmcdonald | CC BY-SA 2.5 | deleted 244 characters in body |
| Feb 16, 2011 at 3:03 | comment | added | MtnViewMark | Hate to be a kill-joy, but did any of the up-voters notice that this code doesn't work? Even ignoring that it doesn't read the BF program from a file -- it doesn't implement the , operation correctly at all. | |
| Feb 14, 2011 at 23:43 | comment | added | J B | @snmcdonald Indeed I didn't get here in time to see the initial question. But the current PHP and Python do read from a file. | |
| Feb 14, 2011 at 23:38 | comment | added | snmcdonald | @dark_charlie: nice improvement!!! reducing all the ifs with a single define! | |
| Feb 14, 2011 at 23:36 | comment | added | snmcdonald | @JB The initial question did not specify from a file. This reads from stdin. Also note that the current PHP and Python are read from argv. | |
| Feb 14, 2011 at 22:31 | history | edited | Karel Petranek | CC BY-SA 2.5 | Added a shorter code, tested only on Hello World, hopefully works in general. |
| Feb 14, 2011 at 20:07 | comment | added | J B | I fail to see how the program code is read from a file, as well as how input is performed. | |
| Jan 30, 2011 at 23:47 | history | edited | snmcdonald | CC BY-SA 2.5 | added 3 characters in body |
| Jan 30, 2011 at 22:01 | comment | added | Alexandru | I think you can replace (c==62)?a:b with (c-62)?b:a. | |
| Jan 30, 2011 at 21:06 | history | edited | snmcdonald | CC BY-SA 2.5 | deleted 6 characters in body; added 4 characters in body; Post Made Community Wiki |
| Jan 30, 2011 at 20:56 | comment | added | Alexandru | You can replace break;else by return;. | |
| Jan 30, 2011 at 20:19 | comment | added | snmcdonald | @Alexandru +1: Good point. I have corrected my solution. | |
| Jan 30, 2011 at 20:18 | history | edited | snmcdonald | CC BY-SA 2.5 | deleted 17 characters in body |
| Jan 30, 2011 at 20:10 | comment | added | Alexandru | Yeah. I thought so. You should not check the value at pointer at first enter in the loop, but the value at the current pointer. Check the test in the question. Your program hangs. | |
| Jan 30, 2011 at 20:00 | comment | added | snmcdonald | I pass the pointer to the buffer and the pointer to the stream. It checks at the end of the loop to see if the pointer l in the buffer has reached zero and breaks else it resets the stream back to the original loop [. This is necessary for nested [ loops. | |
| Jan 30, 2011 at 19:56 | history | edited | snmcdonald | CC BY-SA 2.5 | added 202 characters in body |
| Jan 30, 2011 at 19:51 | comment | added | Alexandru | Are you checking the same pointer (l) every time you loop? I think you are supposed to check the current location of the head (p). | |
| Jan 30, 2011 at 19:39 | history | edited | snmcdonald | CC BY-SA 2.5 | added 538 characters in body |
| Jan 30, 2011 at 19:11 | history | answered | snmcdonald | CC BY-SA 2.5 |