TI-84 + Basic中最快的无限循环是什么? [英] What is the fastest infinite loop in TI-84+ Basic?

查看:174
本文介绍了TI-84 + Basic中最快的无限循环是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于技术上有4种循环类型(for,while,repeat和goto/lbl),使用无限"最快的是哪一种?这是我的意思:

Since there are technically 4 types of loops (for, while, repeat, and goto/lbl), which one is the fastest to use "infinitely"? Here is what I mean:

while 1
End

repeat 0
End

lbl 1
goTo 1

for(n, 1, [number large enough to function as practically infinite]
End

其中哪些是最快的,还是有更快的一个?

Which of these is the fastest, or is there an even faster one?

推荐答案

就大小和速度而言,repeat和while循环最快.

In terms of both size and speed, the repeat and while loops are the fastest.

While 1Repeat 0均为2个字节,而End为1.就空间而言,它们均为4个字节.

While 1 and Repeat 0 are both 2 bytes, while End is 1. In terms of space, they are both 4 bytes.

在速度方面,也是如此.只需尝试编写一个循环到无穷大并对其计时的简单程序即可.

In terms of speed, the same is true. Just try making a simple program that loops to infinity and time it.

TL; DR:While 1: EndRepeat 0: End

这篇关于TI-84 + Basic中最快的无限循环是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