Buchempfehlung
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Umfassend, aber leicht verständlich führt dieses Buch in die Programmierung von ATMEL AVR Mikrocontrollern ein. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

STOP 2.02 Beta (Quellcode)

Uploader:MitgliedALWIM
Datum/Zeit:16.07.2012 23:54:55
Hinweis: Dieser Quelltext ist Bestandteil des Projekts Schachturnierorganisationsprogramm, zu dem es auf FreeBASIC-Portal.de eine Projektseite gibt.
Warnung: Es steht bereits eine neuere Version des Quelltexts zur Verfügung. Die hier vorliegende alte Version könnte Fehler enthalten, die in der neuen Version vielleicht ausgebessert wurden.

#INCLUDE ONCE "WINDOWS.BI"
#Include Once "win\COMMDLG.BI"
#INCLUDE "file.bi"

DECLARE Sub FELD (X As Integer, Y As Integer, XX As Integer, YY As Integer, Farben#)
DECLARE Sub FELT (X As Integer, Y As Integer, XX As Integer, YY As Integer, Farbe#)

DECLARE Sub CPRINT (FFTEXT As String, FFHEIGHT As Integer, FFWDITH As Integer, FFCOLOR1 As Integer, FFCOLOR2 As Integer, FFCOLOR3 As Integer)
DECLARE Sub INGET (ANZAHLE As Integer, STELLEN As integer, ZEILEN As integer, N As String)
DECLARE Sub SPIELFELD ()
DECLARE SUB TEILNEHMER ()
DECLARE SUB INSTALL ()
DECLARE SUB LADEN ()
DECLARE SUB AUSLOSUNG ()
DECLARE SUB NEU ()
DECLARE SUB HILFE ()
DECLARE SUB LOAD ()
DECLARE SUB SPEICHERN ()
DECLARE SUB ERSTELLEPAARUNGEN (runde as integer)
DECLARE SUB BUTTON (X AS INTEGER, Y AS integer, XX AS integer, YY AS integer, FARBEN%, HFARBE%, DFARBE%)

DECLARE Function LoadSaveDialog (_
           savedlog As Integer = 0,_
           filter As String = "",_
           fltrindex As Integer = 1,_
           initdir As String = "",_
           strDefExt As String = "esk") As String
'Voreinstellungen:
'savedlog = 0 "Datei Öffnen", 1(<>0) "Datei Speichern"
'filter = "" "Alle Dateien", sonst siehe fil
'fltrindex = 1,  sonst welcher Eintrag, der bei filter angegebenen Auswahl, aktiv ist
'initdir = "" = "." aktueller Pfad, sonst angegebener Pfad
'strDefExt = "" keine Vorgabe, sonst z.B. "bak" als Vorgabe der Endung zum Speichern

Dim SHARED AS String DateiName, fil
fil = "STOP Turnierdateien (*.ESK)" + Chr(0) + "*.ESK" + Chr(0)

DIM SHARED AS INTEGER runden, ppr, startwert
REDIM SHARED AS INTEGER paarungen(1 to 500, 1 to 2)

DIM SHARED AS INTEGER mausx, mausy, mausk
DIM SHARED AS INTEGER FARBEN, Grafik, Sprache, i, r
DIM SHARED AS INTEGER RUNDE, TAZ, RAZ, GRAZ, TZAHL, Rounds
DIM SHARED AS INTEGER RY1, RY2, BDRAUF, Doppel, whandle

DIM SHARED AS String Spieler1(500)

Dim As Integer A = 55 + 1
Dim As Integer X(A), XX(A), Y(A), YY(A), Zahl(A)
Dim f As Integer = FREEFILE
Dim SHARED filename AS STRING


DIM SHARED AS INTEGER w, h, depth
SCREENINFO w, h, depth

RUNDE = 1
TAZ = 0

' ************************************************************************************

Doppel = FALSE
Scrflag = FALSE

' ************************************************************************************
LADEN

IF w > 1024 AND h > 768 THEN Scrflag = TRUE
IF Scrflag THEN SCREENRES 1024, 768, 24 ELSE SCREENRES w, h, 32,, &h08

SCREENCONTROL 2, whandle '2 = fb.GET_WINDOW_HANDLE
SendMessage (Cast (HWND, whandle), WM_SETICON, ICON_SMALL, _
Cast( Integer, LoadImage ( GetModuleHandle (Null), _
"MY_ICON", IMAGE_ICON, 0, 0, LR_COPYFROMRESOURCE  ) ) )

WINDOWTITLE "Schachturnierorganisationsprogramm"
SLEEP 1
SETMOUSE 320,350,1

SPIELFELD

DO

GETMOUSE mausx%, mausy%,, mausk%

COLOR &hFFFFFF

A$ = INKEY$
SELECT CASE A$
    CASE CHR$(43): IF Runde < RAZ AND TZAHL > 2 THEN Runde = Runde + 1: AUSLOSUNG
        SCREENLOCK
        IF Sprache = 1 THEN CPRINT "RUNDE: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 2 THEN CPRINT "ROUND: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 3 THEN CPRINT "TOUR: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 4 THEN CPRINT "RONDA: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 5 THEN CPRINT "D'RUNDN: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        SCREENUNLOCK
    CASE CHR$(45): IF Runde > 1 AND TZAHL > 2 THEN Runde = Runde - 1: AUSLOSUNG
        SCREENLOCK
        IF Sprache = 1 THEN CPRINT "RUNDE: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 2 THEN CPRINT "ROUND: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 3 THEN CPRINT "TOUR: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 4 THEN CPRINT "RONDA: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        IF Sprache = 5 THEN CPRINT "D'RUNDN: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
        SCREENUNLOCK
END SELECT

mousey% = mausy%

IF DOPPEL THEN CIRCLE (564, 724), 4, &hFFFFFF: CIRCLE (564, 724), 2, &h000000: PAINT (564, 724), &h000000: CIRCLE (564, 748), 2, &h00AA00: PAINT (564, 748), &h00AA00 ELSE CIRCLE (564, 724), 4, &hFFFFFF: CIRCLE (564, 724), 2, &h00AA00: PAINT (564, 724), &h00AA00: CIRCLE (564, 748), 2, &h000000: PAINT (564, 748), &h000000
IF MULTIKEY(&h48) THEN
    SCREENLOCK
    LOCATE 2, 120
    PRINT TIME$
    SCREENUNLOCK
    DOPPEL = FALSE
    TEILNEHMER
ENDIF
IF MULTIKEY(&h50) THEN
    SCREENLOCK
    LOCATE 2, 120
    PRINT TIME$
    SCREENUNLOCK
    DOPPEL = TRUE
    TEILNEHMER
ENDIF
IF MULTIKEY(&h26) AND SPRACHE = 1 THEN LOAD
IF MULTIKEY(&h26) AND SPRACHE = 2 THEN LOAD
IF MULTIKEY(&h2E) AND SPRACHE = 3 THEN LOAD
IF MULTIKEY(&h1E) AND SPRACHE = 4 THEN LOAD
IF MULTIKEY(&h26) AND SPRACHE = 5 THEN LOAD
IF MULTIKEY(&h1F) AND SPRACHE = 1 THEN SPEICHERN
IF MULTIKEY(&h1F) AND SPRACHE = 2 THEN SPEICHERN
IF MULTIKEY(&h1F) AND SPRACHE = 3 THEN SPEICHERN
IF MULTIKEY(&h22) AND SPRACHE = 4 THEN SPEICHERN
IF MULTIKEY(&h1F) AND SPRACHE = 5 THEN SPEICHERN
IF MULTIKEY(&h31) AND TZAHL > 0 THEN NEU
IF MULTIKEY(&h23) AND SPRACHE = 1 THEN HILFE
IF MULTIKEY(&h23) AND SPRACHE = 2 THEN HILFE
IF MULTIKEY(&h1E) AND SPRACHE = 3 THEN HILFE
IF MULTIKEY(&h16) AND SPRACHE = 4 THEN HILFE
IF MULTIKEY(&h23) AND SPRACHE = 5 THEN HILFE
IF MULTIKEY(&h3B) THEN HILFE
IF MULTIKEY(&h39) AND TZAHL > 2 THEN AUSLOSUNG
IF MULTIKEY(&h01) Then SLEEP 100: END

 SELECT CASE mausk%
    CASE 1
sele1:
IF mausk% = 0 THEN BUTTON 2, 2, 50, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei laden
SELECT CASE mausx%
    CASE 2 TO 50
           SELECT CASE mausy%
            CASE 3 TO 28
                LOCATE 2, 120: PRINT TIME$
                BDRAUF = TRUE
                IF mausk% = 1 THEN BUTTON 2, 2, 50, 28, &hAAAAAA, &h555555, &hFFFFFF: ' Datei laden
                IF mausk% = 0 THEN LOAD ELSE GETMOUSE mausx%, mausy%,, mausk%: GOTO sele1
            CASE ELSE
                BUTTON 2, 2, 50, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei laden
           END SELECT
    END SELECT


sele2:
IF mausk% = 0 THEN BUTTON 59, 2, 138, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei speichern
SELECT CASE mausx%
    CASE 59 TO 138
           SELECT CASE mausy%
            CASE 3 TO 28
                LOCATE 2, 120: PRINT TIME$
                BDRAUF = TRUE
                IF mausk% = 1 THEN BUTTON 59, 2, 138, 28, &hAAAAAA, &h555555, &hFFFFFF: ' Datei speichern
                IF mausk% = 0 THEN SPEICHERN ELSE GETMOUSE mausx%, mausy%,, mausk%: GOTO sele2
            CASE ELSE
                BUTTON 59, 2, 138, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei speichern
           END SELECT
    END SELECT

sele3:
IF mausk% = 0 AND TZAHL > 0 THEN BUTTON 147, 2, 194, 28, &hAAAAAA, &hFFFFFF, &h555555: ' NEU
SELECT CASE mausx%
    CASE 147 TO 194
           SELECT CASE mausy%
            CASE 3 TO 28
                LOCATE 2, 120: PRINT TIME$
                BDRAUF = TRUE
                IF TZAHL = 0 THEN EXIT SELECT
                IF mausk% = 1 AND TZAHL > 0 THEN BUTTON 147, 2, 194, 28, &hAAAAAA, &h555555, &hFFFFFF: ' NEU
                IF mausk% = 0 AND TZAHL > 0 THEN NEU ELSE GETMOUSE mausx%, mausy%,, mausk%: GOTO sele3
            CASE ELSE
                BUTTON 147, 2, 194, 28, &hAAAAAA, &hFFFFFF, &h555555: ' NEU
           END SELECT
    END SELECT

sele4:
IF mausk% = 0 THEN BUTTON 203, 2, 251, 28, &hAAAAAA, &hFFFFFF, &h555555: ' HILFE
SELECT CASE mausx%
    CASE 203 TO 251
           SELECT CASE mausy%
            CASE 3 TO 28
                LOCATE 2, 120: PRINT TIME$
                BDRAUF = TRUE
                IF mausk% = 1 THEN BUTTON 203, 2, 251, 28, &hAAAAAA, &h555555, &hFFFFFF: ' HILFE
                IF mausk% = 0 THEN HILFE ELSE GETMOUSE mausx%, mausy%,, mausk%: GOTO sele4
            CASE ELSE
                BUTTON 203, 2, 251, 28, &hAAAAAA, &hFFFFFF, &h555555: ' HILFE
           END SELECT
    END SELECT
sele5:
IF mausk% = 0 AND TZAHL > 0 THEN BUTTON 475, 722, 553, 750, &hAAAAAA, &hFFFFFF, &h555555: ' AUSLOSUNG
SELECT CASE mausx%
    CASE 475 TO 553
           SELECT CASE mausy%
            CASE 722 TO 750
                LOCATE 2, 120: PRINT TIME$
                BDRAUF = TRUE
                IF TZAHL = 0 THEN EXIT SELECT
                IF mausk% = 1 AND TZAHL > 0 THEN BUTTON 475, 722, 553, 750, &hAAAAAA, &h555555, &hFFFFFF: ' AUSLOSUNG
                IF mausk% = 0 AND TZAHL > 0 THEN AUSLOSUNG ELSE GETMOUSE mausx%, mausy%,, mausk%: GOTO sele5
            CASE ELSE
                BUTTON 475, 722, 553, 750, &hAAAAAA, &hFFFFFF, &h555555: ' AUSLOSUNG
           END SELECT
END SELECT

SELECT CASE mausx%
        CASE ELSE
          SELECT CASE mausy%
            CASE ELSE
            IF BDRAUF THEN
                    BUTTON 2, 2, 50, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei laden
                    BUTTON 59, 2, 138, 28, &hAAAAAA, &hFFFFFF, &h555555: ' Datei speichern
                BUTTON 147, 2, 194, 28, &hAAAAAA, &hFFFFFF, &h555555: ' NEU
                BUTTON 203, 2, 251, 28, &hAAAAAA, &hFFFFFF, &h555555: ' HILFE
                BUTTON 475, 722, 553, 750, &hAAAAAA, &hFFFFFF, &h555555: ' AUSLOSUNG
            END IF
            BDRAUF = FALSE
            END Select
    END SELECT

 IF mousey% < 68 THEN GOTO Ohne
REM ************************************Spieler 1 - 40**************************
    SELECT CASE mausx%
        CASE 5 TO 205
           SELECT CASE mausy%
            CASE mausy% TO mausy%
                IF mausy% > 68 AND mausy% < 81 THEN XP = 10: WO = 1
                IF mausy% > 84 AND mausy% < 97 AND TZAHL > 0 THEN XP = 12: WO = 2
                IF mausy% > 100 AND mausy% < 113 AND TZAHL > 1 THEN XP = 14: WO = 3
                IF mausy% > 116 AND mausy% < 129 AND TZAHL > 2 THEN XP = 16: WO = 4
                IF mausy% > 132 AND mausy% < 145 AND TZAHL > 3 THEN XP = 18: WO = 5
                IF mausy% > 148 AND mausy% < 161 AND TZAHL > 4 THEN XP = 20: WO = 6
                IF mausy% > 164 AND mausy% < 177 AND TZAHL > 5 THEN XP = 22: WO = 7
                IF mausy% > 180 AND mausy% < 193 AND TZAHL > 6 THEN XP = 24: WO = 8
                IF mausy% > 196 AND mausy% < 209 AND TZAHL > 7 THEN XP = 26: WO = 9
                IF mausy% > 212 AND mausy% < 225 AND TZAHL > 8 THEN XP = 28: WO = 10
                IF mausy% > 228 AND mausy% < 241 AND TZAHL > 9 THEN XP = 30: WO = 11
                IF mausy% > 244 AND mausy% < 257 AND TZAHL > 10 THEN XP = 32: WO = 12
                IF mausy% > 260 AND mausy% < 273 AND TZAHL > 11 THEN XP = 34: WO = 13
                IF mausy% > 276 AND mausy% < 289 AND TZAHL > 12 THEN XP = 36: WO = 14
                IF mausy% > 292 AND mausy% < 305 AND TZAHL > 13 THEN XP = 38: WO = 15
                IF mausy% > 308 AND mausy% < 321 AND TZAHL > 14 THEN XP = 40: WO = 16
                IF mausy% > 324 AND mausy% < 337 AND TZAHL > 15 THEN XP = 42: WO = 17
                IF mausy% > 340 AND mausy% < 353 AND TZAHL > 16 THEN XP = 44: WO = 18
                IF mausy% > 356 AND mausy% < 369 AND TZAHL > 17 THEN XP = 46: WO = 19
                IF mausy% > 372 AND mausy% < 385 AND TZAHL > 18 THEN XP = 48: WO = 20
                IF mausy% > 388 AND mausy% < 401 AND TZAHL > 19 THEN XP = 50: WO = 21
                IF mausy% > 404 AND mausy% < 417 AND TZAHL > 20 THEN XP = 52: WO = 22
                IF mausy% > 420 AND mausy% < 433 AND TZAHL > 21 THEN XP = 54: WO = 23
                IF mausy% > 436 AND mausy% < 449 AND TZAHL > 22 THEN XP = 56: WO = 24
                IF mausy% > 452 AND mausy% < 465 AND TZAHL > 23 THEN XP = 58: WO = 25
                IF mausy% > 468 AND mausy% < 481 AND TZAHL > 24 THEN XP = 60: WO = 26
                IF mausy% > 484 AND mausy% < 497 AND TZAHL > 25 THEN XP = 62: WO = 27
                IF mausy% > 500 AND mausy% < 513 AND TZAHL > 26 THEN XP = 64: WO = 28
                IF mausy% > 516 AND mausy% < 529 AND TZAHL > 27 THEN XP = 66: WO = 29
                IF mausy% > 532 AND mausy% < 545 AND TZAHL > 28 THEN XP = 68: WO = 30
                IF mausy% > 548 AND mausy% < 561 AND TZAHL > 29 THEN XP = 70: WO = 31
                IF mausy% > 564 AND mausy% < 577 AND TZAHL > 30 THEN XP = 72: WO = 32
                IF mausy% > 580 AND mausy% < 593 AND TZAHL > 31 THEN XP = 74: WO = 33
                IF mausy% > 596 AND mausy% < 609 AND TZAHL > 32 THEN XP = 76: WO = 34
                IF mausy% > 612 AND mausy% < 625 AND TZAHL > 33 THEN XP = 78: WO = 35
                IF mausy% > 628 AND mausy% < 641 AND TZAHL > 34 THEN XP = 80: WO = 36
                IF mausy% > 644 AND mausy% < 657 AND TZAHL > 35 THEN XP = 82: WO = 37
                IF mausy% > 660 AND mausy% < 673 AND TZAHL > 36 THEN XP = 84: WO = 38
                IF mausy% > 676 AND mausy% < 689 AND TZAHL > 37 THEN XP = 86: WO = 39
                IF mausy% > 692 AND mausy% < 705 AND TZAHL > 38 THEN XP = 88: WO = 40
               IF WO <> 0 THEN INGET 28, XP, 3, SPIELER1$(WO)
               TEILNEHMER
             WO = 0
           END SELECT
    END SELECT

    SELECT CASE mausx%
        CASE 475 TO 553
           SELECT CASE mausy%
            CASE 722 TO 750
   AUSLOSUNG
           END SELECT
    END SELECT

   SELECT CASE mausx%
    CASE 990 TO 1015
           SELECT CASE mausy%
            CASE 715 TO 758
   SYSTEM
           END SELECT
   END SELECT

    SELECT CASE mausx%
        CASE 561 TO 568
           SELECT CASE mausy%
            CASE 720 TO 728
                SCREENLOCK
                LOCATE 2, 120
                PRINT TIME$
                SCREENUNLOCK
                DOPPEL = FALSE
                TEILNEHMER
           END SELECT
    END SELECT

    SELECT CASE mausx%
        CASE 561 TO 568
           SELECT CASE mausy%
            CASE 744 TO 752
                SCREENLOCK
                LOCATE 2, 120
                PRINT TIME$
                SCREENUNLOCK
                DOPPEL = TRUE
                TEILNEHMER
           END SELECT
   END SELECT
 END SELECT
Ohne:

SLEEP 1
LOCATE 2, 120: PRINT TIME$
LOOP
SLEEP
END

SUB FELD (X, Y, XX, YY, FARBEN#)
LINE (X, Y)-(X, YY), &hFFFFFF
LINE (X, Y)-(XX, Y), &hFFFFFF
LINE (X, YY)-(XX, YY), &h555555
LINE (XX, Y)-(XX, YY), &h555555
VIEW (X + 2, Y + 2)-(XX - 2, YY - 2), FARBEN, FARBEN
VIEW (0, 0)-(1023, 767)
END Sub

SUB CPRINT (FFTEXT$, FFHEIGHT, FFWIDTH, FFCOLOR1, FFCOLOR2, FFCOLOR3)
C = LEN(FFTEXT$)

REM PALETTE 4, 4
Color 4

LOCATE FFHEIGHT, FFWIDTH: PRINT FFTEXT$;

G = FFHEIGHT * 8 - 8
FOR F = FFWIDTH * 8 - 8 TO FFWIDTH * 8 + C * 8 - 8
FOR X = 0 TO 7
IF X < 2 AND POINT(F, G + X) = 4 THEN PSET (F, G + X), FFCOLOR1
IF X > 1 AND X < 5 AND POINT(F, G + X) = 4 THEN PSET (F, G + X), FFCOLOR2
IF X > 4 AND POINT(F, G + X) = 4 THEN PSET (F, G + X), FFCOLOR3
NEXT
NEXT
PALETTE


Color 15
End Sub

Sub INGET (ANZAHLE, STELLEN, ZEILEN, N$)
N$ = RTRIM$(N$)
BB = LEN(N$)
CPRINT N$ + "_", STELLEN, ZEILEN, &hFFFFFF, &hAAAAAA, &h555555
2111 AA$ = "": WHILE AA$ = "": COLOR &hFFFFFF: AA$ = INKEY$: LOCATE 2, 120: PRINT TIME$: WEND: ' Lenhard Alexander
If ASC(AA$) < 32 AND ASC(AA$) <> 27 AND ASC(AA$) <> 13 AND ASC(AA$) <> 8 THEN GOTO 2111
If ASC(AA$) > 126 THEN GOTO 2111
If LEFT$(AA$, 1) = CHR$(0) THEN GOTO 2111
Select CASE AA$
    CASE CHR$(13), CHR$(27): CPRINT N$ + " ", STELLEN, ZEILEN, &hFFFFFF, &hAAAAAA, &h555555: GOTO 2112
    CASE CHR$(8): BB = BB - 1: IF BB < 0 THEN BB = 0:  ELSE LET N$ = LEFT$(N$, BB): CPRINT N$ + "_ ", STELLEN, ZEILEN, &hFFFFFF, &hAAAAAA, &h555555
    CASE IS <> "": BB = BB + 1: IF BB = ANZAHLE + 1 THEN BB = BB - 1: GOTO 2111 ELSE N$ = N$ + AA$: CPRINT N$ + "_", STELLEN, ZEILEN, &hFFFFFF, &hAAAAAA, &h555555
End SELECT
GoTo 2111
2112
End SUB

SUB INSTALL

    DIM AS Any Ptr Deutschpuffer
Deutschpuffer = ImageCreate(48,48)
BLOAD (ExePath & "\Deutsch.Stop", Deutschpuffer)
    DIM AS Any Ptr Englischpuffer
Englischpuffer = ImageCreate(48,48)
BLOAD (ExePath & "\Englisch.Stop", Englischpuffer)
    DIM AS Any Ptr Franzoesischpuffer
Franzoesischpuffer = ImageCreate(48,48)
BLOAD (ExePath & "\Franzoesisch.Stop", Franzoesischpuffer)
    DIM AS Any Ptr Spanischpuffer
Spanischpuffer = ImageCreate(48,48)
BLOAD (ExePath & "\Spanisch.Stop", Spanischpuffer)
    DIM AS Any Ptr Bayrischpuffer
Bayrischpuffer = ImageCreate(48,48)
BLOAD (ExePath & "\Bayrisch.Stop", Bayrischpuffer)
    DIM AS Any Ptr Logopuffer
Logopuffer = ImageCreate(500,105)
BLOAD (ExePath & "\Menu.Stop", Logopuffer)
PUT (100,100), Deutschpuffer, PSET
PUT (100,200), Englischpuffer, PSET
PUT (100,300), Franzoesischpuffer, PSET
PUT (100,400), Spanischpuffer, PSET
PUT (100,500), Bayrischpuffer, PSET
PUT (6,3), Logopuffer, PSET
IMAGEDESTROY(Deutschpuffer)
IMAGEDESTROY(Englischpuffer)
IMAGEDESTROY(Franzoesischpuffer)
IMAGEDESTROY(Spanischpuffer)
IMAGEDESTROY(Bayrischpuffer)
IMAGEDESTROY(Logopuffer)
CPRINT "Bitte waehlen sie eine Sprache!", 16, 25, &hFFFFFF, &h55FFFF, &h00AAAA: ' (Deutsch)
CPRINT "Please select the language!", 29, 25, &hFFFFFF, &h55FFFF, &h00AAAA: ' (Englisch)
CPRINT "Choisissez une langue!", 41, 25, &hFFFFFF, &h55FFFF, &h00AAAA: ' (Französisch)
' CPRINT "S'il vous plaît, ils choisissent une langue", 41, 20, &hFFFFFF, &h55FFFF, &h00AAAA '(Französisch)
CPRINT "Por favor, ellos eligen una lengua!", 53, 25, &hFFFFFF, &h55FFFF, &h00AAAA: ' (Spanisch)
CPRINT "Suach da biddsche an Dialekt as!", 66, 25, &hFFFFFF, &h55FFFF, &h00AAAA
DO
GETMOUSE mausx%, mausy%,, mausk%
SELECT CASE mausk%
    CASE 0
    SELECT CASE mausx%
        CASE 100 TO 148
          SELECT CASE mausy%
            CASE 104 TO 142
                 BDRAUF = FALSE
            ' Deutsch
            LINE (98, 104)-(149, 142), &hFFFFFF, B
            LINE (98, 204)-(149, 242), &h000000, B
            LINE (98, 304)-(149, 342), &h000000, B
            LINE (98, 404)-(149, 442), &h000000, B
            LINE (98, 504)-(149, 543), &h000000, B
          END Select
    END SELECT
    SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 204 TO 242
                BDRAUF = FALSE
            ' Englisch
            LINE (98, 104)-(149, 142), &h000000, B
            LINE (98, 204)-(149, 242), &hFFFFFF, B
            LINE (98, 304)-(149, 342), &h000000, B
            LINE (98, 404)-(149, 442), &h000000, B
            LINE (98, 504)-(149, 543), &h000000, B
          END Select
    END SELECT
    SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 304 TO 342
                BDRAUF = FALSE
            ' Französisch
            LINE (98, 104)-(149, 142), &h000000, B
            LINE (98, 204)-(149, 242), &h000000, B
            LINE (98, 304)-(149, 342), &hFFFFFF, B
            LINE (98, 404)-(149, 442), &h000000, B
            LINE (98, 504)-(149, 543), &h000000, B
          END Select
    END SELECT
        SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 404 TO 442
                BDRAUF = FALSE
            ' Spanisch
            LINE (98, 104)-(149, 142), &h000000, B
            LINE (98, 204)-(149, 242), &h000000, B
            LINE (98, 304)-(149, 342), &h000000, B
            LINE (98, 404)-(149, 442), &hFFFFFF, B
            LINE (98, 504)-(149, 543), &h000000, B
          END Select
        END SELECT
    SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 504 TO 542
                BDRAUF = FALSE
            ' Bayrisch
            LINE (98, 104)-(149, 142), &h000000, B
            LINE (98, 204)-(149, 242), &h000000, B
            LINE (98, 304)-(149, 342), &h000000, B
            LINE (98, 404)-(149, 442), &h000000, B
            LINE (98, 504)-(149, 543), &hFFFFFF, B
          END Select
    END SELECT
    SELECT CASE mausx%
        CASE ELSE
          SELECT CASE mausy%
            CASE ELSE
            IF BDRAUF THEN
                LINE (98, 104)-(149, 142), &h000000, B
                LINE (98, 204)-(149, 242), &h000000, B
                LINE (98, 304)-(149, 342), &h000000, B
                LINE (98, 404)-(149, 442), &h000000, B
                LINE (98, 504)-(149, 543), &h000000, B
            END IF
            BDRAUF = TRUE
            END Select
    END SELECT
    CASE 1
 SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 100 TO 148
            ' Deutsch
            Setup = 1
            DIM ff As INTEGER = FreeFile
                OPEN "Stop.ini" FOR RANDOM AS #ff
                PRINT #ff, Setup
                CLOSE #ff
                EXIT DO
          END Select
   END SELECT
   SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 200 TO 248
            ' Englisch
            Setup = 2
            DIM ff As INTEGER = FreeFile
                OPEN "Stop.ini" FOR RANDOM AS #ff
                PRINT #ff, Setup
                CLOSE #ff
            EXIT DO
          END Select
   END SELECT
   SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 300 TO 348
            ' Französisch
            Setup = 3
            DIM ff As INTEGER = FreeFile
                OPEN "Stop.ini" FOR RANDOM AS #ff
                PRINT #ff, Setup
                CLOSE #ff
            EXIT DO
          END Select
   END SELECT
   SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 400 TO 448
            ' Spanisch
            Setup = 4
            DIM ff As INTEGER = FreeFile
                OPEN "Stop.ini" FOR RANDOM AS #ff
                PRINT #ff, Setup
                CLOSE #ff
            EXIT DO
          END Select
   END SELECT
   SELECT CASE mausx%
    CASE 100 TO 148
          SELECT CASE mausy%
            CASE 500 TO 548
            ' Bayrisch
            Setup = 5
            DIM ff As INTEGER = FreeFile
                OPEN "Stop.ini" FOR RANDOM AS #ff
                PRINT #ff, Setup
                CLOSE #ff
            EXIT DO
          END Select
   END SELECT
END SELECT
SLEEP 10
LOOP UNTIL INKEY <> ""
IF MULTIKEY(&h01) Then END
IF Setup = 0 THEN END
LADEN
EXIT SUB
END SUB

SUB laden
filename = "Stop.ini"
IF FileExists(filename) Then
DIM ff As INTEGER = FreeFile
OPEN filename FOR Input AS #ff
INPUT #ff, Setup
CLOSE #ff
IF Setup = 1 THEN Sprache = 1
IF Setup = 2 THEN Sprache = 2
IF Setup = 3 THEN Sprache = 3
IF Setup = 4 THEN Sprache = 4
IF Setup = 5 THEN Sprache = 5
IF Sprache < 1 OR Sprache > 5 THEN Sprache = 2
ELSE
    SCREENRES 512, 580, 32
'------ Icon in der Titelleiste ------
ScreenControl 2, whandle '2 = fb.GET_WINDOW_HANDLE
SendMessage (Cast (HWND, whandle), WM_SETICON, ICON_SMALL, _
Cast( Integer, LoadImage ( GetModuleHandle (Null), _
"MY_ICON", IMAGE_ICON, 0, 0, LR_COPYFROMRESOURCE  ) ) )

WINDOWTITLE "Schachturnierorganisationsprogramm"
SLEEP 1

' CPRINT "Screeninfo:", 16, 2, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "Width:" + LTRIM$(STR$(w)), 18, 2, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "Hight:" + LTRIM$(STR$(h)), 20, 2, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "Depth:" + LTRIM$(STR$(depth)), 22, 2, &hFFFFFF, &hFF55FF, &hAA00AA

INSTALL
ENDIF
END SUB

SUB BUTTON (X, Y, XX, YY, FARBEN%, HFARBE%, DFARBE%)
LINE (X, Y)-(X, YY), HFARBE%
LINE (X, Y)-(XX, Y), HFARBE%
LINE (X, YY)-(XX, YY), DFARBE%
LINE (XX, Y)-(XX, YY), DFARBE%
END SUB

SUB FELT (X, y, XX, YY, FARBEN#)
LINE (X, y)-(X, YY - 1), &hFFFFFF
LINE (X, y)-(XX - 1, y), &hFFFFFF
LINE (X + 1, YY)-(XX, YY), &h555555
LINE (XX, y + 1)-(XX, YY), &h555555
PSET (X, YY), &hAAAAAA
PSET (XX, y), &hAAAAAA
VIEW (X + 2, y + 2)-(XX - 2, YY - 2), FARBEN, FARBEN
VIEW (0, 0)-(1023, 767)
END SUB

SUB SPIELFELD
Rx1 = 10
Ry1 = 67
Rx2 = Rx1 + 450
Ry2 = Ry1 + 640
FOR Rahmen = Ry1 TO Ry2 STEP 16
LINE (Rx1 + 1,Rahmen)-(Rx2 - 1,Rahmen),&h00AA00
LINE (Rx1,Ry1)-(Rx1,Ry2), &h00AA00
LINE (Rx2,Ry1)-(Rx2,Ry2), &h00AA00
NEXT
FELT 0, 0, 1023, 30, &hAAAAAA: ' Menuleiste
FELT 475, Ry1, 1021, Ry2, &h000000: ' Paarungen
LINE (1, 1)-(1022, 29), &hAAAAAA, BF
FELT 2, 2, 50, 28, &h000000: ' Datei laden
FELT 59, 2, 138, 28, &h000000: ' Datei speichern
FELT 147, 2, 194, 28, &h000000: ' Neu
FELT 203, 2, 251, 28, &h000000: ' HILFE
FELT 483, 2, 547, 28, &h000000: ' STOP
FELT 947, 2, 1021, 28, &h000000: ' Uhrzeit
FELT 475, 722, 553, 750, &h000000: ' Auslosung
IF SPRACHE = 1 THEN
CPRINT "DATEI", 2, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " ADEN", 3, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "L", 3, 2, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "DATEI", 2, 11, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " PEICHERN", 3, 9, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "S", 3, 9, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " EU", 2, 21, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "N", 2, 21, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " ILFE", 2, 27, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "H", 2, 27, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "TEILNEHMER", 7, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "AUSLOSUNG", 92, 61, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RUNDE: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TEILNEHMER: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RUNDENZAHL: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RUNDENSYSTEM", 91, 73, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "DOPPELRUNDIG", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "RUTSCHSYSTEM", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 2 THEN
CPRINT "FILE", 2, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " OAD", 3, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "L", 3, 2, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "FILE", 2, 11, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " TORE", 3, 11, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "S", 3, 11, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " EW", 2, 21, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "N", 2, 21, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " ELP", 2, 27, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "H", 2, 27, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "PLAYERS", 7, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "PAIRING", 92, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ROUND: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "PLAYERS: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ROUNDS: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ROUND ROBIN", 91, 73, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "2x ROUND ROBIN", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "SLIDESYSTEM", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 3 THEN
CPRINT " HAR-", 2, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "GER", 3, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "C", 2, 2, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " AUVE-", 2, 10, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "GARDER", 3, 10, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "S", 2, 10, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " EUF", 2, 19.5, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "N", 2, 19.5, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " IDE", 2, 27, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "A", 2, 27, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "JOUEUR", 7, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "APPARIER", 92, 61, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TOUR: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "JOUEUR: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "NOMBRE DE RONDES: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RONDES COMPLETES CLASSIQUES",91 , 73, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "2x RONDES COMPLETES CLASSIQUES", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
'CPRINT "SYSTEME DE GLISSEMENT", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 4 THEN
CPRINT " BRIR", 2, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "A", 2, 2, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " UARDAR", 2, 10, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "TORNEO", 3, 10, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "G", 2, 10, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " UEVO", 2, 20, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "N", 2, 20, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "AY DA", 2, 27, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "U", 2, 29, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "PARTICIPANTES", 7, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "EMPARE-", 92, 61, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "JAMIENTO", 93, 61, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RONDA: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "PARTICIPANTE: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "NUMERO DE RONDAS: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ROUND ROBIN ESTANDAR",91 , 73, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "2x ROUND ROBIN ESTANDAR",94 , 73, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "SISTEMA RUTSCH", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 5 THEN
CPRINT "DATEI", 2, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " ADN", 3, 2, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "L", 3, 2, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "OIS", 2, 12, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT " ICHERN", 3, 10, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "S", 3, 10, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " EI", 2, 21, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "N", 2, 21, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT " UIFE", 2, 27, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "H", 2, 27, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "TEILNEHMA", 7, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "Wer spuit", 92, 61, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "mit wem", 93, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "D'RUNDN: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TEILNEHMA: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "D'RUNDNZOI: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "JEDA GEGN JEDN", 91, 73, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ZWOAMOI JEDA GEGN JEDN", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
' CPRINT "JEDA RUTSCHT OANS WEIDA", 94, 73, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 1 THEN CPRINT "S T O P", 2, 62, &h555555, &hAA0000, &hFFFF55
IF SPRACHE = 2 THEN CPRINT "S T O P", 2, 62, &hFFFFFF, &hFF5555, &hFFFFFF
IF SPRACHE = 3 THEN
CPRINT "S", 2, 62, &h5555FF, &h5555FF, &h0000AA
CPRINT "T", 2, 64, &hFFFFFF, &hFFFFFF, &hAAAAAA
CPRINT "O", 2, 66, &hFFFFFF, &hFFFFFF, &hAAAAAA
CPRINT "P", 2, 68, &hFF5555, &hFF5555, &hAA0000
END IF
IF SPRACHE = 4 THEN CPRINT "S T O P", 2, 62, &hAA0000, &hFFFF55, &hAA0000
IF SPRACHE = 5 THEN
CPRINT "S", 2, 62, &hFFFFFF, &h5555FF, &hFFFFFF
CPRINT "T", 2, 64, &h5555FF, &hFFFFFF, &h5555FF
CPRINT "O", 2, 66, &hFFFFFF, &h5555FF, &hFFFFFF
CPRINT "P", 2, 68, &h5555FF, &hFFFFFF, &h5555FF
END IF

CIRCLE (564, 724), 4, &hFFFFFF
CIRCLE (564, 748), 4, &hFFFFFF
CIRCLE (564, 724), 2, &h00AA00
PAINT (564, 724), &h00AA00
DIM AS Any Ptr Exitpuffer
Exitpuffer = ImageCreate(26,45)
BLOAD (ExePath & "\Exit.Stop", Exitpuffer)
PUT (990,715), Exitpuffer, PSET
IMAGEDESTROY(Exitpuffer)
END SUB

SUB TEILNEHMER

    TZAHL = 0
    FOR i = 1 TO 41
    IF SPIELER1(i) <> "" THEN TZAHL +=1
    NEXT

    TAZ = TZAHL

    IF TAZ/2 <> int(TAZ/2) then
    TAZ +=1' wenn ungerade um eins erhöhen
    ' Spieler1(TAZ) = "SPIELFREI"

ENDIF

IF TAZ > 1 THEN GRAZ = TAZ - 1 ELSE RAZ = 0
IF DOPPEL THEN RAZ = GRAZ*2 ELSE RAZ = GRAZ


ppr=TAZ/2 'Partien pro Runde
REDIM paarungen(1 to ppr, 1 to 2)

SCREENLOCK
IF SPRACHE = 1 THEN
CPRINT "TEILNEHMER: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "RUNDENZAHL: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 2 THEN
CPRINT "PLAYERS: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "ROUNDS: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 3 THEN
CPRINT "JOUEUR: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "NOMBRE DE RONDES: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 4 THEN
CPRINT "PARTICIPANTE: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "NUMERO DE RONDAS: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
IF SPRACHE = 5 THEN
CPRINT "TEILNEHMA: " + LTRIM$(STR$(TZAHL)) + " ", 92, 8, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "D'RUNDNZOI: " + LTRIM$(STR$(RAZ)) + " ", 94, 8, &hFFFFFF, &hFF55FF, &hAA00AA
END IF
SCREENUNLOCK
END SUB

sub ErstellePaarungen (rounds as integer)
  dim as integer rotation
  rotation=startwert
  for i as integer=1 to ppr
   paarungen(i,1)=rotation
   rotation +=1
    if rotation>GRAZ then rotation=1
  next i
  for i as integer=ppr to 2 step -1
    paarungen(i,2)=rotation
    rotation +=1
    if rotation>GRAZ then rotation=1
  next i
  paarungen(1,2)=TAZ





IF rounds/2 = int(rounds/2) THEN SWAP paarungen(1,1), paarungen(1,2)' bei jeder geraden Runde erstes Paar tauschen


'FOR i = 2 TO ppr
'   IF i/2 = int(i/2) THEN
'IF Runde = 1 THEN  SWAP paarungen(i,1), paarungen(i,2)' bei jeder geraden Runde erstes Paar tauschen
'   END IF
'NEXT i



' FOR i = 1 TO ppr
' IF rounds mod 2 THEN SWAP paarungen(ppr,1),paarungen(ppr,2)' bei jeder ungeraden Runde erstes Paar tauschen
' NEXT



'  FOR i AS INTEGER = 2 TO ppr
'  NEXT
END SUB

SUB AUSLOSUNG

SCREENLOCK
LOCATE 2, 120: PRINT TIME$

    FELT 475, Ry1, 1021, Ry2, &h000000: ' Paarungen

        startwert=1
sx = 1
FOR r = 1 to (RAZ)

  ErstellePaarungen (r)
  for i = 1 to ppr

LOCATE 5, 25: PRINT ""

  IF r = RUNDE AND Runde <= GRAZ THEN
    CPRINT LTRIM$(STR$(paarungen(i,1))) + " " + Spieler1(paarungen(i,1)), 12+sx, 62, &hFFFFFF, &hAAAAAA, &h555555
   CPRINT " - " , 12+sx, 92, &hFFFFFF, &hAAAAAA, &h555555
   CPRINT LTRIM$(STR$(paarungen(i,2))) + " " + Spieler1(paarungen(i,2)), 12+sx, 95, &hFFFFFF, &hAAAAAA, &h555555
  END IF

   IF r = Runde AND Runde > GRAZ THEN
   IF I = 1 THEN CPRINT LTRIM$(STR$(paarungen(i,1))) + " " + Spieler1(paarungen(i,1)), 12+sx, 62, &hFFFFFF, &hAAAAAA, &h555555
   IF I <> 1 THEN CPRINT LTRIM$(STR$(paarungen(i,2))) + " " + Spieler1(paarungen(i,2)), 12+sx, 62, &hFFFFFF, &hAAAAAA, &h555555

   CPRINT " - " , 12+sx, 92, &hFFFFFF, &hAAAAAA, &h555555
   IF I = 1 THEN CPRINT LTRIM$(STR$(paarungen(i,2))) + " " + Spieler1(paarungen(i,2)), 12+sx, 95, &hFFFFFF, &hAAAAAA, &h555555
   IF I <> 1 THEN CPRINT LTRIM$(STR$(paarungen(i,1))) + " " + Spieler1(paarungen(i,1)), 12+sx, 95, &hFFFFFF, &hAAAAAA, &h555555

   END IF



  sx +=1
  IF sx > ppr THEN sx = 1

  next i
  PRINT
  startwert=paarungen(ppr,2)
NEXT r

SCREENUNLOCK

END SUB

SUB NEU
    ERASE Spieler1
    RUNDE = 1
    RAZ = 0
    TZAHL = 0
    GRAZ = 0
    TEILNEHMER
    IF SPRACHE = 1 THEN CPRINT "RUNDE: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
    IF SPRACHE = 2 THEN CPRINT "ROUND: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
    IF SPRACHE = 3 THEN CPRINT "TOUR: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
    IF SPRACHE = 4 THEN CPRINT "RONDA: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
    IF SPRACHE = 5 THEN CPRINT "D'RUNDN: " + LTRIM$(STR$(Runde)) + " ", 7, 88, &hFFFFFF, &hFF55FF, &hAA00AA
    FELT 475, Ry1, 1021, Ry2, &h000000: ' Paarungen
    LINE (10, 67)-(460, 707), &H000000, BF
Rx1 = 10
Ry1 = 67
Rx2 = Rx1 + 450
Ry2 = Ry1 + 640
FOR Rahmen = Ry1 TO Ry2 STEP 16
LINE (Rx1 + 1,Rahmen)-(Rx2 - 1,Rahmen),&h00AA00
LINE (Rx1,Ry1)-(Rx1,Ry2), &h00AA00
LINE (Rx2,Ry1)-(Rx2,Ry2), &h00AA00


NEXT
END SUB

SUB HILFE

    SCREENLOCK
    LOCATE 2, 120: PRINT TIME$
    FELT 475, Ry1, 1021, Ry2, &h000000: ' Paarungen

CPRINT "SCHACHTURNIERORGANISATIONSPROGRAMM", 10, 80, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "S", 10, 80, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "T", 10, 86, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "O", 10, 93, &hFFFFFF, &h55FFFF, &h00AAAA
CPRINT "P", 10, 106, &hFFFFFF, &h55FFFF, &h00AAAA

IF SPRACHE = 1 THEN
CPRINT "Vollversion: 40 Teilnehmer, 39 Runden, 2 Systeme", 14, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Tastenfunktionen/Mausfunktionen:", 18, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "F1 ODER H ODER MAUSKLICK = HILFE", 20, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "L ODER MAUSKLICK = LADEN", 22, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "S ODER MAUSKLICK = SPEICHERN", 24, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "N ODER MAUSKLICK = GRUNDZUSTAND (ALLES L™SCHEN)", 26, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "LEERTASTE ODER MAUSKLICK = AUSLOSUNG", 28, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "+ UND - TASTE = WAHL DER RUNDEN VON 1-39", 30, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "PFEILTASTEN ODER MAUSKLICK = WAHL DER SYSTEME", 32, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MAUSKLICK IN EINES DER LINKEN GRšNEN FELDER = NAME EINGEBEN", 34, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Bedienung:", 38, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "UM DIE NAMEN EINZUGEBEN KLICKEN SIE MIT DER MAUS LINKS IN DAS", 40, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ERSTE EINGABEFELD DER GRUENEN TABELLE. SIE K™NNEN DANN DAS GANZE", 42, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "DURCH MAUSKLICK AUF SPEICHERN ODER MIT S-TASTE SPEICHERN. DURCH", 44, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MAUSKLICK AUF LADEN ODER MIT L-TASTE KANN MAN EIN GESPEICHERTES", 46, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TURNIER DURCH EINGABE EINES NAMEN IM EINGABEFELD OBEN NEBEN DEM", 48, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "STOP ™FFNEN. KLICKT MAN MIT DER MAUS AUF AUSLOSUNG ODER DRšCKT DIE", 50, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPACETASTE, SO WIRD DAS TURNIER IN DEM JEWEILIGEN VORHER", 52, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "EINGESTELLTEN MODUS AUSGELOST. MIT DEN PFEILTASTEN NACH-UNTEN/OBEN", 54, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ODER MIT DER MAUS K™NNEN SIE DEN GEWšNSCHTEN MODUS EINSTELLEN.", 56, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "DIE ERGEBNISSE KANN MAN EINGEBEN WENN MAN TASTE E DRšCKT ODER", 58, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MIT DER MAUS AUF ERGEBNISSE KLICKT. NACHDEM EINE KREUZTABELLE", 60, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "AUF DEM BILDSCHIRM ZU SEHEN IST, KANN MAN DURCH EINEN MAUSKLICK", 62, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IN EINES DER ENTSPRECHENDEN FELDER DER TABELLE DIE PUNKTE EINGEBEN", 64, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ERLAUBT IST 1, 0, +, -, 5; DA ES BEIM SCHACH AUCH SONDERERGEBNISSE", 66, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "WIE 0.5-0 GIBT, WIRD AN EINER ENTSPRECHENDEN L™SUNG GEARBEITET.", 68, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MIT KLICK AUF RANGLISTE SIEHT MAN, WER WO AUF WELCHEM PLATZ STEHT.", 70, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "6", 72, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ESCAPE-TASTE ODER EIN MAUSKLICK AUF DIE TšR BEENDET DAS PROGRAMM.", 74, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "8", 76, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "9", 78, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "10", 80, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Dieses Programm wurde mit Freebasic Version 23.0 geschrieben", 82, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "12", 84, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Version 2.02", 86, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Programmiert 2012 von ALWIM", 88, 62, &hFFFFFF, &hAAAAAA, &h555555
END IF
IF SPRACHE = 2 THEN
CPRINT "Fullversion: 40 Players, 39 Rounds, 2 Systems", 14, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Keyfunctions/Mousefunctions:", 18, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "F1 OR H OR MOUSECLICK = HELP", 20, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "L OR MOUSECLICK = LOAD", 22, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "S OR MOUSECLICK = SAVE", 24, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "N OR MOUSECLICK = BASIC STATE (ALL DELETE)", 26, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPACEKEY OR MOUSECLICK = PAIRING", 28, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "+ UND - KEY = CHOICE OF THE ROUNDS FROM 1-39", 30, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ARROWKEY OR MOUSECLICK = CHOICE OF THE SYSTEMS", 32, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSECLICK IN ONE OF THE LEFT GREEN FIELDS = EDIT NAME", 34, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Handling:", 38, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TO EDIT THE NAMES THEY CLICK WITH THE MOUSE IN THE LEFT INPUT", 40, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "FIELD OF THE GREEN TABLE. THEN YOU CAN SAVE ALL WITH A", 42, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSECLICK ON SAVE OR WITH THE KEY S. BY MOUSECLICK ON STORE", 44, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "OR WITH L KEY YOU CAN OPEN A STORED TOURNAMENT BY INPUT OF A NAME", 46, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IN THE INPUT FIELD ON TOP BESIDE THE STOP.", 48, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IF YOU CLICK ON THE PAIRING-BUTTON WITH THE MOUSE OR WITH THE", 50, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPACE-KEY THEN YOU GET THE PAIRING FROM THE SELECTED", 52, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TOURNAMENT SYSTEM. WITH THE ARROW-KEYS OR WITH THE MOUSE", 54, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN SELECT THE DESIRED ONES TOURNAMENT SYSTEM.", 56, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN INPUT THE RESULTS IF YOU PRESS E OR WITH THE", 58, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSE THE RESULTS-BUTTON. IF YOU CAN SEE A CROSSTABLE AND YOU", 60, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "CLICK WITH THE MOUSE IN ONE OF THE FIELDS THEN YOU CAN", 62, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "INPUT THE RESULTS. YOU CAN INPUT: 1, 0, +, -, 5. IN CHESS WE", 64, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "HAVE SPECIAL RESULTS. ONE OF THE SPECIAL RESULTS IS: 0.5-0", 66, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "WE HAVE MANY SPECIAL RESULTS AND I WORK ON A SUITABLE SOLUTION!", 68, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "BY CLICK ON THE RANKING-BUTTON YOU CAN SEE THE FINAL PLACES.", 70, 62, &hFFFFFF, &hAAAAAA, &h555555
'  CPRINT "6", 72, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN CLOSE THE PROGRAMM WITH ESC OR A MOUSECLICK ON THE DOOR.", 74, 62, &hFFFFFF, &hAAAAAA, &h555555
'  CPRINT "8", 76, 62, &hFFFFFF, &hAAAAAA, &h555555
'  CPRINT "9", 78, 62, &hFFFFFF, &hAAAAAA, &h555555
'  CPRINT "10", 80, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Programm was compiled with Freebasic Version 23.0", 82, 62, &hFFFFFF, &hAAAAAA, &h555555
'  CPRINT "12", 84, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Version 2.02 Beta", 86, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Code is written 2012 by ALWIM", 88, 62, &hFFFFFF, &hAAAAAA, &h555555
END IF
IF SPRACHE = 3 THEN
CPRINT "Une pleine version: 40 Joueur, 39 Tours, 2 Systemes", 14, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Fonctions de clavier/Fonctions de souris:", 18, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "F1 OU A OU CLIC DE SOURIS = AIDE", 20, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "C OU CLIC DE SOURIS = CHARGER", 22, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "S OU CLIC DE SOURIS = SAUVEGARDER", 24, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "N OU CLIC DE SOURIS = ETAT PRINCIPAL (TOUT EFFACENT)", 26, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "BARRE D'ESPACEMENT OU CLIC DE SOURIS = TIRAGE AU SORT", 28, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "+ ET - TOUCHE = ELECTION DES TOURS DE DU 1 AU 39", 30, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TOUCHES DE FLECHE OU CLIC DE SOURIS = ELECTION DES SYSTEMES", 32, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "CLIC DE SOURIS DANS L'UN DES CHAMPS VERTS GAUCHES = LE NOM ENTRENT", 34, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Handling:", 38, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TO EDIT THE NAMES THEY CLICK WITH THE MOUSE IN THE LEFT INPUT", 40, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "FIELD OF THE GREEN TABLE. THEN YOU CAN SAVE ALL WITH A", 42, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSECLICK ON SAVE OR WITH THE KEY S. BY MOUSECLICK ON STORE", 44, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "OR WITH L KEY YOU CAN OPEN A STORED TOURNAMENT BY INPUT OF A NAME", 46, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IN THE INPUT FIELD ON TOP BESIDE THE STOP.", 48, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IF YOU CLICK ON THE PAIRING-BUTTON WITH THE MOUSE OR WITH THE", 50, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPACE-KEY THEN YOU GET THE PAIRING FROM THE SELECTED", 52, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TOURNAMENT SYSTEM. WITH THE ARROW-KEYS OR WITH THE MOUSE", 54, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN SELECT THE DESIRED ONES TOURNAMENT SYSTEM.", 56, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN INPUT THE RESULTS IF YOU PRESS E OR WITH THE", 58, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSE THE RESULTS-BUTTON. IF YOU CAN SEE A CROSSTABLE AND YOU", 60, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "CLICK WITH THE MOUSE IN ONE OF THE FIELDS THEN YOU CAN", 62, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "INPUT THE RESULTS. YOU CAN INPUT: 1, 0, +, -, 5. IN CHESS WE", 64, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "HAVE SPECIAL RESULTS. ONE OF THE SPECIAL RESULTS IS: 0.5-0", 66, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "WE HAVE MANY SPECIAL RESULTS AND I WORK ON A SUITABLE SOLUTION!", 68, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "BY CLICK ON THE RANKING-BUTTON YOU CAN SEE THE FINAL PLACES.", 70, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "6", 72, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN CLOSE THE PROGRAMM WITH ESC OR A MOUSECLICK ON THE DOOR.", 74, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "8", 76, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "9", 78, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "10", 80, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Programm was compiled with Freebasic Version 23.0", 82, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "12", 84, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Version 2.02 Beta", 86, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Code is written 2012 by ALWIM", 88, 62, &hFFFFFF, &hAAAAAA, &h555555
END IF
IF SPRACHE = 4 THEN
CPRINT "Versi¢n llena: 40 Participante, 39 Rondes, 2 Systemes", 14, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Funci¢n de teclas/Funci¢n de rat¢n:", 18, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "F1 O U O CLIC DE RATON = AYUDA", 20, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "A O CLIC DE RATON = ABRIR", 22, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "G O CLIC DE RATON = GUARDAR", 24, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "N O CLIC DE RATON = EL ESTADO BASICO (TODO APAGAN)", 26, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ESPACIADOR O CLIC DE RATON = EMPAREJAMIENTO", 28, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "+ Y - TECLA = ELECCION DE LOS C¡RCULOS DE 1-39", 30, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TECLA DE FLECHA = ELECCION DE LOS SISTEMAS", 32, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "CLIC DE RATON EN UN DE LOS CAMPOS VERDES ENGA¥OSOS = EL NOMBRE DAN", 34, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Handling:", 38, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "TO EDIT THE NAMES THEY CLICK WITH THE MOUSE IN THE LEFT INPUT", 40, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "FIELD OF THE GREEN TABLE. THEN YOU CAN SAVE ALL WITH A", 42, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSECLICK ON SAVE OR WITH THE KEY S. BY MOUSECLICK ON STORE", 44, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "OR WITH L KEY YOU CAN OPEN A STORED TOURNAMENT BY INPUT OF A NAME", 46, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IN THE INPUT FIELD ON TOP BESIDE THE STOP.", 48, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IF YOU CLICK ON THE PAIRING-BUTTON WITH THE MOUSE OR WITH THE", 50, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPACE-KEY THEN YOU GET THE PAIRING FROM THE SELECTED", 52, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "TOURNAMENT SYSTEM. WITH THE ARROW-KEYS OR WITH THE MOUSE", 54, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN SELECT THE DESIRED ONES TOURNAMENT SYSTEM.", 56, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN INPUT THE RESULTS IF YOU PRESS E OR WITH THE", 58, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MOUSE THE RESULTS-BUTTON. IF YOU CAN SEE A CROSSTABLE AND YOU", 60, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "CLICK WITH THE MOUSE IN ONE OF THE FIELDS THEN YOU CAN", 62, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "INPUT THE RESULTS. YOU CAN INPUT: 1, 0, +, -, 5. IN CHESS WE", 64, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "HAVE SPECIAL RESULTS. ONE OF THE SPECIAL RESULTS IS: 0.5-0", 66, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "WE HAVE MANY SPECIAL RESULTS AND I WORK ON A SUITABLE SOLUTION!", 68, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "BY CLICK ON THE RANKING-BUTTON YOU CAN SEE THE FINAL PLACES.", 70, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "6", 72, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "YOU CAN CLOSE THE PROGRAMM WITH ESC OR A MOUSECLICK ON THE DOOR.", 74, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "8", 76, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "9", 78, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "10", 80, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Programm was compiled with Freebasic Version 23.0", 82, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "12", 84, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Version 2.02 Beta", 86, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "This Code is written 2012 by ALWIM", 88, 62, &hFFFFFF, &hAAAAAA, &h555555
END IF
IF SPRACHE = 5 THEN
CPRINT "Voiversion: 40 de mitspuin, 39 Rund'n, 2 Systeme", 14, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Tast'nfunktionen/Hutsch'nfunktionen:", 18, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "-WOS HODA DEN- TAST'N ODA H ODA A HUTSCH'NKLICK = HUIFE", 20, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "L ODA A HUTSCH'NKLICK = A OID'S SPUI HOIN", 22, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "S ODA A HUTSCH'NKLICK = OIS SICHERN", 24, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "N ODA A HUTSCH'NKLICK = VO BEGINN O (OIS L™SCH'N)", 26, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "A GSCHBAAá MUAá SEI TAST'N ODA HUTSCH'NKLICK = WER SPUIT GEGN WEN", 28, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "+ UND - TAST'N = WAHL DER RUND'N VO 1-39", 30, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "UMITAST'N ODA HUTSCH'NKLICK = WAHL DER SYSTEME", 32, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "HUTSCH'NKLICK IN OANS DER LINK'N GREANA FELDA = NAMA EINIGEBEN", 34, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Wia funktioniert des ois:", 38, 62, &hFFFFFF, &hFF55FF, &hAA00AA
CPRINT "UM DE NAMA EINITIPPA ZU KINNA, KLICKST MIT DA HUTSCH'N LINGGS IN'S", 40, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ERSTE FELD VO DA GREANA TABELLN. DURCH AN HUTSCH'NKLICK", 42, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "AF OIS SICHERN ODA MIT DA S-TAST'N WIRD OIS G'SICHERT. DURCH", 44, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "HUTSCH'NKLICK AF LADN ODA MIT DA L-TAST'N KO MA A G'SICHERT'S", 46, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "SPUI MIT AN NAMA IM FELD OBA NEBA DEM STOP AUFMACHA.", 48, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "KLICKT MA MIT DA HUTSCH'N AF WER SPUIT GEGA WEN ODA DRUGG'T", 50, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "AF DE -A GSCHBAAá MUAá SEI- TAST'N, SO WIRD DES TURNIER", 52, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IM FOAHEA EIG'STELLTEN MODUS AUSG'LOST. MIT DE TAST'N AUFI/OBI", 54, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ODA MIT DA HUTSCH'N KENNA'S DEN G'WšNSCHTEN MODUS EI'STELLN.", 56, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "DE ERGEBNISSE KO MA EINIGEBEN WENN MA TAST'N E DRUGGT ODA", 58, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MIT DA HUTSCH'N AF ERGEBNISSE KLICKT. SO BAID MA A GRAIZTABELLN", 60, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "OIS BUIDL AUF'M KOMBUDA SIGG'T, KO MA MIT AN HUTSCH'NKLICK", 62, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "IN OANS DA FELDA VO DA TABELLN DE PUNKTE EINIGEBEN. ERLAUBT IS", 64, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "1, 0, +, -, 5; BEIM SCHACHSPUI GIBT'S A B'SONDERE ERGEBNISSE", 66, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "WIA 0.5-0. MIT SOWOS KO MEI PROGRAMM NO NIX OFANGA.", 68, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "MIT AN KLICK AF DE RANGLISTN SIGG'T MA, WER WO G'LANDT IS.", 70, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "6", 72, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "ZUPF DI-TAST'N ODA A HUTSCH'NKLICK AF DE DIAR SCHLIASST'S GANZE.", 74, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "8", 76, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "9", 78, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "10", 80, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Des schreib i oiwei mit'm Freebasic 23.0 Compiler", 82, 62, &hFFFFFF, &hAAAAAA, &h555555
' CPRINT "12", 84, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "Version 2.02 Beta", 86, 62, &hFFFFFF, &hAAAAAA, &h555555
CPRINT "G'schrim hot's 2012 da ALWIM", 88, 62, &hFFFFFF, &hAAAAAA, &h555555
END IF
SCREENUNLOCK
END SUB

SUB LOAD
    DateiName = LoadSaveDialog (,fil,1,,"ESK")
    F = FREEFILE
IF DateiName <> "" THEN NEU
OPEN DateiName FOR INPUT AS #F
INPUT #F, TZAHL
FOR I = 1 TO TZAHL STEP 1
INPUT #F, Spieler1(I)
NEXT
CLOSE #F
XX = 10
FOR I = 1 TO TZAHL
CPRINT SPIELER1(I) + " ", XX, 3, &hFFFFFF, &hAAAAAA, &h555555
XX = XX + 2
NEXT
TEILNEHMER
END SUB

SUB SPEICHERN
    DateiName = LoadSaveDialog (1,fil,1,,"ESK")

F = FREEFILE
OPEN DateiName FOR OUTPUT AS #F

PRINT #F, TZAHL

FOR I = 1 TO TAZ STEP 1
PRINT #F, Spieler1(I)
NEXT

CLOSE #F

IF FileExists(DateiName) AND SPRACHE = 1 THEN MessageBox(0, "Turnier gespeichert!!!", "STOP", MB_ICONINFORMATION)
IF FileExists(DateiName) AND SPRACHE = 2 THEN MessageBox(0, "Tournament stored!!!", "STOP", MB_ICONINFORMATION)
IF FileExists(DateiName) AND SPRACHE = 3 THEN MessageBox(0, "Tournoi sauvegardé!!!", "STOP", MB_ICONINFORMATION)
IF FileExists(DateiName) AND SPRACHE = 4 THEN MessageBox(0, "Competición guardado!!!", "STOP", MB_ICONINFORMATION)
IF FileExists(DateiName) AND SPRACHE = 5 THEN MessageBox(0, "G'sichert host des Spui!!!", "STOP", MB_ICONINFORMATION)
END SUB

Function LoadSaveDialog (savedlog As Integer, filter As String, fltrindex As Integer,_
                         initdir As String, strDefExt As String) As String
  Dim FB_OFN AS OPENFILENAME
   FB_OFN.lStructSize = Len(FB_OFN)
   FB_OFN.hwndOwner = 0 ' nur Console
   FB_OFN.hInstance = 0

   Dim strFilter As String
   If filter = "" Then
      strFilter = "Alle Dateien (*.*)" + Chr(0) +"*.*" + Chr(0, 0) 'Vorgabe
   Else
      strFilter = filter + Chr(0, 0)
   End If
   FB_OFN.lpstrFilter = StrPtr(strFilter)
   FB_OFN.nFilterIndex = fltrindex

   Dim strFile As String *2048
   strFile = Space(2047) + Chr(0)
   FB_OFN.lpstrFile = StrPtr(strFile)
   FB_OFN.nMaxFile = Len(strFile)

   Dim strFileTitle As String *2048
   strFileTitle = String(2048, 0)
   FB_OFN.lpstrFileTitle = StrPtr(strFileTitle)
   FB_OFN.nMaxFileTitle = Len(strFileTitle)

   Dim strdrstr As String
   If initdir = "" Then
      strdrstr = "."     ' Vorgabe aktueller Pfad
   Else
      strdrstr = initdir
   End If
   FB_OFN.lpstrInitialDir = StrPtr(strdrstr)

   Dim strcapt As String
   If savedlog Then
  IF SPRACHE = 1 THEN strcapt = "Dateien Speichern"
  IF SPRACHE = 2 THEN strcapt = "Store Files"
  IF SPRACHE = 3 THEN strcapt = "Des fichiers sauvegardent"
  IF SPRACHE = 4 THEN strcapt = "Ficheros guardan"
  IF SPRACHE = 5 THEN strcapt = "Ois sichern"
      FB_OFN.lpstrTitle = StrPtr(strcapt)
      If strDefExt > "" Then
         Dim strdext As String
         strdext = strDefExt
         FB_OFN.lpstrDefExt = StrPtr(strdext)
      End If
      FB_OFN.flags = OFN_EXPLORER Or OFN_LONGNAMES Or OFN_OVERWRITEPROMPT Or OFN_HIDEREADONLY
      If GetSaveFileName(@FB_OFN) Then LoadSaveDialog = Trim(strFile)
   ELSE
  IF SPRACHE = 1 THEN strcapt = "Dateien öffnen"
  IF SPRACHE = 2 THEN strcapt = "Load Files"
  IF SPRACHE = 3 THEN strcapt = "Des fichiers ouvrent"
  IF SPRACHE = 4 THEN strcapt = "Ficheros abren"
  IF SPRACHE = 5 THEN strcapt = "A g'speicherts afmocha"
      FB_OFN.lpstrTitle = StrPtr(strcapt)
      FB_OFN.flags = OFN_EXPLORER Or OFN_LONGNAMES Or OFN_CREATEPROMPT Or _
                     OFN_NODEREFERENCELINKS Or OFN_HIDEREADONLY
      If GetOpenFileName(@FB_OFN) Then LoadSaveDialog = Trim(strFile)
   End If
End FUNCTION