Loops: Difference between revisions
Mr. MacKenty (talk | contribs) No edit summary |
Mr. MacKenty (talk | contribs) No edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:computation.png|frame|right|This is a basic concept in computer science]] | |||
In computer programming, a loop is a sequence of instructions that is continually repeated until a certain condition is reached or a condition is declared FALSE. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number. If it hasn't, the next instruction in the sequence is an instruction to return to the first instruction in the sequence and repeat the sequence. If the condition has been reached, the next instruction "falls through" to the next sequential instruction or branches outside the loop. A loop is a fundamental programming idea that is commonly used in writing programs. | |||
In computer programming, a loop is a sequence of | |||
An infinite loop is one that lacks a functioning exit routine . The result is that the loop repeats continually until the operating system senses it and terminates the program with an error or until some other event occurs (such as having the program automatically terminate after a certain duration of time) <ref>http://whatis.techtarget.com/definition/loop</ref>. | An infinite loop is one that lacks a functioning exit routine . The result is that the loop repeats continually until the operating system senses it and terminates the program with an error or until some other event occurs (such as having the program automatically terminate after a certain duration of time) <ref>http://whatis.techtarget.com/definition/loop</ref>. | ||
== | == Introduction == | ||
This is one of the better videos I've seen on loops. Content gratefully used with permission : <ref>http://cs50.tv/2015/fall/#license,psets</ref> | This is one of the better videos I've seen on loops. Content gratefully used with permission : <ref>http://cs50.tv/2015/fall/#license,psets</ref>. The video uses programming syntax from the C programming language, but the main ideas are helpful in understanding loops. | ||
Line 20: | Line 14: | ||
</html> | </html> | ||
== A good video == | |||
== | <html> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/l26oaHV7D40" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |||
</html> | |||
* | == Standards == | ||
* Construct algorithms using loops, branching. | |||
== References == | == References == |
Latest revision as of 15:24, 20 March 2019
In computer programming, a loop is a sequence of instructions that is continually repeated until a certain condition is reached or a condition is declared FALSE. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number. If it hasn't, the next instruction in the sequence is an instruction to return to the first instruction in the sequence and repeat the sequence. If the condition has been reached, the next instruction "falls through" to the next sequential instruction or branches outside the loop. A loop is a fundamental programming idea that is commonly used in writing programs.
An infinite loop is one that lacks a functioning exit routine . The result is that the loop repeats continually until the operating system senses it and terminates the program with an error or until some other event occurs (such as having the program automatically terminate after a certain duration of time) [1].
Introduction[edit]
This is one of the better videos I've seen on loops. Content gratefully used with permission : [2]. The video uses programming syntax from the C programming language, but the main ideas are helpful in understanding loops.
A good video[edit]
Standards[edit]
- Construct algorithms using loops, branching.