English
Source / code snippets

Zahlenschloss

 

p.specht

an Eigenheit of XProfan-11´s Clicked()-commands: it shining The Auswertung the internen %Key-Variable To hinder. therefore functions the nachstehende, something naively programmed Zahlenschloss (Democode: "12345", C = CLEAR) only ENTWEDER with Keyboard-input ODER with Mausklicks on The Buttons, in the letzteren drop is then though no Keyboardeingabe More possible. The Übergang of Keyboard To mouse works but.
Window Title "  ZAHLENSCHLOSS ":Window Style 24
'(D) demonstration 2017-10 by P.woodpecker, Wien. OHNE EACH GEWÄHR!
'Profan-Eigenheit: Mausverwendung toggles Keyboardeingabe ex!
Window %maxx\2-75,(%maxy\2-75) - 166,148
var hdl1&=@Create("Button",%hwnd,"1", 00,00, 40,30)
var hdl2&=@Create("Button",%hwnd,"2", 40,00, 40,30)
var hdl3&=@Create("Button",%hwnd,"3", 80,00, 40,30)
var hdld&=@Create("Button",%hwnd,"C",120,00, 40,30)
var hdl4&=@Create("Button",%hwnd,"4", 00,30, 40,30)
var hdl5&=@Create("Button",%hwnd,"5", 40,30, 40,30)
var hdl6&=@Create("Button",%hwnd,"6", 80,30, 40,30)
var hdlm&=@Create("Button",%hwnd,">",120,30, 40,30)
var hdl7&=@Create("Button",%hwnd,"7", 00,60, 40,30)
var hdl8&=@Create("Button",%hwnd,"8", 40,60, 40,30)
var hdl9&=@Create("Button",%hwnd,"9", 80,60, 40,30)
var hdls&=@Create("Button",%hwnd,"<",120,60, 40,30)
var hdlk&=@Create("Button",%hwnd,",", 00,90, 40,30)
var hdl0&=@Create("Button",%hwnd,"0", 40,90, 80,30)
var hdlg&=@Create("Button",%hwnd,"=",120,90, 40,30)
declare Ende&,s$,n&,key&

WHILENOT Ende&

    waitinput:key&=%key

    IF key&

        If key&=ord("1"):inc n&:Window Title st$(n&)+":1":s$=s$+"1"

        ElseIf key&=ord("2"):inc n&:Window Title st$(n&)+":2":s$=s$+"2"

        ElseIf key&=ord("3"):inc n&:Window Title st$(n&)+":3":s$=s$+"3"

        ElseIf (key&=ord("c")) or (key&=ord("C"))

            n&=0:Window Title st$(int(n&+1))+": ":s$=""

        ElseIf key&=ord("4"):inc n&:Window Title st$(n&)+":4":s$=s$+"4"

        ElseIf key&=ord("5"):inc n&:Window Title st$(n&)+":5":s$=s$+"5"

        ElseIf key&=ord("6"):inc n&:Window Title st$(n&)+":6":s$=s$+"6"

        ElseIf key&=ord(">"):inc n&:Window Title st$(n&)+":>":s$=s$+">"

        ElseIf key&=ord("7"):inc n&:Window Title st$(n&)+":7":s$=s$+"7"

        ElseIf key&=ord("8"):inc n&:Window Title st$(n&)+":8":s$=s$+"8"

        ElseIf key&=ord("9"):inc n&:Window Title st$(n&)+":9":s$=s$+"9"

        ElseIf key&=ord("<"):dec n&:case n&<0:n&=0

            Window Title st$(int(n&+1))+":":
            s$=left$(s$,len(s$)+if(len(s$)>2,-1,0))

        ElseIf key&=ord(","):inc n&:Window Title st$(n&)+":,":s$=s$+","

        ElseIf key&=ord("0"):inc n&:Window Title st$(n&)+":0":s$=s$+"0"

        ElseIf key&=ord("="):Window Title st$(n&)+":="+s$:waitinput 2000

            Ende&=1:Window Title "Wiedersehen!":waitinput 2000:END

        endif

    ELSE

        If Clicked(hdl1&):inc n&:Window Title st$(n&)+":1":s$=s$+"1"

        ElseIf Clicked(hdl2&):inc n&:Window Title st$(n&)+":2":s$=s$+"2"

        ElseIf Clicked(hdl3&):inc n&:Window Title st$(n&)+":3":s$=s$+"3"

        ElseIf Clicked(hdld&):n&=0:Window Title st$(int(n&+1))+": ":s$=""

        ElseIf Clicked(hdl4&):inc n&:Window Title st$(n&)+":4":s$=s$+"4"

        ElseIf Clicked(hdl5&):inc n&:Window Title st$(n&)+":5":s$=s$+"5"

        ElseIf Clicked(hdl6&):inc n&:Window Title st$(n&)+":6":s$=s$+"6"

        ElseIf Clicked(hdlm&):inc n&:Window Title st$(n&)+":>":s$=s$+">"

        ElseIf Clicked(hdl7&):inc n&:Window Title st$(n&)+":7":s$=s$+"7"

        ElseIf Clicked(hdl8&):inc n&:Window Title st$(n&)+":8":s$=s$+"8"

        ElseIf Clicked(hdl9&):inc n&:Window Title st$(n&)+":9":s$=s$+"9"

        ElseIf Clicked(hdls&):dec n&:case n&<0:n&=0:Window Title st$(int(n&+1))+":"

            case len(s$):s$=left$(s$,len(s$)-1)

        ElseIf Clicked(hdlk&):inc n&:Window Title st$(n&)+":,":s$=s$+","

        ElseIf Clicked(hdl0&):inc n&:Window Title st$(n&)+":0":s$=s$+"0"

        ElseIf Clicked(hdlg&):inc n&:Window Title st$(n&)+":="+s$:Ende&=1

            waitinput 2000:Window Title "Wiedersehen!":waitinput 2000:END

        endif

    ENDIF

    'Auswertung (These Version yet without Obfuscator):

    if (n&=5) and (s$="12345")

        cls 0:font 2
        waitinput 1000
        beep
        print "\n\n\n   k O R R E k T !  "
        waitinput 3000
        break

    endif

