Servus ![]()
Ich bin auf folgende Seite gestoßen: http://www.mathematische-basteleien.de/huepfer.htm
Das fand ich so interessant, dass ich gleich eine eigene Implantation in AutoIt schreiben musste.
Ist nichts dolles, aber es macht Spaß damit herumzuspielen. Versucht es selber mal! ![]()
Spoiler anzeigen
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]#include <GDIPlus.au3>
#include <GUIConstants.au3>
Opt('GUIOnEventMode', 1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]; > Hier kannst du herumspielen! ![]()
Global Const $iWidth = 800
Global Const $iHeight = 600
Global Const $fA = -70
Global Const $fB = 100
Global Const $fC = 0
Global Const $iNum = 150000
Func Term($fA, $fB, $fC, $fX, $fY)
Return $fY - SIGN($fX) * Abs($fB * $fX - $fC) ^ 0.5
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Global Const $fU = $iWidth / 2
Global Const $fV = $iHeight / 2
Global $hGUI, $hGraphics, $i, $fX, $fY, $fX2, $fY2
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate('Hüpfer [Make-Grafik]', $iWidth, $iHeight)
GUISetOnEvent($GUI_EVENT_CLOSE, GUI_EVENT_CLOSE)
GUISetState()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To $iNum
_GDIPlus_GraphicsFillRect($hGraphics, $fU + $fX, $fV + $fY, 1, 1)
$fX2 = Term($fA, $fB, $fC, $fX, $fY)
$fY2 = $fA - $fX
$fX = $fX2
$fY = $fY2
Next
ConsoleWrite('! Finish' & @CRLF)
[/autoit] [autoit][/autoit] [autoit]While Sleep(1000)
WEnd
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Func SIGN($fValue)
If $fValue < 0 Then
Return -1
ElseIf $fValue > 0 Then
Return 1
EndIf
EndFunc
Func GUI_EVENT_CLOSE()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit]