Code for Program to Draws polygon in Cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. Test_DRAW_POLYGON.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 VGA16-MODE PIC X(10) VALUE "VGA16".
77 TEXT-MODE PIC X(10) VALUE "TEXT".
77 STATUS-CODE PIC X.
01 house.
02 NB PIC 9(4) COMP VALUE 6.
02 X1 PIC 9(4) COMP VALUE 250.
02 Y1 PIC 9(4) COMP VALUE 300.
02 X2 PIC 9(4) COMP VALUE 250.
02 Y2 PIC 9(4) COMP VALUE 440.
02 X3 PIC 9(4) COMP VALUE 450.
02 Y3 PIC 9(4) COMP VALUE 440.
02 X4 PIC 9(4) COMP VALUE 450.
02 Y4 PIC 9(4) COMP VALUE 300.
02 X5 PIC 9(4) COMP VALUE 350.
02 Y5 PIC 9(4) COMP VALUE 200.
02 X6 PIC 9(4) COMP VALUE 250.
02 Y6 PIC 9(4) COMP VALUE 300.
01 COLOURS.
02 BLACK PIC 9(4) COMP VALUE 0.
02 DARK_BLUE PIC 9(4) COMP VALUE 1.
02 DARK_GREEN PIC 9(4) COMP VALUE 2.
02 DARK_CYAN PIC 9(4) COMP VALUE 3.
02 DARK_RED PIC 9(4) COMP VALUE 4.
02 DARK_MAGENTA PIC 9(4) COMP VALUE 5.
02 BROWN PIC 9(4) COMP VALUE 6.
02 LIGHT_GRAY PIC 9(4) COMP VALUE 7.
02 DARK_GRAY PIC 9(4) COMP VALUE 8.
02 LIGHT_BLUE PIC 9(4) COMP VALUE 9.
02 LIGHT_GREEN PIC 9(4) COMP VALUE 10.
02 LIGHT_CYAN PIC 9(4) COMP VALUE 11.
02 LIGHT_RED PIC 9(4) COMP VALUE 12.
02 LIGHT_MAGENTA PIC 9(4) COMP VALUE 13.
02 YELLOW PIC 9(4) COMP VALUE 14.
02 WHITE PIC 9(4) COMP VALUE 15.
PROCEDURE DIVISION.
MAIN.
CALL "SET_VIDEO_MODE" USING VGA16-MODE STATUS-CODE
IF STATUS-CODE = "Y"
* draw a house
CALL "DRAW_POLYGON" USING BY REFERENCE house, BY REFERENCE WHITE
ACCEPT FOO
CALL "SET_VIDEO_MODE" USING TEXT-MODE STATUS-CODE
END-IF