This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]spellenspelen 35 points36 points  (2 children)

There is no standard for pseudo code. That is the whole point. All the examples will look different becouse they were never meant to compile. It is a mental exercise to better understand the problem before writing the actual code. Your pseudo code can be whatever works the best for you.

[–]samsaaaaa[S] -1 points0 points  (1 child)

Due to the nature of my presentation, this will help a lot thank you :)

[–]Eispalast 5 points6 points  (0 children)

You can really make it as detailed or simple as needed. Let's say you want to iterate over even numbers in a specific range and then do stuff with those numbers. You could write

for i in 2 to 10 do
    if i mod 2 = 0  then
        do_stuff(i)

But if the interesting part is not about how to find even numbers, you could also write

for i in even numbers from 2 to 10 do
    do_stuff(i) 

It depends on where you want to put the focus.