The algorithms bundle
∗
Rogério Brito
rbrito@ime.usp.br
August 24, 2009
Contents
1 Introduction 1
2 Installation 2
3 Environment: algorithmic 2
3.1 The Simple Statement . 3
3.2 The if-then-else Statement 3
3.3 The for Loop . . . . . . . 4
3.4 The while Loop . . . . . 5
3.5 The repeat-until Loop . . 5
3.6 The Infinite Loop . . . . 6
3.7 The Logical Connectives 6
3.8 The Precondition . . . . 7
3.9 The Postcondition . . . . 7
3.10 Returning Values . . . . 8
3.11 Printing Messages . . . . 8
3.12 Comments . . . . . . . . 9
3.13 An Example . . . . . . . 9
3.14 Options/Customization 10
4 Environment: algorithm 14
4.1 General . . . . . . . . . . 14
4.2 An Example . . . . . . . 14
4.3 Options . . . . . . . . . . 15
4.4 Customization . . . . . . 15
5 References in Algorithms 16
6 Known Issues 17
7 General Hints 18
List of Algorithms
1 Calculate y = x
n
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Calculate y = x
n
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1 Introduction
This package provides two environments, algorithmic and algorithm, which
are designed to be used together but may, depending on the necessities of the
user, be used separately.
∗
This document corresponds to algorithms v0.1, dated 2009/08/24.
1