Reputation: 5075
First of all, sorry for this stupid question. But I really need to know about the languages which are used to show execution flow of program in computer science books.
Example:
1 A = 4
2 t1 = A * B
3 L1: t2 = t1 / C
4 if t2 < W goto L2
5 M = t1 * k
6 t3 = M + I
7 L2: H = I
8 M = t3 - H
9 if t3 ≥ 0 goto L3
10 goto L1
11 L3: halt
Does this language have some specific standers? Is this a pseudo code or an intermediate form of code?
Upvotes: 0
Views: 1596
Reputation: 223
There are no technical rules for Pseudocode, unless you are attempting to conform to standards/syntax for a particular language.
Pseudocode is meant to be human readable and still convey the flow and meaning of the code.
Books that use Pseudocode typically conform to a Java, C, or Pascal-type (among others) structure to make the code easy to read for those familiar with the languages.
The naming conventions that I have seen in the past usually lean toward C or Java-esque naming conventions.
You can find more information here: http://en.wikipedia.org/wiki/Pseudocode
Upvotes: 2
Reputation: 41474
The purpose of pseudocode is to describe an algorithm in a manner which is readable and unambiguous. (Different authors place different amount of emphasis on those two goals, which are frequently in opposition.)
Pseudocode does not need to look like english (or another spoken/written language), nor does it need to look like a real programming language. Ideally its constructs should be familiar to programmers of many different languages.
That pseudocode fills that requirement fairly well... I don't see anything in it which I can't readily understand the effect of.
Upvotes: 1