Skip to content

AntonBystedt/COBOL-CHESS

Repository files navigation

COBOL-CHESS

INTRODUCTION:

WELCOME TO MY CHESS PROGRAM IN GNU COBOL! THIS PROGRAM IS AN IMPLEMENTATION OF THE CLASSIC CHESS GAME, WRITTEN IN THE COBOL PROGRAMMING LANGUAGE AND COMPATIBLE WITH THE GNU COBOL COMPILER.

FEATURES:

  • 2-PLAYER MODE ON A SINGLE MACHINE
  • COMMAND LINE INTERFACE FOR MOVING PIECES
  • PIECE MOVEMENT VALIDATION TO ADHERE TO STANDARD CHESS RULES
  • CHECK AND CHECKMATE DETECTION
  • SAVE FUNCTION

REQUIREMENTS:

INSTALLATION

  • DOWNLOAD THE MAIN PROGRAM, SUBMODULES AND COORDINATE FILES FROM THE REPOSITORY.
  • COMPILE THE SUBMODULES AND MAIN PROGRAM
  • SET "RUN IN EXTERNAL TERMINAL" UNDER RUN IN THE PREFERENCES OF THE COBOL IDE
  • RUN THE MAIN PROGRAM

FAQs

  • WHY IS EVERYTHING IN CAPS?

    • BECAUSE IN A MAINFRAME ENVIRONMENT, EVERYTHING IS CAPITALISED. IN THE EARLY DAYS OF COMPUTING, WHEN MAINFRAMES WERE FIRST DEVELOPED, COMPUTER SYSTEMS AND PROGRAMMING LANGUAGES WERE DESIGNED TO USE ONLY UPPERCASE LETTERS. THIS WAS PARTLY DUE TO THE LIMITED STORAGE CAPACITY AND PROCESSING POWER OF EARLY COMPUTERS, WHICH MADE IT MORE EFFICIENT TO USE A SINGLE CASE.

    • AS THE USE OF COMPUTERS BECAME MORE WIDESPREAD, THE CONVENTION OF USING ONLY UPPERCASE LETTERS IN MAINFRAME ENVIRONMENTS WAS ESTABLISHED AS A STANDARD PRACTICE. THIS CONVENTION MADE IT EASIER TO READ AND UNDERSTAND MAINFRAME CODE AND DATA, AS IT ELIMINATED THE NEED TO DISTINGUISH BETWEEN UPPERCASE AND LOWERCASE LETTERS.

  • WHY IS THE KNIGHT NAMED 'WH' AND 'BH'?

    • DUE TO THE NAMING SCHEME OF THIS PROGRAM, THE KNIGHT HAS BEEN RENAMED TO HORSE. THIS IS BECAUSE TWO LETTERS ARE USED TO DENOTE A PIECE. FOR EXAMPLE 'WQ' IS WHITE QUEEN, 'BP' IS BLACK PAWN AND SO ON. THE KINGS ('BK' AND 'WK') WOULD THEREFOR HAVE THE SAME NAMES AS THE KNIGHTS ('BK' AND 'WK'). DUE TO THIS, THE KNIGHT HAS BEEN RENAMED TO HORSE AND HAVE THE VALUES 'BH' AND 'WH'.

GAMEPLAY

YOU WILL BE PROMPTED TO SELECT A CHESS PIECE OR TO SAVE THE GAME. ENTER YOUR DESIRED PIECE AND PRESS ENTER. YOU WILL THEN BE PROMPTED TO SELECT THE POSITION YOU WOULD LIKE TO MOVE THE SELECTED PIECE TO. ENTER THE DESIRED POSITION AND PRESS ENTER. FOR EXAMPLE, TO MOVE A PAWN FROM E2 TO E4, YOU WOULD ENTER E2, ENTER, E4 ENTER. IF YOU WOULD LIKE TO SAVE THE GAME, ENTER S

CONCLUSION

CONSULT THE WIKI FOR MORE INFORMATION COBOL CHESS WIKI
I HOPE YOU ENJOY PLAYING MY CHESS PROGRAM IN GNU COBOL. IF YOU ENCOUNTER ANY BUGS OR HAVE SUGGESTIONS FOR IMPROVEMENTS, PLEASE FEEL FREE TO CREATE AN ISSUE IN THE REPOSITORY.