release 1.10

This commit is contained in:
2024-03-17 16:04:06 +01:00
parent be9e204576
commit 3c40cfb341
14 changed files with 254 additions and 33 deletions

View File

@@ -0,0 +1,98 @@
#! /usr/bin/python
from tkinter import *
hp=Tk()
button= [
Button(hp, text='X_crusor', cursor='X_cursor'),
Button(hp, text='arrow', cursor='arrow'),
Button(hp, text='based_arrow_down', cursor='based_arrow_down'),
Button(hp, text='based_arrow_up', cursor='based_arrow_up'),
Button(hp, text='boat', cursor='boat'),
Button(hp, text='bogosity', cursor='bogosity'),
Button(hp, text='bottom_left_corner', cursor='bottom_left_corner'),
Button(hp, text='bottom_right_corner', cursor='bottom_right_corner'),
Button(hp, text='bottom_side', cursor='bottom_side'),
Button(hp, text='bottom_tee', cursor='bottom_tee'),
Button(hp, text='box_spiral', cursor='box_spiral'),
Button(hp, text='center_ptr', cursor='center_ptr'),
Button(hp, text='circle', cursor='circle'),
Button(hp, text='clock', cursor='clock'),
Button(hp, text='coffee_mug', cursor='coffee_mug'),
Button(hp, text='cross', cursor='cross'),
Button(hp, text='cross_reverse', cursor='cross_reverse'),
Button(hp, text='crosshair', cursor='crosshair'),
Button(hp, text='diamond_cross', cursor='diamond_cross'),
Button(hp, text='dot', cursor='dot'),
Button(hp, text='dotbox', cursor='dotbox'),
Button(hp, text='double_arrow', cursor='double_arrow'),
Button(hp, text='draft_larg', cursor='draft_large'),
Button(hp, text='draft_small', cursor='draft_small'),
Button(hp, text='draped_box', cursor='draped_box'),
Button(hp, text='exchange', cursor='exchange'),
Button(hp, text='fleur', cursor='fleur'),
Button(hp, text='gobbler', cursor='gobbler'),
Button(hp, text='gumby', cursor='gumby'),
Button(hp, text='hand1', cursor='hand1'),
Button(hp, text='hand2', cursor='hand2'),
Button(hp, text='heart', cursor='heart'),
Button(hp, text='icon', cursor='icon'),
Button(hp, text='iron_corss', cursor='iron_cross'),
Button(hp, text='left_ptr', cursor='left_ptr'),
Button(hp, text='left_side', cursor='left_side'),
Button(hp, text='left_tee', cursor='left_tee'),
Button(hp, text='leftbutton', cursor='leftbutton'),
Button(hp, text='ll_angle', cursor='ll_angle'),
Button(hp, text='lr_angle', cursor='lr_angle'),
Button(hp, text='man', cursor='man'),
Button(hp, text='middlebutton', cursor='middlebutton'),
Button(hp, text='mouse', cursor='mouse'),
Button(hp, text='none', cursor='none'),
Button(hp, text='pencil', cursor='pencil'),
Button(hp, text='pirate', cursor='pirate'),
Button(hp, text='plus', cursor='plus'),
Button(hp, text='question_arrow', cursor='question_arrow'),
Button(hp, text='right_prt', cursor='right_ptr'),
Button(hp, text='right_side', cursor='right_side'),
Button(hp, text='right_tee', cursor='right_tee'),
Button(hp, text='rightbutton', cursor='rightbutton'),
Button(hp, text='rtl_logo', cursor='rtl_logo'),
Button(hp, text='sailboat', cursor='sailboat'),
Button(hp, text='sb_down_arrow', cursor='sb_down_arrow'),
Button(hp, text='sb_v_double_arrow', cursor='sb_v_double_arrow'),
Button(hp, text='sb_h_double_arrow', cursor='sb_h_double_arrow'),
Button(hp, text='sb_left_arrow', cursor='sb_left_arrow'),
Button(hp, text='sb_right_arrow', cursor='sb_right_arrow'),
Button(hp, text='sb_up_arrow', cursor='sb_up_arrow'),
Button(hp, text='shuttle', cursor='shuttle'),
Button(hp, text='sizing', cursor='sizing'),
Button(hp, text='sb_up_arrow', cursor='sb_up_arrow'),
Button(hp, text='spider', cursor='spider'),
Button(hp, text='spraycan', cursor='spraycan'),
Button(hp, text='star', cursor='star'),
Button(hp, text='target', cursor='target'),
Button(hp, text='tcross', cursor='tcross'),
Button(hp, text='top_left_arrow', cursor='top_left_arrow'),
Button(hp, text='top_left_corner', cursor='top_left_corner'),
Button(hp, text='top_right_corner', cursor='top_right_corner'),
Button(hp, text='top_side', cursor='top_side'),
Button(hp, text='top_tee', cursor='top_tee'),
Button(hp, text='trek', cursor='trek'),
Button(hp, text='ul_angle', cursor='ul_angle'),
Button(hp, text='umbrella', cursor='umbrella'),
Button(hp, text='ur_angle', cursor='ur_angle'),
Button(hp, text='watch', cursor='watch'),
Button(hp, text='xterm', cursor='xterm'),
]
ro =1
co =0
for x in button:
x.grid(row=ro, column=co,
padx=2, pady=2,
ipady=10, ipadx=10,sticky=EW)
co +=1
if co % 5==0:
co =0
ro +=1
hp.mainloop()

View File

@@ -16,17 +16,17 @@ def array_ausgabe(arri: list):
def encrypt(plain_text: str, rails: int):
arr = [["_" for x in range(len(plain_text))] for y in range(rails)]
arr = [["_" for _ in range(len(plain_text))] for _ in range(rails)]
r = 0
z = 0
plus = True
for b in plain_text:
arr[r][z] = b
z += 1
if r+1 == rails and plus:
if r + 1 == rails and plus:
plus = False
r -= 1
elif r-1 < 0 and not plus:
elif r - 1 < 0 and not plus:
plus = True
r += 1
elif plus:
@@ -40,15 +40,44 @@ def encrypt(plain_text: str, rails: int):
out += arr[i][j]
print(out)
array_ausgabe(arr)
print()
def decrypt(cipher: str, rails: int):
arr = [["" for x in range(len(cipher))] for y in range(rails)]
for r in range(rails):
#arr[r][z] = b
pass
arr = [["_" for _ in range(len(cipher))] for _ in range(rails)]
# cipher ins array reinbasteln
x, y = 0, 0
first_x = True
for b in cipher:
if x >= len(cipher) and y < rails:
y += 1
x = y
first_x = True
arr[y][x] = b
if y == 0 or (first_x and y != rails-1):
x = x + (rails - y - 1) * 2
first_x = False
elif y == rails-1 or first_x is False:
x = x + (y * 2)
first_x = True
array_ausgabe(arr)
# dekodierten Text aus array holen
out = ""
x, y = 0, 0
down = True
for i in range(len(cipher)):
out += arr[y][x]
x += 1
if down and y+1 == rails:
down = False
y -= 1
elif down:
y += 1
elif down is False and y == 0:
down = True
y += 1
elif down is False:
y -= 1
print(out)
encrypt(t1r2, 2)