Skip to main content

Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

( an exception value is a property of a push button)  Instead of Display row1, you would display either a push-button or better yet a screen of buttons, the screen is defined in the screen section .. see the calc3.cbl example versus the calculat.cbl example. As far as making your program more intelligent then random. You could make a variety of tic-tac-toe tables in working storage then as the game progesses you compare the current board to your ws-boards. This would be pretty sophisticated for a beginner or medium programmer.


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

01 GameOver          PIC X VALUE 'F'.

      01 Form1-SF-HANDLE usage handle.

      screen section.

      01 Form1, HELP-ID 1.

          03 Form1-PB-OK, Push-Button,

             COL 24.00, LINE 42.00, LINES 2.00 CELLS, SIZE 8.00 CELLS,

             HELP-ID 2, ID IS 1, SELF-ACT, OK-BUTTON,

             TITLE "OK".

          03 Form1-PB-CANCEL, Push-Button,

             COL 34.00, LINE 42.00, LINES 2.00 CELLS, SIZE 8.00 CELLS,

             HELP-ID 3, ID IS 2, SELF-ACT, CANCEL-BUTTON,

             TITLE "Cancel".

          03 Form1-Pb-1, Push-Button,

             COL 5.00, LINE 4.00, LINES 10.00 CELLS, SIZE 14.00 CELLS,

             EXCEPTION-VALUE 1, ID IS 3, SELF-ACT,

             TITLE "1".

          03 Form1-Pb-1a, Push-Button,

             COL 20.50, LINE 4.00, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 2, ID IS 4, SELF-ACT,

             TITLE "2".

          03 Form1-Pb-1b, Push-Button,

             COL 36.00, LINE 4.00, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 3, ID IS 5, SELF-ACT,

             TITLE "3".

          03 Form1-Pb-1c, Push-Button,

             COL 5.00, LINE 15.50, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 4, ID IS 6, SELF-ACT,

             TITLE "4".

          03 Form1-Pb-1d, Push-Button,

             COL 20.50, LINE 15.50, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 5, ID IS 7, SELF-ACT,

             TITLE "5".

          03 Form1-Pb-1e, Push-Button,

             COL 36.00, LINE 15.50, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 6, ID IS 8, SELF-ACT,

             TITLE "6".

          03 Form1-Pb-1f, Push-Button,

             COL 5.00, LINE 27.00, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 7, ID IS 9, SELF-ACT,

             TITLE "7".

          03 Form1-Pb-1g, Push-Button,

             COL 20.50, LINE 27.00, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 8, ID IS 10, SELF-ACT,

             TITLE "8".

          03 Form1-Pb-1h, Push-Button,

             COL 36.00, LINE 27.00, LINES 10.00 CELLS,

             SIZE 14.00 CELLS,

             EXCEPTION-VALUE 9, ID IS 11, SELF-ACT,

             TITLE "9".

      PROCEDURE DIVISION.

DisplayBoard.

         DISPLAY Standard GRAPHICAL WINDOW

                LINES 48.00, SIZE 64.00, CELL HEIGHT 10,

                CELL WIDTH 10, AUTO-MINIMIZE, COLOR IS 65793,                  

                TITLE "Tic Tac Toe", TITLE-BAR, NO WRAP,

                HANDLE IS Form1-SF-HANDLE .

         display form1.

now you have to change your accept to accept form1 and handle exceptions


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

thanks you but i really dont get it this is my first screen

     *{Bench}prg-comment

     * Program1.cbl

     * Program1.cbl is generated from C:\\TicTacToe\\Program1.Psf

     *{Bench}end

      IDENTIFICATION              DIVISION.

     *{Bench}prgid

      PROGRAM-ID. Program1.

      DATE-WRITTEN. Mittwoch, 9. April 2014 12:44:45.

      REMARKS.

     *{Bench}end

      ENVIRONMENT                 DIVISION.

      CONFIGURATION               SECTION.

      SPECIAL-NAMES.

     *{Bench}activex-def

     *{Bench}end

     *{Bench}decimal-point

          DECIMAL-POINT IS COMMA.

     *{Bench}end

      INPUT-OUTPUT                SECTION.

      FILE-CONTROL.

     *{Bench}file-control

     *{Bench}end

      DATA                        DIVISION.

      FILE                        SECTION.

     *{Bench}file

     *{Bench}end

      WORKING-STORAGE             SECTION.

     *{Bench}acu-def

      COPY "acugui.def".

      COPY "acucobol.def".

      COPY "crtvars.def".

      COPY "fonts.def".

      COPY "showmsg.def".

     *{Bench}end

     *{Bench}copy-working

      COPY "Program1.wrk".

     *{Bench}end

      LINKAGE                     SECTION.

     *{Bench}linkage

     *{Bench}end

      SCREEN                      SECTION.

     *{Bench}copy-screen

      COPY "Program1.scr".

     *{Bench}end

     *{Bench}linkpara

      PROCEDURE DIVISION.

     *{Bench}end

     *{Bench}declarative

     *{Bench}end

      Acu-Main-Logic.

     *{Bench}entry-befprg

     *    Before-Program

     *{Bench}end

          PERFORM Acu-Initial-Routine

     * run main screen

     *{Bench}run-mainscr

          PERFORM Acu-Spielabfragr-Routine

     *{Bench}end

          PERFORM Acu-Exit-Rtn

          .

     *{Bench}copy-procedure

      COPY "showmsg.cpy".

      COPY "Program1.prd".

      COPY "Program1.evt".

     *{Bench}end

      REPORT-COMPOSER SECTION.

my first problem is to call the first subroutine which contains the second screecn with the blank board

IDENTIFICATION              DIVISION.

     *{Bench}prgid

      PROGRAM-ID. spieler-vs-spieler.

      DATE-WRITTEN. Mittwoch, 9. April 2014 12:48:03.

      REMARKS.

     *{Bench}end

      ENVIRONMENT                 DIVISION.

      CONFIGURATION               SECTION.

      SPECIAL-NAMES.

     *{Bench}activex-def

     *{Bench}end

     *{Bench}decimal-point

          DECIMAL-POINT IS COMMA.

     *{Bench}end

      INPUT-OUTPUT                SECTION.

      FILE-CONTROL.

     *{Bench}file-control

     *{Bench}end

      DATA                        DIVISION.

      FILE                        SECTION.

     *{Bench}file

     *{Bench}end

      WORKING-STORAGE             SECTION.

     *{Bench}acu-def

      COPY "acugui.def".

      COPY "acucobol.def".

      COPY "crtvars.def".

      COPY "fonts.def".

      COPY "showmsg.def".

     *{Bench}end

     *{Bench}copy-working

      COPY "spieler-vs-spieler.wrk".

     *{Bench}end

      LINKAGE                     SECTION.

     *{Bench}linkage

     *{Bench}end

      SCREEN                      SECTION.

     *{Bench}copy-screen

      COPY "spieler-vs-spieler.scr".

     *{Bench}end

     *{Bench}linkpara

      PROCEDURE DIVISION.

     *{Bench}end

     *{Bench}declarative

     *{Bench}end

      Acu-Main-Logic.

     *{Bench}entry-befprg

     *    Before-Program

     *{Bench}end

          PERFORM Acu-Initial-Routine

     * run main screen

     *{Bench}run-mainscr

          PERFORM Acu-Spieler-vsSpieler-Routine

     *{Bench}end

          PERFORM Acu-Exit-Rtn

          .

     *{Bench}copy-procedure

      COPY "showmsg.cpy".

      COPY "spieler-vs-spieler.prd".

      COPY "spieler-vs-spieler.evt".

     *{Bench}end

      REPORT-COMPOSER SECTION.

later there should be the code for the game but so far i just want that after the click on button SpielervsSpieler should open the subroutin and the window.

could you please tell me how i know that i have to fix the button handler but i dont know where. this are the clb after layouting the screen in the screen modus. do i have to change the clb or which file do i have to change


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

Program1.txt

I have attached a single proogram made in AcuBench with a single push-button that has an exception value and when pressed, the push button title changes. I hope this helps.


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

In AcuBench, draw a screen, draw a push button, assign an exception value (22 or 5 or some number) to the push button - this is part of the property window when you drew the push button. In the screen designer double click on your push button. You are now in the editor where you place your logic for your program or in this case the locis that you want to occur for the push button.In this case type in: modify form1-pb-1 title "my new title". generate compile and execute. You now have a program that responds to an exception value.


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

thank you for your help it works. The push button changes after clicked. now i dont know how to switch the player is the old switchplayer methode working and where do i have to place it in the clb? or do i have to get a counter to change by every uneven number the player. we first start at 1 ist uneven so it has to be player x then the counter add 1 so its an even number an the player has to be o?


Hey,

I startet learning cobol and get some problems withhin. To get in touch with the new language i wanted to run a sourcecode from the internet just to get a plan how cobol works. Now to the problem i got the code from a simple tictactoe game copied into the acubench but it doesnt work there are so many errors. did anyone of you could send me a working sourcecode from tictactoe for acubench.

do i have to get a counter to change by every uneven number the player. we first start at 1 ist uneven so it has to be player x then the counter add 1 so its an even number an the player has to be o? That would work. You could also start your session with all push buttons blank and disabled and add a control (radio button or drop-down) where the player chooses whether they want  to be X or O and once selected the push-buttons are enabled and when they select you place their selection - an X or an O.