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
void CB1::midpointline(int x0,int y0, int x1, int y1, CDC *pDc)
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
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 one-to-one 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.