EndWhile

CLS
DestroyWindow(hdl1&)
DestroyWindow(hdl2&)
DestroyWindow(hdl3&)
DestroyWindow(hdld&)
DestroyWindow(hdl4&)
DestroyWindow(hdl5&)
DestroyWindow(hdl6&)
DestroyWindow(hdlm&)
DestroyWindow(hdl7&)
DestroyWindow(hdl8&)
DestroyWindow(hdl9&)
DestroyWindow(hdls&)
DestroyWindow(hdlk&)
DestroyWindow(hdl0&)
DestroyWindow(hdlg&)
Windowtitle "Geschützt:"
Window 0,0-%maxx,%maxy:cls 0:showmax
PRINT "                   "
PRINT "HIER WÜRDE DANN DAS"
PRINT "GESCHÜTZTE PROGRAMM"
PRINT "GESTARTET ODER ONE "
PRINT "ELEMENT ANGEZEIGT! "
PRINT "                   "
PRINT "==================="
PRINT "THANKS FOR TESTING!"
PRINT "===================";
waitinput 6000
END
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/25/21  
 




p.specht

XOR-Obfuskator against nosy Nasen, The whom Zahlenschloss-code from the Source read want
windowstyle 24:Windowtitle "For your eyes only, XOR!":cls
declare a$,b$,c$,d$
'c$="Geheim-Schlüssel"
c$="#IB&H	…"
a$="For your eyes only! 0123456789+-*:"
'a$="":whileloop 0,255:a$=a$+chr$(& Loop):endwhile
Start:
font 2:print "\n secret message: ":font 0:print a$
font 2:print "\n     XOR-Key: ":font 0:print c$
b$="":case c$="":c$=chr $(0)

whileloop len(a$)

    b$=b$+chr $(xor(ord(mid$(a$,&Loop,1)),ord(mid$(c$,(&Loop mod len(c$))+1,1))))

endwhile

font 2:print "\n           boxnumber: ":font 0:print b$
clearclip:putclip b$
font 2:print " ==> Clipboard!"
d$=""

whileloop len(b$)

    d$=d$+chr $(xor(ord(mid$(b$,&Loop,1)),ord(mid$(c$,(&Loop mod len(c$))+1,1))))

endwhile

font 2:print "\n      Dechiffriert: "
font 0:print d$
print

if a$<>d$:font 2:print "\n *** ERROR ***":sound 2000,2000:waitinput

endif

waitinput
cls
print "\n your Geheimbotschaft: ";
Input a$
goto "Start"
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/25/21  
 



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

1.702 Views

Untitledvor 0 min.
Member 862464105/12/24
Heiko Dix10/30/23
Axel Berse08/13/23
Rschnett08/06/22
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (2x)


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