This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import random | |
import pygame | |
import argparse | |
from datetime import datetime | |
from pygame.locals import * | |
DIRT, GRASS, WATER, COAL, CLOUD, WOOD = 0, 1, 2, 3, 4, 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import random | |
import pygame | |
import argparse | |
from datetime import datetime | |
from pygame.locals import * | |
DIRT, GRASS, WATER, COAL, CLOUD, WOOD = 0, 1, 2, 3, 4, 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import random | |
import pygame | |
import argparse | |
# get the datetime library | |
from datetime import datetime | |
from pygame.locals import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. FILES. | |
*> create an environment section | |
ENVIRONMENT DIVISION. | |
*> input output is where used files | |
*> will be declared | |
INPUT-OUTPUT SECTION. | |
FILE-CONTROL. | |
*> we will have one file called | |
*> transactions that is sequantially written |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. LOOPS. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 WS-CNT PIC 9(1) VALUE 0. | |
01 WS-A PIC 9 VALUE 0. | |
01 WS-Z PIC 9 VALUE 2. | |
PROCEDURE DIVISION. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*> NOT, negating a conditional | |
MOVE 50 TO NUM1. | |
MOVE 60 TO NUM2. | |
IF NOT NUM2 IS LESS THAN NUM1 THEN | |
DISPLAY NUM2' IS NOT LESS THAN 'NUM1 | |
END-IF | |
*> AND, having multiple conditionals | |
IF NUM1 IS LESS THAN NUM2 AND NUM1 IS LESS THAN 100 THEN | |
DISPLAY 'COMBINED CONDITION' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. STRINGHANDLE. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 WS-CNT1 PIC 9(2) VALUE 0. | |
01 WS-CNT2 PIC 9(2) VALUE 0. | |
01 WS-STRING PIC X(25) VALUE 'ABCDADADADABVDFDFFAF'. | |
01 WS-STRING-DEST PIC A(30). | |
01 WS-STR1 PIC A(15) VALUE 'TUTORIALSPOINT'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. CONDITIONALS. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
*> setting up places to store values | |
*> no values set yet | |
01 NUM1 PIC 9(9). | |
01 NUM2 PIC 9(9). | |
01 NUM3 PIC 9(5). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. VERBS. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
*> numbers we will perform operations on | |
*> with verbs | |
01 NUM1 PIC 9(9) VALUE 10. | |
01 NUM2 PIC 9(9) VALUE 10. | |
01 NUMA PIC 9(9) VALUE 100. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. VARS. | |
DATA DIVISION. | |
*> working storage defines variables | |
WORKING-STORAGE SECTION. | |
*> define a number with a sign, 3 numbers, a decimal, and then | |
*> two numbers aafter the decimal. by default it should be 0 filled | |
01 FIRST-VAR PIC S9(3)V9(2). | |
*> do the same thing as above but actually initialize |