Friday, November 12, 2010

Repetition

Finally! repetition! the "Introduction to repetition." is actually pretty easy, I understand what Mr.Arkin was teaching and finished 1 of 4 part of the homework for the weekend in class. We took note of some statement of repetition code and some key word that is contains. Some examples would be loop, exit, when.

An example of the statement:

% Display the integers from 0 to 13.

% declaration section

const DELAY := 1500
const COUNTING_LIMIT := 13
var integer : int

% initiation section
integer := 1

% processing and output section

loop
    put integer
    delay (DELAY)
    integer := integer + 1
    exit when integer > COUNTING_LIMIT

end loop

% extro

put skip, "DONE"

2 comments:

  1. Hey Sophia,

    How are your blogs so short, I wish mines were concise -_-''

    ReplyDelete
  2. hehe, can't call my blog concise, but im straight-forward when im writing.( except non_school thingys lol ^_^)

    ReplyDelete