Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <ListboxConstants.au3>
#include <TabConstants.au3>
#include <Constants.au3>
$haupt = GUICreate("Titel", @desktopwidth/2, @desktopheight/2)
$Buchstabe = 0
GUISetState(@sw_show)
$eingabe = GUICtrlCreateEdit("Hier den zu analysierenden Text eingeben", 0,0,@desktopwidth/2-50, @desktopheight/2, $LBS_DISABLENOSCROLL + $WS_VSCROLL)
$menu = GUICtrlCreateMenu("Analysieren")
$menu2 = GUICtrlCreateMenuItem("Los", $menu)
;~ $but = GUICtrlCreateButton("OK", @desktopwidth/2-20, -1)
Global $a=0, $b=0, $c=0, $d=0, $e=0, $f=0, $g=0, $h=0, $i=0, $j=0, $k=0, $l=0, $m=0, $n=0, $o=0, $p=0, $q=0, $r=0, $s=0, $t=0, $u=0, $v=0, $w=0, $x=0, $y=0, $z=0, $leerzeichen=0
Func Analysieren()
$Buchstabe =1
$Text = GUICtrlRead($eingabe)
$Buchstabe = StringSplit($Text, "")
$Worter = StringSplit($Text, " ")
GUICtrlSetState($eingabe, $GUI_Hide)
For $i = 1 To $Buchstabe[0] Step +1
If $Buchstabe[$i] = "a" Or $Buchstabe[$i] ="A" Then
$a = $a + 1
;~ GUICtrlCreateLabel("A = "&$a, 0, 0)
EndIf
If $Buchstabe[$i] = "b" Or $Buchstabe[$i] = "B" Then
$b = $b + 1
;~ GUICtrlCreateLabel("B = "&$b, 0, 20)
EndIf
If $Buchstabe[$i] = "c" Or $Buchstabe[$i] ="C" Then
$c = $c + 1
;~ GUICtrlCreateLabel("C = "&$c, 0, 40)
EndIf
If $Buchstabe[$i] = "d" Or $Buchstabe[$i] ="D" Then
$d = $d + 1
;~ GUICtrlCreateLabel("C = "&$c, 0, 40)
EndIf
If $Buchstabe[$i] = "e" Or $Buchstabe[$i] ="E" Then
$e = $e + 1
EndIf
If $Buchstabe[$i] = "f" Or $Buchstabe[$i] ="F" Then
$f = $f + 1
EndIf
If $Buchstabe[$i] = "g" Or $Buchstabe[$i] ="G" Then
$g = $g + 1
EndIf
If $Buchstabe[$i] = "h" Or $Buchstabe[$i] ="H" Then
$h = $h + 1
EndIf
If $Buchstabe[$i] = "i" Or $Buchstabe[$i] ="I" Then
$i = $i + 1
EndIf
If $Buchstabe[$i] = "j" Or $Buchstabe[$i] ="J" Then
$j = $j + 1
EndIf
If $Buchstabe[$i] = "k" Or $Buchstabe[$i] ="K" Then
$k = $k + 1
EndIf
If $Buchstabe[$i] = "l" Or $Buchstabe[$i] ="L" Then
$l = $l + 1
EndIf
If $Buchstabe[$i] = "m" Or $Buchstabe[$i] ="M" Then
$m = $m + 1
EndIf
If $Buchstabe[$i] = "n" Or $Buchstabe[$i] ="N"Then
$n = $n + 1
EndIf
If $Buchstabe[$i] = "o" Or $Buchstabe[$i] ="O" Then
$o = $o + 1
EndIf
If $Buchstabe[$i] = "p" Or $Buchstabe[$i] ="P"Then
$p = $p + 1
EndIf
If $Buchstabe[$i] = "q" Or $Buchstabe[$i] ="Q" Then
$q = $q + 1
EndIf
If $Buchstabe[$i] = "r" Or $Buchstabe[$i] ="R" Then
$r = $r + 1
EndIf
If $Buchstabe[$i] = "s" Or $Buchstabe[$i] ="S" Then
$s = $s + 1
EndIf
If $Buchstabe[$i] = "t" Or $Buchstabe[$i] = "T" Then
$t = $t + 1
EndIf
If $Buchstabe[$i] = "u" Or $Buchstabe[$i] ="U" Then
$u = $u + 1
EndIf
If $Buchstabe[$i] = "v" Or $Buchstabe[$i] ="V" Then
$v = $v + 1
EndIf
If $Buchstabe[$i] = "w" Or $Buchstabe[$i] ="W"Then
$w = $w + 1
EndIf
If $Buchstabe[$i] = "x" Or $Buchstabe[$i] ="X" Then
$x = $x + 1
EndIf
If $Buchstabe[$i] = "y" Or $Buchstabe[$i] ="Y" Then
$y = $y + 1
EndIf
If $Buchstabe[$i] = "z" Or $Buchstabe[$i] ="Z" Then
$z = $z + 1
EndIf
If $Buchstabe[$i] = "" Then
$leerzeichen = $leerzeichen + 1
EndIf
Next
$Grafik = GUICtrlCreateGraphic(@desktopwidth/2-50, @desktopheight/2, 200, 200)
GUICtrlSetBkColor($Grafik, 0xffffff)
GUISetState(@sw_show)
$startwinkel = 0
$radius = 40
$breite = $a/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $b/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $c/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $d/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $e/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $f/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $g/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $h/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $i/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $j/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $k/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $l/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $m/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $n/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $o/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $p/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $q/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $r/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $s/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $t/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $u/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $v/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $w/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $x/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $y/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
$startwinkel = $breite
$breite = $z/$Buchstabe[0]*360
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic($Grafik, $GUI_GR_PIE, 50, 50, $radius, $Startwinkel, $breite)
GUISetState(@SW_Show)
;~ MsgBox(0, $breite, $a&"."&$b&"."&$c&"."&$d&"."&$e&"."&$f&"."&$g&"."&$h)
EndFunc
While 1
$Gui = GUIGetMsg()
Switch $gui
Case $GUI_EVENT_CLOSE
Exit
Case $menu2
If $Buchstabe <>0 Then
Else
Analysieren()
EndIf
;~ Case $but
;~ analysieren()
EndSwitch
WEnd
Es soll einen Text auf die Häufigkeit an Buchstaben prüfen und dann in einem Diagramm ausgeben