-
Notifications
You must be signed in to change notification settings - Fork 25
/
65472.cbl
41 lines (36 loc) · 1.08 KB
/
65472.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
IDENTIFICATION DIVISION.
PROGRAM-ID. TONG-JI-65472.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-JI-TABLE.
05 WS-JI-A OCCURS 5 TIMES INDEXED BY I.
10 WS-JI-B PIC 9.
01 WS-LINE-BUF PIC A(40).
01 WS-LINE-TMP PIC A(40).
01 WS-C PIC A(4).
01 WS-N PIC 9.
01 WS-IR PIC 9.
01 WS-IQ PIC 9.
PROCEDURE DIVISION.
MOVE "65472" TO WS-JI-TABLE.
PERFORM DISPLAY-LINE-PARA VARYING I FROM 1 BY 1 UNTIL I>5.
STOP-RUN.
DISPLAY-LINE-PARA.
DIVIDE I BY 2 GIVING WS-IR REMAINDER WS-IQ.
IF WS-IQ IS NOT EQUAL TO 0 THEN
MOVE "🟥" TO WS-C
ELSE
MOVE "🟦" TO WS-C
END-IF.
MOVE " " TO WS-LINE-BUF.
MOVE WS-JI-B(I) TO WS-N.
PERFORM MAKE-LINE-PARA WS-N TIMES.
DISPLAY WS-LINE-BUF.
MAKE-LINE-PARA.
MOVE " " TO WS-LINE-TMP.
STRING WS-C DELIMITED BY SPACE
WS-LINE-BUF DELIMITED BY SPACE
INTO WS-LINE-TMP
ON OVERFLOW DISPLAY "OH FUCK"
END-STRING.
MOVE WS-LINE-TMP TO WS-LINE-BUF.