
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=x1x0;
dy=y1y0;
d=dy*2dx;
incrE=dy*2;
incrNE=(dydx)*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 x1x0
Set Delta(y) to y1y0
Set decision to 2*dydx
set Delta(E) to dy*2
set Delta(NE) to 2*(dydx)
set x to equal x0
set y to equal y0
Draw pixel with X and Y values
End functiojn

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..

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 onetoone mapping to actual C++ routines? A waste of time I say.

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.