pseudocode for functions

• 04-16-2011
bos1234
pseudocode for functions
What is the standard or convention for functions in speducode

For example I have this. Would I specifically declare the variables as is? My attempt is below

Code:

```void CB1::midpointline(int x0,int y0, int x1, int y1, CDC *pDc)        {         int dx,dy,incrE,incrNE,d,x,y;         dx=x1-x0;         dy=y1-y0;         d=dy*2-dx;         incrE=dy*2;         incrNE=(dy-dx)*2;         x=x0;         y=y0; }```
Code:

```Create function mindpointline(StartPoint x0 , StartPoint y0 , EndPoint x1 , EndPoint y1 , Pointer to Device Context)   Set Delta(X) to x1-x0   Set Delta(y) to y1-y0   Set decision to 2*dy-dx   set Delta(E) to dy*2   set Delta(NE) to 2*(dy-dx)   set x to equal x0   set y to equal y0   Draw pixel with X and Y values End functiojn```
• 04-16-2011
manasij7479
There is no convention when it comes to pseudo code...[afaik]..
Are you speaking about functional programming?..which looks similar but has strict syntax rules..
• 04-17-2011
Mozza314
Personally, I don't bother with pseudocode. If you want to write something concrete that makes sense, that's what the language itself is for. I can see some potential for merit for roughly sketching out bigger ideas, but an almost one-to-one mapping to actual C++ routines? A waste of time I say.
• 04-17-2011
grumpy
The whole point of pseudocode is that it is written to convey basic understanding of (say) an algorithm for a human. It is not real code (hence the pseudo in its name) because it is not precise enough to be used as instructions for a computer (or as input for a compiler).

Humans are pretty flexible in what they can read and write, so there are almost as many styles of pseudocode as there are people who use it.