home *** CD-ROM | disk | FTP | other *** search
- Identification Division .
- Program-Id . TXTRIS .
- Author. (c) TOOLBOX & H.-G. Schima .
- Sollte eigentlich auf jeden COBOL-Compiler
- umsetzbar sein.
- Data Division .
- Working-Storage Section .
- *Tabellen
- 01 c-screenzeile occurs 24 times .
- 05 c-screen pic x occurs 38 times .
- 01 varteile .
- 05 teile occurs 7 times .
- 10 teilev occurs 4 times .
- 15 teilreihe occurs 4 times .
- 20 teilelement pic x occurs 8 times .
- *Immer zuerst einen Bereich definieren, und mit Werten vorbelegen
- *Anschliessen die Tabelle ueber diesen Bereich legen.
- 01 d-teily1-offset .
- 05 filler1 pic 9 value 2 .
- 05 filler2 pic 9 value 2 .
- 05 filler3 pic 9 value 1 .
- 05 filler4 pic 9 value 1 .
- 05 filler5 pic 9 value 1 .
- 05 filler6 pic 9 value 1 .
- 05 filler7 pic 9 value 2 .
- 01 teily1-offset redefines d-teily1-offset
- pic 9 occurs 7 times .
- *Alter Cobol Trick, Tabellen lassen sich nicht mit Werten direkt
- *vorbelegen
- 01 d-teile-zeichen .
- 05 filler8 pic x(7) value "X@$#[]*" .
- 01 teile-zeichen redefines d-teile-zeichen
- pic x(1) occurs 7 times .
- *Alter Cobol Trick, Tabellen lassen sich nicht mit Werten direkt
- *vorbelegen
- 01 teil .
- 05 filler occurs 4 .
- 10 ateilelement pic x occurs 8 times .
- 01 teil2 .
- 05 filler occurs 4 .
- 10 ateil2element pic x occurs 8 times .
- 01 tastentyp pic x(1) .
- *Konstanten
- 01 empty pic x(1) value space .
- 01 reihen-pro-level pic 99 value 10 .
- 01 min-verzoegerung pic 9 value 4 .
- 01 Step-verzoegerung pic 9 value 7 .
- 01 info-x pic 99 value 64 .
- 01 emptyline pic x(38) value
- "|| ||" .
- 01 anz-teile pic 9 value 7 .
- 01 teilx1-start pic 99 comp value 16 .
- 01 teily1-start pic 99 comp value 1 .
- 01 maxx pic 99 comp value 38 .
- 01 maxy pic 99 comp value 23 .
- *Variablen zum Programmablauf
- 01 pc-faktor pic 9(5) comp value 0 .
- 01 rand-seed pic 9(3)v9(15) comp .
- 01 zufall pic 9(3)v9(15) comp .
- 01 zufallszahl pic 99 comp .
- 01 uebernaechstes pic 99 comp .
- 01 teilnr pic 99 comp .
- 01 teilphase pic 9 .
- 01 teilphase2 pic 9 .
- 01 teil-zeichen pic x .
- 01 teilx1 pic 9(4) comp .
- 01 teily1 pic 9(4) comp .
- 01 xx pic 9(4) comp .
- 01 yy pic 9(4) comp .
- 01 nn pic 9(4) comp .
- 01 xcoord pic 99 comp .
- 01 ycoord pic 99 comp .
- 01 taste-zaehler pic 9(9) comp .
- 01 game-over pic 9 value 0 .
- 01 senken-ok pic 9 value 0 .
- 01 again pic 9 value 1 .
- 01 move-ok pic 9 value 1 .
- 01 element-gefunden pic 9 value 1 .
- 01 line-full pic 9 value 0 .
- 01 rotieren-ok pic 9 value 1 .
- 01 taste pic x value low-value .
- 01 zeichen pic xx .
- 01 score pic 9(9) comp value 0.
- 01 level pic 9 .
- 01 levelneu pic 9 .
- 01 zeilen-zaehler pic 9(4) comp .
- 01 level-zaehler pic 9(4) comp .
- 01 nochmal-taste pic x .
- 01 waitkey pic 9(2) comp-x .
- 01 links pic x value "1" .
- 01 rechts pic x value "2" .
- 01 rotieren pic x value "3" .
- 01 fallen pic x value "4" .
- 01 abbruch pic x value "9" .
- 01 leer pic x value low-values .
- 01 getastet pic x .
- 01 zwischenwert pic v9(18) .
- 01 anzeigezeile pic 99 .
- 01 anzeigeposition pic 99 .
- 01 anzeigeteil pic X .
- 01 positionierung .
- 05 row-number pic 9(2) comp-x .
- 05 col-number pic 9(2) comp-x .
- 01 cls-character pic x value " " .
- 01 cls-attribute pic x value X"07" .
- 01 dummywert1 pic 9(9) comp .
- 01 dummywert2 pic 9(9) comp .
- 01 pruefzeile pic 9(2) comp .
- 01 maxpruefzeile pic 9(2) value 23 .
- 01 zeit .
- 05 stunde pic 99 .
- 05 minute pic 99 .
- 05 sekunde pic 99 .
- 05 s100 pic 99 .
- *Ersatz fuer Logische Variablen
- 01 JA pic 9 value 1 .
- 01 NEIN pic 9 value 0 .
- *
- ******************************************************************
- *Das Programm beginnt immer mit der Procedure Division. Inner-
- *halb dieser Division wird mit dem ersten Befehl begonnen. Die
- *Steuerung des Programms wurde aus dem Pascal Programm von hinten
- *nach vorne verlegt. Ein Chauffeur sitzt schliesslich auch vorne
- *im Auto und hat vor sich nur den Motor (die Variablen) .
- *
- PROCEDURE DIVISION .
- Action Section .
- Haupt .
- perform initialisieren-fallteile .
- perform ask-defaults .
- perform cursoroff .
- perform starte-zufall .
- perform with test after until again = nein
- perform init-spiel
- perform spiel
- perform end-abfrage
- end-perform
- perform ende .
- cursoroff .
- *In diesem Paragraphen wird der sichtbare Cursor ausgeschaltet
- *da das aber nicht bei allen Systemen geht, wird auch hier
- *dieser Paragraph auf DUMMY gesetzt also hat er keine Funktion
- *Sie können diesen Paragraphen aber so erweitern, das der Cursor
- *ausgeschaltet wird. Dies sollte dann aber in einem Unterprogramm
- *geschehen
- EXIT .
- cursoron .
- *In diesem Paragraphen wird der sichtbare Cursor angeschaltet
- *da das aber nicht bei allen Systemen geht, wird auch hier
- *dieser Paragraph auf DUMMY gesetzt also hat er keine Funktion
- *Sie können diesen Paragraphen aber so erweitern, das der Cursor
- *angeschaltet wird. Dies sollte dann aber in einem Unterprogramm
- *geschehen
- EXIT .
- hole-taste .
- *Da COBOL Standardmaessig keine INKEY-Funktion besitzt
- *wird hier eine Routine genutzt, die mit dem COBOL-Compiler
- *geliefert wurde. Diese Routine setzt die die Variable waitkey
- *auf 0 wenn keine Taste gedrueckt wurde, andernfalls auf 1
- move 0 to waitkey .
- call "CBL_GET_KBD_STATUS" using waitkey .
- if waitkey = 1
- call "CBL_READ_KBD_CHAR" using getastet
- evaluate getastet
- when "7"
- move links to taste
- when "9"
- move rechts to taste
- when "8"
- move rotieren to taste
- when " "
- move fallen to taste
- when X"1B"
- move abbruch to taste
- when any
- move leer to taste
- end-evaluate
- else
- move leer to taste .
- clear-screen .
- *Loeschen des ganzen Bildschirm
- *Fuer MS-COBOL 4.0
- * call "CBL_CLEAR_SCR" using cls-character
- * cls-attribute .
- *Fuer andere Cobol-Compiler. High-Value deshalb weil
- *der MS-COBOL-Compiler leider Probleme mit dem SPACE hat
- *Dies ist zwar ein bischen langwierig, aber dafuer um so
- *sicherer. Übrigens: High-Value ist Hex "FF" manche Compiler
- *deuten High-Value als Hex "7F" dafür schlagen Sie bitte in
- *den Handbüchern des Compilers nach.
- perform varying yy from 1 by 1 until yy > 24
- perform varying xx from 1 by 1 until xx > 80
- display high-values at line yy
- column xx
- end-perform
- end-perform .
- Zeichne-spielfeld .
- *Aufbau des Spielfelds. Wenn man in diesem Programm mit Farben
- *arbeiten moechte kann man jede Display-Anweisung auch noch mit
- *Farbopitionen ausstatten. Als Beispiel stehen hier die Kommentar-
- *zeilen
- *
- perform clear-screen .
- *
- *Der Bereich wo die Steine fallen
- *Eigentlich fallen die Steine in einer Tabelle
- *
- perform varying xx from 1 by 1 until xx > 23
- move emptyline to c-screenzeile (xx)
- end-perform
- move "++==================================++"
- to c-screenzeile (24)
- perform varying xx from 1 by 1 until xx > 23
- display emptyline at line xx column 1
- * with foreground-color 7
- * background-color is 0
- end-perform
- *
- *Das Spielfeld ist jetzt in der linken Schirmhälfte aufgebaut.
- *Jetzt wird auf der rechten Schirmhälfte eine Maske aufgebaut,
- *in welcher der Level, die vollen Reihen und die Punktzahl an-
- *gezeigt werden.
- *
- display
- "++==================================++"
- at line 24 column 1
- * with foreground-color 0
- * background-color is 2
- display "TTTTT X X TTTTT RRRR III SSSS"
- at line 1 column 42
- * with foreground-color 0
- * background-color is 2
- display
- " T X X T R R I S "
- at line 2 column 42
- * with foreground-color 0
- * background-color is 2
- display
- " T X ___ T RRRR I SSS "
- at line 3 column 42
- * with foreground-color 0
- * background-color is 2
- display
- " T X X T R R I S"
- at line 4 column 42
- * with foreground-color 0
- * background-color is 2
- display
- " T X X T R R I SSSS "
- at line 5 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "-------------------------------------"
- at line 6 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| Das 'unmoegliche' Spiel in COBOL |"
- at line 7 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| (C) 1991 Toolbox & H.-G. Schima |"
- at line 8 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 9 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| Punkte : |"
- at line 10 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 11 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| Level : |"
- at line 12 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 13 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| Reihen : |"
- at line 14 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 15 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| Naechstes Teil : |"
- at line 16 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| |"
- at line 17 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| |"
- at line 18 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| |"
- at line 19 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 20 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| B E D I E N U N G : |"
- at line 21 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| <7> Links <9> Rechts |"
- at line 22 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "| <8> Drehen <SPACE> Drop |"
- at line 23 column 42
- * with foreground-color 0
- * background-color is 2
- display
- "+-----------------------------------+"
- at line 24 column 42 .
- * with foreground-color 0
- * background-color is 2 .
- hole-zufall .
- *Im COBOL-Standard gibt es keine Zufallszahlen, da dies eine
- *kaufmännische Sprache ist, und ein Kaufmann nichts zufälliges
- *braucht.
- perform starte-zufall .
- compute zwischenwert = rand-seed * 997
- compute zufallszahl rounded = (zwischenwert * anz-teile) .
- *Um sicher zu sein, das die Zufallszahl zwischen 1 und 7 liegt
- *wird hier noch eine Überprüfung angehängt.
- if zufallszahl < 1
- move 1 to zufallszahl
- end-if .
- if zufallszahl > 7
- move 7 to zufallszahl
- end-if .
- starte-zufall .
- accept zeit from time .
- compute rand-seed = 1 / (s100 + 13) .
- init-spiel .
- perform hole-zufall .
- move zufallszahl to uebernaechstes
- *Zu Beginn des Spiels hat man natürlich noch keine Punkte usw.
- move 0 to score .
- move 0 to zeilen-zaehler
- compute level-zaehler =
- (Min-verzoegerung + (9 - level) * step-verzoegerung)
- * pc-faktor .
- perform zeichne-spielfeld .
- display level at line 12 column info-x .
- ziehe-teil .
- *Aus der großen Kiste wird der Stein gezogen, der als nächster
- *fallen soll. Dieser Stein wird auch sofort angezeigt.
- perform hole-zufall
- move uebernaechstes to teilnr
- move zufallszahl to uebernaechstes
- move 1 to yy
- perform until yy > 4
- move 1 to xx
- perform until xx > 8
- add 15, yy giving anzeigezeile
- add 64, xx giving anzeigeposition
- if teilelement(uebernaechstes,1,yy,xx) not = empty
- move teilelement(uebernaechstes,1,yy,xx)
- to anzeigeteil
- else
- move space to anzeigeteil
- end-if
- display anzeigeteil at line anzeigezeile
- column anzeigeposition
- add 1 to xx
- end-perform
- add 1 to yy
- end-perform .
- *Fest steht immer, daß das Teil in der 1. Form auf dem Spielfeld
- *erscheinen soll.
- move 1 to teilphase
- move teilev(teilnr, teilphase) to teil .
- move teilx1-start to teilx1 .
- *Auf welcher Zeile des Spielfelds der Stein erscheinen soll, wird
- *errechnet. Beim Berechnen der Zeile gibt es zwei Wege. Es sind
- *beide Rechenwege beschrieben. Einer allerdings nur als Kommentar.
- compute teily1 =
- teily1-start - (teily1-offset (teilnr) * -1) .
- * move teily1-start to teily1 .
- * subtract teily1-offset (teilnr) from teily1 .
- move teile-zeichen(teilnr) to teil-zeichen .
- *Überprüfung, ob an der Stelle, wo der Stein erscheinen soll schon
- *etwas ist. Sollte das der Fall sein, wird das Spiel beendet.
- move 1 to yy
- perform until yy > 4
- move 1 to xx
- perform until xx > 8
- or game-over = ja
- if ateilelement (yy,xx) not = " "
- if (teily1 + yy) > 1
- add teily1, yy, -1 giving dummywert1
- add teilx1, xx giving dummywert2
- if c-screen (dummywert1,dummywert2) not = " "
- move ja to game-over
- end-if
- end-if
- end-if
- add 2 to xx
- end-perform
- add 1 to yy
- end-perform .
- zeichne-element .
- *Jedes Element des Steins ist immer 2 Zeichen lang. Die Position
- *des Elements auf dem Spielfeld wird immer errechnet
- add teilx1, xx giving xcoord
- add teily1, yy, -1 giving ycoord
- if ycoord > 0
- display zeichen at line ycoord
- column xcoord
- end-if .
- zeichne-teil .
- *Jedes Teil wird Zeilenweise in seine Elemente zerlegt, die immer
- *2 Zeichen lang sind.
- move 1 to yy .
- perform until yy > 4
- move 1 to xx
- perform until xx > 8
- if ateilelement (yy, xx) not = " "
- *Für neue COBOL-Freunde in Klammern wird die Position genannt
- *auf die das teil-zeichen gesetzt wird und die Länge
- *Format (POSITION:LÄNGE)
- move teil-zeichen to zeichen (1:1)
- move teil-zeichen to zeichen (2:1)
- perform zeichne-element
- end-if
- add 2 to xx
- end-perform
- add 1 to yy
- end-perform .
- loesche-teil .
- *Wenn das Teil gedreht oder verschoben wurde, muss es erst einmal
- *geloescht werden, bevor man es wieder anzeigen kann. Dies ver-
- *hindert ein Chaos auf dem Bildschirm. Auch hier wurde wieder mit
- *High-Values gearbeitet.
- move 1 to yy .
- perform until yy > 4
- move 1 to xx
- perform until xx > 8
- if ateilelement (yy, xx) not = " "
- move high-values to zeichen
- perform zeichne-element
- end-if
- add 2 to xx
- end-perform
- add 1 to yy
- end-perform .
- senke-teil .
- *Beim Senken eines Teils, wird immer erst überprüft, ob überhaupt
- *gesenkt werden kann
- move ja to senken-ok .
- move 1 to xx .
- perform with test after until xx > 8
- move 4 to yy
- perform until yy < 1
- if ateilelement (yy,xx) not = " "
- add teily1, yy giving dummywert1
- add teilx1, xx giving dummywert2
- if c-screen (dummywert1,dummywert2) not = " "
- move nein to senken-ok
- end-if
- end-if
- subtract 1 from yy
- end-perform
- add 1 to xx
- end-perform .
- if senken-ok = ja
- *Unter dem Teil ist alles in Ordnung und es wird abgesenkt. Und
- *zwar in der Darstellung wie bisher
- perform loesche-teil
- add 1 to teily1
- perform zeichne-teil
- else
- *Irgend etwas ist unter dem Teil und jetzt geht's los
- * 1. Das Teil wird noch einmal angezeigt auf der bisherigen
- * Position
- * 2. Dafür, daß das Teil unten angekommen ist, gibt es Punkte
- * 3. Wenn die Zeile in der das Teil endet voll ist gibt es
- * eine Punkt mehr bei den Zeilen (Länderpunkt (Tutti-Frutti))
- * 4. Die volle Zeile wird geloescht, und der Bildschirm korrigiert
- * 5. Ein neuer Stein wird aus dem Hut gezogen
- *
- * 1.
- move 1 to xx
- perform with test after until xx > 8
- move 1 to yy
- perform until yy > 4
- if ateilelement (yy,xx) not = " "
- add teily1, yy, -1 giving dummywert1
- add teilx1, xx giving dummywert2
- move teil-zeichen
- to c-screen (dummywert1,dummywert2)
- add 1 to dummywert2
- move teil-zeichen
- to c-screen (dummywert1,dummywert2)
- end-if
- add 1 to yy
- end-perform
- add 2 to xx
- end-perform
- *2.
- add level to score
- display score at line 10 column info-x
- add maxy, 1 giving yy
- perform until yy < 2
- subtract 1 from yy
- move ja to line-full
- move 3 to xx
- perform until xx > (maxx - 2)
- if c-screen (yy,xx) = " "
- move nein to line-full
- end-if
- add 1 to xx
- end-perform
- if line-full = ja
- *3.
- *Wer moechte kann an dieser Stelle einen Gong einbauen
- * display X"07"
- *Wenn allerdings der Chef kommt macht Ihn dieses Gepiepse
- *sicherlich stutzig.
- add 1 to zeilen-zaehler
- display zeilen-zaehler at line 14
- column info-x
- compute levelneu =
- zeilen-zaehler / reihen-pro-level + 1
- if levelneu > 9
- move 9 to levelneu
- end-if
- if levelneu > level
- move levelneu to level
- compute level-zaehler =
- (Min-verzoegerung + (9 - level)
- * step-verzoegerung) * pc-faktor
- display level at line 12 column info-x
- end-if
- add yy, 1 giving xx
- *4.
- perform until xx < 3
- subtract 1 from xx
- move c-screenzeile (xx - 1)
- to c-screenzeile (xx)
- end-perform
- move emptyline to c-screenzeile (1)
- move 1 to xcoord
- move 0 to ycoord
- perform until ycoord > yy
- add 1 to ycoord
- move 0 to nn
- perform until nn > 37
- add 1 to nn
- move nn to xcoord
- move c-screen (ycoord,nn) to anzeigeteil
- display anzeigeteil at line ycoord
- column xcoord
- end-perform
- end-perform
- end-if
- move nein to line-full
- end-perform
- *5.
- perform ziehe-teil
- end-if .
- drop-teil .
- *Wenn man Mutig genug war die Leertaste zu drücken, wird der Stein
- *auf der Stelle fallengelassen. (Wie beim Feierabend der Kuli)
- perform with test after until senken-ok = nein
- perform senke-teil
- end-perform .
- *Die Punktzahl muss man dann auch dementsprechend erhöhen.
- *Denn Risiko muß sich lohnen
- compute score = score + level * (Maxy - Teily1)
- display score at line 10 column info-x .
- move-teil-links .
- *Es wird links von dem Teil ueberprueft, ob noch Platz ist
- *Wenn ja, wird geschoben und angezeigt
- move ja to move-ok .
- perform varying yy from 1 by 1 until yy > 4
- move nein to element-gefunden
- move 1 to xx
- perform until xx > 8
- or element-gefunden = ja
- if ateilelement (yy, xx) not = " "
- move ja to element-gefunden
- add teily1, yy, -1 giving dummywert1
- add teilx1, xx, -1 giving dummywert2
- if c-screen (dummywert1,dummywert2) not = " "
- move nein to move-ok
- end-if
- end-if
- add 2 to xx
- end-perform
- end-perform .
- if move-ok = ja
- perform loesche-teil
- subtract 2 from teilx1
- perform zeichne-teil
- end-if .
- move-teil-rechts .
- *Wie bei Links nur halt auf der rechten Seite.
- move ja to move-ok .
- perform varying yy from 1 by 1 until yy > 4
- move nein to element-gefunden
- move 8 to xx
- perform until xx < 1
- or element-gefunden = ja
- if ateilelement (yy,xx) not = " "
- move ja to element-gefunden
- add teily1, yy, -1 giving dummywert1
- add teilx1, xx, 1 giving dummywert2
- if c-screen (dummywert1,dummywert2) not = " "
- move nein to move-ok
- end-if
- end-if
- subtract 2 from xx
- end-perform
- end-perform
- if move-ok = ja
- perform loesche-teil
- add 2 to teilx1
- perform zeichne-teil
- end-if .
- rotiere-teil .
- *Beim Rotieren wird Rechts, Links und Untendrunter geguckt, ob
- *noch Platz ist.
- move ja to rotieren-ok
- add teilphase, 1 giving teilphase2
- if teilphase2 > 4
- move 1 to teilphase2
- end-if
- move teilev (teilnr, teilphase2) to teil2
- perform varying yy from 1 by 1 until yy > 4
- move 1 to xx
- perform until xx > 8
- or rotieren-ok = nein
- if ateil2element (yy,xx) not = " "
- if (teily1 + yy - 1) < 1
- move nein to rotieren-ok
- end-if
- if rotieren-ok = ja
- add teily1, yy, -1 giving dummywert1
- add teilx1, xx giving dummywert2
- if c-screen (dummywert1,dummywert2) not = " "
- move nein to rotieren-ok
- end-if
- end-if
- end-if
- add 2 to xx
- end-perform
- end-perform
- if rotieren-ok = ja
- perform loesche-teil
- move teil2 to teil
- move teilphase2 to teilphase
- perform zeichne-teil
- end-if .
- ende .
- perform cursoron .
- perform clear-screen .
- stop run .
- spiel .
- move nein to game-over .
- perform ziehe-teil .
- perform with test after until game-over = ja
- perform zeichne-teil
- move 0 to taste-zaehler
- perform with test after
- until taste-zaehler > level-zaehler
- or taste = fallen
- perform hole-taste
- evaluate taste
- when links
- perform move-teil-links
- when rechts
- perform move-teil-rechts
- when rotieren
- perform rotiere-teil
- when fallen
- perform drop-teil
- when abbruch
- perform ende
- when any
- *Wenn keine Taste gedrückt wurde, wird auch nichts getan. Wenn man
- *also Lust hat, kann man statt dessen auch noch etwas anzeigen.
- *Wie wäre es mit der Uhrzeit oben rechts ??????? Nur den Inhalt
- *des Paragraphen ändern!
- perform dummy-exit
- end-evaluate
- add 1 to taste-zaehler
- end-perform
- *Generell wird das Teil gesenkt wenn es nicht fallengelassen wurde
- if taste not = fallen
- perform senke-teil
- end-if
- end-perform .
- end-abfrage .
- display "G A M E O V E R ! "
- at line 16 column 44 .
- display "Start eines neuen Spiels: "
- at line 17 column 44 .
- display "<1> bis <9> startet Level "
- at line 18 column 44 .
- display "Ende mit <0> "
- at line 19 column 44 .
- *Auch hier wieder. Es gibt in COBOL kein INKEY
- move 0 to waitkey .
- move " " to nochmal-taste
- perform until nochmal-taste not < "0" and not > "9"
- call "CBL_GET_KBD_STATUS" using waitkey
- if waitkey = 1
- call "CBL_READ_KBD_CHAR" using nochmal-taste
- end-if
- end-perform
- *Als erstes die Sicherheitsabfrage, die Taste auch wirklich
- *Numerisch ist. Wenn Ja und die Taste liegt zwischen 1 und 9
- *wird der Level gesetzt oder durch die Variable again wird das
- *das Programm beendet.
- if nochmal-taste numeric
- if nochmal-taste not = "0"
- move nochmal-taste to level
- else
- move nein to again
- end-if
- else
- move nein to again
- end-if .
- ask-defaults .
- perform clear-screen .
- move 0 to level .
- move 0 to pc-faktor .
- display "Willkommen zu TX-TRIS!" AT line 1 column 1 .
- display "Bitte geben Sie den Verzoegerungsfaktor fuer Ihren
- -"Rechner ein" at line 2 column 1 .
- display "Je hoeher der Wert, desto langsamer wird das Spiel"
- at line 3 column 1 .
- perform until pc-faktor > 0 and not > 30000
- display "Verzoegerung von 1 bis 30000 " at Line 5
- column 1
- accept pc-faktor
- end-perform
- perform until level > 0 and < 10
- display "Mit welchem Level wollen Sie starten 1 bis 9 "
- at line 7 column 1
- accept level
- end-perform .
- initialisieren-fallteile .
- *Andere Programmiersprachen können eine Tabelle komplett mit
- *Werten bestücken. Dieser Aufwand lohnt sich nicht immer in
- *COBOL. Nur bei kleineren Tabellen ist dies sinnvoll (siehe
- * auch die Tabelle Teily1-Offset).
- move " " to teilreihe (1,1,1)
- move " " to teilreihe (1,1,2)
- move "XXXXXX " to teilreihe (1,1,3)
- move " XX " to teilreihe (1,1,4)
- move " " to teilreihe (1,2,1)
- move " XXXX " to teilreihe (1,2,2)
- move " XX " to teilreihe (1,2,3)
- move " XX " to teilreihe (1,2,4)
- move " " to teilreihe (1,3,1)
- move "XX " to teilreihe (1,3,2)
- move "XXXXXX " to teilreihe (1,3,3)
- move " " to teilreihe (1,3,4)
- move " " to teilreihe (1,4,1)
- move " XX " to teilreihe (1,4,2)
- move " XX " to teilreihe (1,4,3)
- move " XXXX " to teilreihe (1,4,4)
- move " " to teilreihe (2,1,1)
- move " " to teilreihe (2,1,2)
- move "@@@@@@ " to teilreihe (2,1,3)
- move "@@ " to teilreihe (2,1,4)
- move " " to teilreihe (2,2,1)
- move " @@ " to teilreihe (2,2,2)
- move " @@ " to teilreihe (2,2,3)
- move " @@@@ " to teilreihe (2,2,4)
- move " " to teilreihe (2,3,1)
- move " @@ " to teilreihe (2,3,2)
- move "@@@@@@ " to teilreihe (2,3,3)
- move " " to teilreihe (2,3,4)
- move " " to teilreihe (2,4,1)
- move " @@@@ " to teilreihe (2,4,2)
- move " @@ " to teilreihe (2,4,3)
- move " @@ " to teilreihe (2,4,4)
- move " " to teilreihe (3,1,1)
- move " $$$$ " to teilreihe (3,1,2)
- move "$$$$ " to teilreihe (3,1,3)
- move " " to teilreihe (3,1,4)
- move " " to teilreihe (3,2,1)
- move "$$ " to teilreihe (3,2,2)
- move "$$$$ " to teilreihe (3,2,3)
- move " $$ " to teilreihe (3,2,4)
- move " " to teilreihe (3,3,1)
- move " $$$$ " to teilreihe (3,3,2)
- move "$$$$ " to teilreihe (3,3,3)
- move " " to teilreihe (3,3,4)
- move " " to teilreihe (3,4,1)
- move "$$ " to teilreihe (3,4,2)
- move "$$$$ " to teilreihe (3,4,3)
- move " $$ " to teilreihe (3,4,4)
- move " " to teilreihe (4,1,1)
- move "#### " to teilreihe (4,1,2)
- move " #### " to teilreihe (4,1,3)
- move " " to teilreihe (4,1,4)
- move " " to teilreihe (4,2,1)
- move " ## " to teilreihe (4,2,2)
- move "#### " to teilreihe (4,2,3)
- move "## " to teilreihe (4,2,4)
- move " " to teilreihe (4,3,1)
- move "#### " to teilreihe (4,3,2)
- move " #### " to teilreihe (4,3,3)
- move " " to teilreihe (4,3,4)
- move " " to teilreihe (4,4,1)
- move " ## " to teilreihe (4,4,2)
- move "#### " to teilreihe (4,4,3)
- move "## " to teilreihe (4,4,4)
- move " " to teilreihe (5,1,1)
- move " [[[[ " to teilreihe (5,1,2)
- move " [[[[ " to teilreihe (5,1,3)
- move " " to teilreihe (5,1,4)
- move " " to teilreihe (5,2,1)
- move " [[[[ " to teilreihe (5,2,2)
- move " [[[[ " to teilreihe (5,2,3)
- move " " to teilreihe (5,2,4)
- move " " to teilreihe (5,3,1)
- move " [[[[ " to teilreihe (5,3,2)
- move " [[[[ " to teilreihe (5,3,3)
- move " " to teilreihe (5,3,4)
- move " " to teilreihe (5,4,1)
- move " [[[[ " to teilreihe (5,4,2)
- move " [[[[ " to teilreihe (5,4,3)
- move " " to teilreihe (5,4,4)
- move " " to teilreihe (6,1,1)
- move "]]]]]]]]" to teilreihe (6,1,2)
- move " " to teilreihe (6,1,3)
- move " " to teilreihe (6,1,4)
- move " ]] " to teilreihe (6,2,1)
- move " ]] " to teilreihe (6,2,2)
- move " ]] " to teilreihe (6,2,3)
- move " ]] " to teilreihe (6,2,4)
- move " " to teilreihe (6,3,1)
- move "]]]]]]]]" to teilreihe (6,3,2)
- move " " to teilreihe (6,3,3)
- move " " to teilreihe (6,3,4)
- move " ]] " to teilreihe (6,4,1)
- move " ]] " to teilreihe (6,4,2)
- move " ]] " to teilreihe (6,4,3)
- move " ]] " to teilreihe (6,4,4)
- move " " to teilreihe (7,1,1)
- move " " to teilreihe (7,1,2)
- move "****** " to teilreihe (7,1,3)
- move " ** " to teilreihe (7,1,4)
- move " " to teilreihe (7,2,1)
- move " ** " to teilreihe (7,2,2)
- move " **** " to teilreihe (7,2,3)
- move " ** " to teilreihe (7,2,4)
- move " " to teilreihe (7,3,1)
- move " ** " to teilreihe (7,3,2)
- move "****** " to teilreihe (7,3,3)
- move " " to teilreihe (7,3,4)
- move " " to teilreihe (7,4,1)
- move " ** " to teilreihe (7,4,2)
- move "**** " to teilreihe (7,4,3)
- move " ** " to teilreihe (7,4,4) .
- DUMMY-EXIT .
- *Diese Routine hat im Augenblick keinen Wert, kann aber erweitert
- *werden.
- exit .
-