English
Source / code snippets

letters shook

 

H.Brill
here time one puzzel, inspired by the Sonntags-Bildzeitung :
 $H windows.ph
 $H commctrl.ph
Declare lever ilist, tblist, hPic, icon, Btn1, Btn2, Btn3
Declare Long IconListe[], x, end, xoff, yoff
Declare String letters[], character, w1, w2, w3, Line1, row2, row3
Line1 = "KALKULATION"
row2 = "ALKALI"
row3 = "UNIKAT"
w1 = ""
end = 0
xoff = ~GetSystemMetrics(32)
yoff = ~GetSystemMetrics(4) + xoff
Window Title "Geschüttelte Buchstaben"
Window 780, 400
Btn1 = Create("Button", %HWnd, "Fertig", 600, 10, 60, 25)
Btn2 = Create("Button", %HWnd, "New",    600, 40, 60, 25)
Btn3 = Create("Button", %HWnd, "Ende",   600, 300, 60, 25)
DrawText 10,  5, "Bilde from under stehenden letters three Wörter."
DrawText 10, 20, "Die Definitionen should thereby help."
DrawText 10, 35, "Ziehe with the mouse The letters nacheinander into Kästen."
DrawText 10, 50, "If any Wörter prepares are, press ready to that Überprüfen."
InitIconListe()
DrawText 10, 150, "Kostenvoranschlag :"
RectAngle 200, 140, 680, 180
DrawText 10, 200, "laugenartige link :"
RectAngle 200, 190, 680, 230
DrawText 10, 250, "ein single Piece :"
RectAngle 200, 240, 680, 280

WhileNot end

    WaitInput

    If Mouse(20, 80 - 52, 112)

        DoDragDrop(0)

    ElseIf Mouse(70, 80 -  102, 112)

        DoDragDrop(1)

    ElseIf Mouse(120, 80 - 152, 112)

        DoDragDrop(2)

    ElseIf Mouse(170, 80 - 202, 112)

        DoDragDrop(3)

    ElseIf Mouse(220, 80 - 252, 112)

        DoDragDrop(4)

    ElseIf Mouse(270, 80 - 302, 112)

        DoDragDrop(5)

    ElseIf Mouse(320, 80 - 352, 112)

        DoDragDrop(6)

    ElseIf Mouse(370, 80 - 402, 112)

        DoDragDrop(7)

    ElseIf Mouse(420, 80 - 452, 112)

        DoDragDrop(8)

    ElseIf Mouse(470, 80 - 502, 112)

        DoDragDrop(9)

    ElseIf Mouse(520, 80 - 552, 112)

        DoDragDrop(10)

    ElseIf Clicked(Btn1)

        ' ready

        If w1 = Line1

            DrawIcon tblist, 60, 700, 150

        Else

            DrawIcon tblist, 10, 700, 150

        EndIf

        If w2 = row2

            DrawIcon tblist, 60, 700, 200

        Else

            DrawIcon tblist, 10, 700, 200

        EndIf

        If w3 = row3

            DrawIcon tblist, 60, 700, 250

        Else

            DrawIcon tblist, 10, 700, 250

        EndIf

    ElseIf Clicked(Btn2)

        ' New
        RectAngle 200, 140, 680, 180
        RectAngle 200, 190, 680, 230
        RectAngle 200, 240, 680, 280
        DrawIcon tblist, 32, 700, 150
        DrawIcon tblist, 32, 700, 200
        DrawIcon tblist, 32, 700, 250
        w1 = ""
        w2 = ""
        w3 = ""

    ElseIf Clicked(Btn3)

        end = 1

    EndIf

EndWhile

Proc InitIconListe

    Declare lever hIcon, tbpic
    letters[] = Explode("A,L,T,u,k,I,L,A,O,k,N", ",")
    MCls 32, 32, RGB(192, 192, 192)
    ilist = Create("ImageList", 32, 32)

    WhileLoop 0, 10

        hPic = Create("HPIC", 0, "&MEMBMP")
        StartPaint hPic
        UseFont "ARIAL", 24, 18, 1, 0, 0
        DrawText 16, 4, letters[&LOOP], 6
        EndPaint
        ImageList("Add", ilist, hPic)

    EndWhile

    x = 20

    WhileLoop 0, 10

        DrawIcon ilist, &LOOP, x, 80
        Inc x, 50

    EndWhile

    tbpic = Create("hSizedPic", 0, "TOOLBAR", 2368, 32, 0)
    tblist = Create("ImageList", 32, 32, tbpic)
    DrawIcon tblist, 32, 700, 150
    DrawIcon tblist, 32, 700, 200
    DrawIcon tblist, 32, 700, 250
    DeleteObject tbpic

ENDPROC

Proc DoDragDrop

    Parameters Long ix
    character = letters[ix]
    ~ImageList_BeginDrag(ilist, ix, (%MouseX - xoff - %MouseX), (%MouseY  - yoff  - 100))
    ~ImageList_DragEnter(%HWnd, %MouseX, %MouseY)

    While %MousePressed

        ~ImageList_DragMove(%MouseX, %MouseY)

    EndWhile

    ~ImageList_EndDrag()

    If Between(%MouseX, 200, 680, %MouseY, 140, 180)

        w1 = w1 + character
        DrawIcon ilist, ix, %MouseX , 145

    ElseIf Between(%MouseX, 200, 680, %MouseY, 190, 230)

        w2 = w2 + character
        DrawIcon ilist, ix, %MouseX , 195

    ElseIf Between(%MouseX, 200, 680, %MouseY, 240, 280)

        w3 = w3 + character
        DrawIcon ilist, ix, %MouseX , 245

    EndIf

ENDPROC

DeleteObject ilist, tblist, hPic
End

plenty Fun so
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
09/26/23  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

736 Views

Untitledvor 0 min.
E.T. vor 20 Tagen
Karsten Mört07/19/24
Thomas Freier01/06/24
Michael W.12/08/23
More...

Themeninformationen

this Topic has 1 subscriber:

H.Brill (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie