Now’s a good time to introduce a little documentation to your programming. Words appearing after a % are comments. (It’s just me, but I like to make them all caps.)
Run the following program in Distiller or Preview to make a PDF file, or in Ghostscript to make an image. You’ll see that all the lines end up running through the exact center of the page:
%!PS
0 396 moveto 612 396 lineto % HORIZ LINE HALFWAY UP THE PAGE
306 0 moveto 306 792 lineto % VERTICAL LINE HALFWAY OVER
0 0 moveto 612 792 lineto % DIAGONAL LINE UP
0 792 moveto 612 0 lineto % DIAGONAL LINE DOWN
stroke % PAINT THE CURRENT PATH
showpage % SEND TO OUTPUT
We need stroke to paint the current path. It expects nothing on the stack and doesn’t push anything onto the stack. The showpage command doesn’t expect any arguments either. It finally creates the PDF file or image.