新位置是否必须为零才能使循环以 Brainf*uck 结束
我想知道 abt bf 循环然后它变得更加复杂。 当您在指针位置0处打开循环([
)时,然后在循环([>
)中前进(>
) 。新位置是否必须为零才能结束循环? ...因为循环只会在单元格值等于零时运行,
所以对 Brainf*ck 循环如何工作有一点帮助
I was wondering abt bf loops then it just got much more complicated.
when you open the loop([
) at the pointer location 0, then go forward(>
) in the loop([>
). Does the new location have to be zero for the loop to end?
...as the loop will only run then the cell value is equal to zero
so a little help on how brainf*ck loops work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设你有循环“[>]”。如果第一次执行'['时指针指向0,那么循环将被完全跳过,指针不会移动。而如果它指向非零,它将执行循环并将指针向右移动,然后如果该单元格非零,它将再次执行并再次向右移动指针,并且它将继续向右移动指针,直到到达单元格为 0。
Say you have the loop "[>]". If the pointer points to a 0 when the '[' is first executed, then the loop will be skipped entirely and the pointer won't move. Whereas if it points to a nonzero, it will execute the loop and move the pointer right, and then if that cell is nonzero it will execute again and move the pointer right again, and it will keep moving the pointer right until it gets to a cell that's 0.