新位置是否必须为零才能使循环以 Brainf*uck 结束

发布于 2025-01-13 23:00:54 字数 183 浏览 4 评论 0原文

我想知道 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉城メ夜风 2025-01-20 23:00:54

假设你有循环“[>]”。如果第一次执行'['时指针指向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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文