Format
There really is no hope of making this code even half-way decent without spending the time to rewrite them all properly. Don't want to do any of that
This commit is contained in:
276
.clang-format
Normal file
276
.clang-format
Normal file
@@ -0,0 +1,276 @@
|
||||
# ─────────────────────────────────────────────────────────────────────
|
||||
# ╭─────────────────────────────────────────────────╮
|
||||
# │ clang-format config │
|
||||
# ╰─────────────────────────────────────────────────╯
|
||||
# ─────────────────────────────────────────────────────────────────────
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AlignArrayOfStructures: Left
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignConsecutiveBitFields:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveShortCaseStatements:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCaseArrows: false
|
||||
AlignCaseColons: false
|
||||
AlignConsecutiveTableGenBreakingDAGArgColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveTableGenCondOperatorColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveTableGenDefinitionColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments:
|
||||
Kind: Always
|
||||
OverEmptyLines: 0
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowBreakBeforeNoexceptSpecifier: Never
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseExpressionOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BitFieldColonSpacing: Both
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: true
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakAdjacentStringLiterals: true
|
||||
BreakAfterAttributes: Always
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakAfterReturnType: None
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeInlineASMColon: OnlyMultiline
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakFunctionDefinitionParameters: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakStringLiterals: true
|
||||
BreakTemplateDeclarations: MultiLine
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: "^ IWYU pragma:"
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: true
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: Always
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: ^"(llvm|llvm-c|clang|clang-c)/
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: ^(<|"(gtest|gmock|isl|json)/)
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: .*
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: (Test)?$
|
||||
IncludeIsMainSourceRegex: ""
|
||||
IndentAccessModifiers: true
|
||||
IndentCaseBlocks: true
|
||||
IndentCaseLabels: true
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentRequiresClause: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
InsertBraces: false
|
||||
InsertNewlineAtEOF: false
|
||||
InsertTrailingCommas: None
|
||||
IntegerLiteralSeparator:
|
||||
Binary: 0
|
||||
BinaryMinDigits: 0
|
||||
Decimal: 0
|
||||
DecimalMinDigits: 0
|
||||
Hex: 0
|
||||
HexMinDigits: 0
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLines:
|
||||
AtEndOfFile: false
|
||||
AtStartOfBlock: true
|
||||
AtStartOfFile: true
|
||||
LambdaBodyIndentation: Signature
|
||||
LineEnding: DeriveLF
|
||||
MacroBlockBegin: ""
|
||||
MacroBlockEnd: ""
|
||||
MainIncludeChar: Quote
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PPIndentWidth: -1
|
||||
PackConstructorInitializers: BinPack
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
PenaltyBreakScopeResolution: 500
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyIndentedWhitespace: 0
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
QualifierAlignment: Left
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: true
|
||||
RemoveBracesLLVM: true
|
||||
RemoveParentheses: MultipleParentheses
|
||||
RemoveSemicolon: false
|
||||
RequiresClausePosition: OwnLine
|
||||
RequiresExpressionIndentation: OuterScope
|
||||
SeparateDefinitionBlocks: Always
|
||||
ShortNamespaceLines: 1
|
||||
SkipMacroDefinitionBody: false
|
||||
SortIncludes: CaseSensitive
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: LexicographicNumeric
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeJsonColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterForeachMacros: true
|
||||
AfterFunctionDeclarationName: true
|
||||
AfterFunctionDefinitionName: true
|
||||
AfterIfMacros: true
|
||||
AfterOverloadedOperator: false
|
||||
AfterPlacementOperator: true
|
||||
AfterRequiresInClause: false
|
||||
AfterRequiresInExpression: false
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: Never
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParens: Custom
|
||||
SpacesInParensOptions:
|
||||
ExceptDoubleParentheses: false
|
||||
InConditionalStatements: true
|
||||
InCStyleCasts: false
|
||||
InEmptyParentheses: false
|
||||
Other: true
|
||||
SpacesInSquareBrackets: true
|
||||
Standard: Latest
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 4
|
||||
TableGenBreakInsideDAGArg: DontBreak
|
||||
UseTab: Never
|
||||
VerilogBreakBetweenInstancePorts: true
|
||||
WhitespaceSensitiveMacros:
|
||||
- BOOST_PP_STRINGIZE
|
||||
- CF_SWIFT_NAME
|
||||
- NS_SWIFT_NAME
|
||||
- PP_STRINGIZE
|
||||
- STRINGIZE
|
||||
@@ -2,17 +2,19 @@ import turtle
|
||||
|
||||
import time
|
||||
|
||||
turtle.setup(500,500)
|
||||
turtle.setup(500, 500)
|
||||
turtle.speed(0)
|
||||
turtle.width(4)
|
||||
|
||||
|
||||
def quadrat():
|
||||
for i in range(4):
|
||||
turtle.fd(100)
|
||||
turtle.rt(90)
|
||||
|
||||
|
||||
turtle.pu()
|
||||
turtle.setpos(-350,-50)
|
||||
turtle.setpos(-350, -50)
|
||||
turtle.pd()
|
||||
|
||||
turtle.ht()
|
||||
@@ -24,4 +26,3 @@ while True:
|
||||
turtle.fd(1)
|
||||
time.sleep(0.01)
|
||||
turtle.update()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ turtle.color("red")
|
||||
turtle.ht()
|
||||
|
||||
turtle.pu()
|
||||
turtle.setpos(-700,-700)
|
||||
turtle.setpos(-700, -700)
|
||||
turtle.lt(45)
|
||||
turtle.pd()
|
||||
|
||||
@@ -23,4 +23,3 @@ while True:
|
||||
turtle.dot(50)
|
||||
turtle.fd(0.5)
|
||||
turtle.update()
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import time
|
||||
import math
|
||||
|
||||
|
||||
speed_boat = 0.01
|
||||
|
||||
|
||||
def ship():
|
||||
clear()
|
||||
fd(130)
|
||||
@@ -27,6 +28,7 @@ def ship():
|
||||
lt(50)
|
||||
update()
|
||||
|
||||
|
||||
def ship_2():
|
||||
clear()
|
||||
fd(130)
|
||||
@@ -37,8 +39,6 @@ def ship_2():
|
||||
rt(130)
|
||||
|
||||
|
||||
|
||||
|
||||
def speed_more():
|
||||
global speed_boat
|
||||
speed_boat += 0.5
|
||||
@@ -58,31 +58,33 @@ def speed_less():
|
||||
global speed_boat
|
||||
speed_boat -= 0.5
|
||||
|
||||
|
||||
def speed_stop():
|
||||
global speed_boat
|
||||
speed_boat = -1.35
|
||||
|
||||
|
||||
def speed_exelerate_fast():
|
||||
global speed_boat
|
||||
speed_boat += 2
|
||||
|
||||
|
||||
def speed_reduce_fast():
|
||||
global speed_boat
|
||||
speed_boat -= 2
|
||||
|
||||
|
||||
def reset_system():
|
||||
global speed_boat
|
||||
speed_boat = 0.01
|
||||
home()
|
||||
pu()
|
||||
setpos(-350,-50)
|
||||
setpos(-350, -50)
|
||||
pd()
|
||||
tracer(0)
|
||||
ht()
|
||||
|
||||
|
||||
|
||||
|
||||
reset_system()
|
||||
|
||||
while True:
|
||||
@@ -98,4 +100,3 @@ while True:
|
||||
onkeypress(goleft, "Left")
|
||||
onkeypress(speed_less, "Down")
|
||||
listen()
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
#Import der Module
|
||||
# Import der Module
|
||||
import turtle
|
||||
import time
|
||||
|
||||
#Aufsetzen der Turtle instanzen
|
||||
# Aufsetzen der Turtle instanzen
|
||||
earth = turtle.Turtle()
|
||||
sun = turtle.Turtle()
|
||||
|
||||
#Vorbereiten der Benutzeroberfläche
|
||||
# Vorbereiten der Benutzeroberfläche
|
||||
turtle.bgcolor("black")
|
||||
turtle.addshape("earth.gif")
|
||||
turtle.addshape("sun.gif")
|
||||
earth.shape("earth.gif")
|
||||
sun.shape("sun.gif")
|
||||
|
||||
#Erde umkreist Sonne
|
||||
|
||||
# Erde umkreist Sonne
|
||||
def earth_move():
|
||||
for i in range(10):
|
||||
earth.fd(1)
|
||||
@@ -29,4 +30,3 @@ earth.rt(90)
|
||||
|
||||
while True:
|
||||
earth_move()
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#Imporieren aller module
|
||||
from turtle import*
|
||||
# Imporieren aller module
|
||||
from turtle import *
|
||||
import random
|
||||
import time
|
||||
import math
|
||||
|
||||
title("Main Hub")
|
||||
|
||||
#Wichtige Vorbereitungen
|
||||
# Wichtige Vorbereitungen
|
||||
|
||||
|
||||
def hi():
|
||||
pu()
|
||||
setpos(-100,0)
|
||||
setpos(-100, 0)
|
||||
pd()
|
||||
lt(90)
|
||||
fd(200)
|
||||
@@ -21,45 +22,82 @@ def hi():
|
||||
fd(100)
|
||||
bk(200)
|
||||
pu()
|
||||
setpos(50,0)
|
||||
setpos(50, 0)
|
||||
pd()
|
||||
fd(200)
|
||||
|
||||
|
||||
speed(10000)
|
||||
ht()
|
||||
|
||||
#Lässt den Benutzer auswählen, ob die Formen zufällig oder in einem Kreis angeordnet, nach Wünschen des Benutzers gezeichnet werden sollen.
|
||||
# Lässt den Benutzer auswählen, ob die Formen zufällig oder in einem Kreis angeordnet, nach Wünschen des Benutzers gezeichnet werden sollen.
|
||||
print("ready")
|
||||
hi()
|
||||
program_choice = int(numinput("Welches Program sollte ausgeführt werden?", " 1=Custom, 2=Random, 3=Drunken Man ",1,minval=1))
|
||||
program_choice = int(
|
||||
numinput(
|
||||
"Welches Program sollte ausgeführt werden?",
|
||||
" 1=Custom, 2=Random, 3=Drunken Man ",
|
||||
1,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
#Definition des Befehls Vieleck(). Der Grundbaustein des Programms
|
||||
def vieleck(anzahl_seiten,radius, anzahl_kreis_printed, figuren, kreise, figur_nummer, save_first):
|
||||
# Definition des Befehls Vieleck(). Der Grundbaustein des Programms
|
||||
def vieleck(
|
||||
anzahl_seiten,
|
||||
radius,
|
||||
anzahl_kreis_printed,
|
||||
figuren,
|
||||
kreise,
|
||||
figur_nummer,
|
||||
save_first,
|
||||
):
|
||||
parts_circle = 1
|
||||
time_durchgang_start = time.time()
|
||||
for i in range(anzahl_seiten):
|
||||
fd(radius/anzahl_seiten)
|
||||
rt(360/anzahl_seiten)
|
||||
fd(radius / anzahl_seiten)
|
||||
rt(360 / anzahl_seiten)
|
||||
parts_circle += 1
|
||||
if parts_circle / anzahl_seiten * 100 >= 50 and parts_circle / anzahl_seiten * 100 < 50.1:
|
||||
print(" Circle:",parts_circle / anzahl_seiten * 100, "%")
|
||||
if (
|
||||
parts_circle / anzahl_seiten * 100 >= 50
|
||||
and parts_circle / anzahl_seiten * 100 < 50.1
|
||||
):
|
||||
print(" Circle:", parts_circle / anzahl_seiten * 100, "%")
|
||||
time_durchgang_end = time.time()
|
||||
exact_timecalculation(time_durchgang_start, time_durchgang_end, anzahl_seiten, radius, anzahl_kreis_printed, figuren, kreise, figur_nummer, save_first)
|
||||
exact_timecalculation(
|
||||
time_durchgang_start,
|
||||
time_durchgang_end,
|
||||
anzahl_seiten,
|
||||
radius,
|
||||
anzahl_kreis_printed,
|
||||
figuren,
|
||||
kreise,
|
||||
figur_nummer,
|
||||
save_first,
|
||||
)
|
||||
|
||||
|
||||
#Definition des Befehls, der mit beendigung des Auswahlverfahrens aufgerufen wird. Verwaltet die wichtigsten feautures
|
||||
def figur(seite,radiusin,anzahlkr,anzahl_figuren,erh_input):
|
||||
# Definition des Befehls, der mit beendigung des Auswahlverfahrens aufgerufen wird. Verwaltet die wichtigsten feautures
|
||||
def figur(seite, radiusin, anzahlkr, anzahl_figuren, erh_input):
|
||||
figur_number = 1
|
||||
first_time = 1
|
||||
print("Globally: 0 % done")
|
||||
for i in range(anzahl_figuren):
|
||||
change_color(figur_number)
|
||||
print("drawing figure number",figur_number)
|
||||
print("drawing figure number", figur_number)
|
||||
anzahl_kr_printed = 0
|
||||
for i in range(anzahlkr):
|
||||
vieleck(seite,radiusin, anzahl_kr_printed, anzahl_figuren, anzahlkr, figur_number, first_time)
|
||||
rt(360/anzahlkr)
|
||||
vieleck(
|
||||
seite,
|
||||
radiusin,
|
||||
anzahl_kr_printed,
|
||||
anzahl_figuren,
|
||||
anzahlkr,
|
||||
figur_number,
|
||||
first_time,
|
||||
)
|
||||
rt(360 / anzahlkr)
|
||||
anzahl_kr_printed += 1
|
||||
print(anzahl_kr_printed / anzahlkr * 100, "%")
|
||||
radiusin += erh_input
|
||||
@@ -67,12 +105,34 @@ def figur(seite,radiusin,anzahlkr,anzahl_figuren,erh_input):
|
||||
print("done")
|
||||
print("Globally:", (figur_number - 1) / anzahl_figuren * 100, "% done")
|
||||
|
||||
#Berechnet, sobald das Programm begonnen hatte zu zeichnen, wie lange der Vorgang noch dauern wird.
|
||||
def exact_timecalculation(time_durchgang_end_1, time_durchgang_start_1, seitenzahl, radiusinput, anzahl_kreise_printed, figuren, kreise, figur_number, save_1):
|
||||
|
||||
# Berechnet, sobald das Programm begonnen hatte zu zeichnen, wie lange der Vorgang noch dauern wird.
|
||||
def exact_timecalculation(
|
||||
time_durchgang_end_1,
|
||||
time_durchgang_start_1,
|
||||
seitenzahl,
|
||||
radiusinput,
|
||||
anzahl_kreise_printed,
|
||||
figuren,
|
||||
kreise,
|
||||
figur_number,
|
||||
save_1,
|
||||
):
|
||||
print("Time per shape", time_durchgang_start_1 - time_durchgang_end_1)
|
||||
remaining_circles = (figuren * kreise) - ((anzahl_kreise_printed + ((figur_number - 1) * kreise)))
|
||||
remaining_time = remaining_circles * ((time_durchgang_end_1 - time_durchgang_start_1) * -1)
|
||||
print(((anzahl_kreise_printed + ((figur_number - 1) * kreise))), "/", (kreise * figuren), "shapes got already printed.", remaining_circles, "remaining")
|
||||
remaining_circles = (figuren * kreise) - (
|
||||
(anzahl_kreise_printed + ((figur_number - 1) * kreise))
|
||||
)
|
||||
remaining_time = remaining_circles * (
|
||||
(time_durchgang_end_1 - time_durchgang_start_1) * -1
|
||||
)
|
||||
print(
|
||||
((anzahl_kreise_printed + ((figur_number - 1) * kreise))),
|
||||
"/",
|
||||
(kreise * figuren),
|
||||
"shapes got already printed.",
|
||||
remaining_circles,
|
||||
"remaining",
|
||||
)
|
||||
print("ETA:", remaining_time, "seconds or", remaining_time / 60, "minutes")
|
||||
if save_1 > 1:
|
||||
remaining_time = save_time_end
|
||||
@@ -80,7 +140,8 @@ def exact_timecalculation(time_durchgang_end_1, time_durchgang_start_1, seitenza
|
||||
else:
|
||||
save_1 = 0
|
||||
|
||||
#Wechselt die Farbe
|
||||
|
||||
# Wechselt die Farbe
|
||||
def change_color(anz_figuren):
|
||||
if anz_figuren >= 1 and anz_figuren < 2:
|
||||
color("red")
|
||||
@@ -97,20 +158,25 @@ def change_color(anz_figuren):
|
||||
color("black")
|
||||
|
||||
|
||||
#Führt den zufälligen Teil des Programms aus
|
||||
# Führt den zufälligen Teil des Programms aus
|
||||
def vieleck_random_randomize():
|
||||
amount_circles_drawn = 0
|
||||
pu()
|
||||
amount_circles = random.randint(25, 75)
|
||||
print(amount_circles, "shapes need to be printed. Esitmated time:", amount_circles * 0.35, "seconds")
|
||||
print(
|
||||
amount_circles,
|
||||
"shapes need to be printed. Esitmated time:",
|
||||
amount_circles * 0.35,
|
||||
"seconds",
|
||||
)
|
||||
print("0 / 0 or 0 % done")
|
||||
for i in range(amount_circles):
|
||||
color(random.random(),random.random(),random.random())
|
||||
color(random.random(), random.random(), random.random())
|
||||
size = random.randint(50, 250)
|
||||
width(random.randint(2, 10))
|
||||
ecken = random.randint(3, 20)
|
||||
setpos(random.randint(-300,300), random.randint(-300,300))
|
||||
fuellen = random.randint(0,1)
|
||||
setpos(random.randint(-300, 300), random.randint(-300, 300))
|
||||
fuellen = random.randint(0, 1)
|
||||
pd()
|
||||
if fuellen >= 1:
|
||||
begin_fill()
|
||||
@@ -124,17 +190,32 @@ def vieleck_random_randomize():
|
||||
rt(360 / ecken)
|
||||
amount_circles_drawn += 1
|
||||
pu()
|
||||
print(amount_circles_drawn, "/", amount_circles, "or", amount_circles_drawn / amount_circles * 100, "% drawn.")
|
||||
print(
|
||||
amount_circles_drawn,
|
||||
"/",
|
||||
amount_circles,
|
||||
"or",
|
||||
amount_circles_drawn / amount_circles * 100,
|
||||
"% drawn.",
|
||||
)
|
||||
print("100 % done. Process ended with a 0")
|
||||
|
||||
#Definition des Betrunkenen Mannes??
|
||||
def drunken_man_walk_show(schritte,distanz):
|
||||
|
||||
# Definition des Betrunkenen Mannes??
|
||||
def drunken_man_walk_show(schritte, distanz):
|
||||
for i in range(schritte):
|
||||
fd(distanz)
|
||||
setheading(random.randint(0, 360))
|
||||
|
||||
def drunken_man_walk_calculate(anzahl_tests,anzahl_figuren_test,add,anzahl_tests_pro,ausgabe):
|
||||
print("started. Going to make the test", anzahl_tests, "times to get a result which is as acurate as possible")
|
||||
|
||||
def drunken_man_walk_calculate(
|
||||
anzahl_tests, anzahl_figuren_test, add, anzahl_tests_pro, ausgabe
|
||||
):
|
||||
print(
|
||||
"started. Going to make the test",
|
||||
anzahl_tests,
|
||||
"times to get a result which is as acurate as possible",
|
||||
)
|
||||
schritte = 100
|
||||
schritte_begin = schritte
|
||||
distanz = 20
|
||||
@@ -144,9 +225,16 @@ def drunken_man_walk_calculate(anzahl_tests,anzahl_figuren_test,add,anzahl_tests
|
||||
for i in range(anzahl_figuren_test):
|
||||
amount_atemps_per = 0
|
||||
for i in range(anzahl_tests):
|
||||
print("Collecting data for", schritte,"steps, collecting data for try number", amount_atemps_per + 1, "/", anzahl_tests)
|
||||
print(
|
||||
"Collecting data for",
|
||||
schritte,
|
||||
"steps, collecting data for try number",
|
||||
amount_atemps_per + 1,
|
||||
"/",
|
||||
anzahl_tests,
|
||||
)
|
||||
for i in range(anzahl_tests_pro):
|
||||
drunken_man_walk_show(schritte,distanz)
|
||||
drunken_man_walk_show(schritte, distanz)
|
||||
x = xcor()
|
||||
y = ycor()
|
||||
d = math.sqrt(x**2 + y**2)
|
||||
@@ -155,12 +243,24 @@ def drunken_man_walk_calculate(anzahl_tests,anzahl_figuren_test,add,anzahl_tests
|
||||
home()
|
||||
pd()
|
||||
summe_calc = summe / anzahl_tests_pro
|
||||
print("Average dislocation of 0.0 is:", summe_calc,"pixels, with a amount of steps of", schritte,".")
|
||||
print(
|
||||
"Average dislocation of 0.0 is:",
|
||||
summe_calc,
|
||||
"pixels, with a amount of steps of",
|
||||
schritte,
|
||||
".",
|
||||
)
|
||||
summe_second += summe_calc
|
||||
reset()
|
||||
summe = 0
|
||||
amount_atemps_per += 1
|
||||
print("TOTAL Average dislocation of 0.0 is:", summe_second / anzahl_tests, "pixels with", schritte, "steps")
|
||||
print(
|
||||
"TOTAL Average dislocation of 0.0 is:",
|
||||
summe_second / anzahl_tests,
|
||||
"pixels with",
|
||||
schritte,
|
||||
"steps",
|
||||
)
|
||||
print("Next size getting executed")
|
||||
result = summe_second / anzahl_tests
|
||||
l.append(result)
|
||||
@@ -169,7 +269,7 @@ def drunken_man_walk_calculate(anzahl_tests,anzahl_figuren_test,add,anzahl_tests
|
||||
l.remove(1)
|
||||
l.reverse()
|
||||
print("\n\n\n")
|
||||
print("entire list:",l)
|
||||
print("entire list:", l)
|
||||
print("\n_________________________ \n\n\n")
|
||||
if ausgabe == 1:
|
||||
for i in range(anzahl_figuren_test):
|
||||
@@ -185,30 +285,90 @@ def drunken_man_walk_calculate(anzahl_tests,anzahl_figuren_test,add,anzahl_tests
|
||||
schritte_begin += add
|
||||
|
||||
|
||||
|
||||
|
||||
#Wird ausgeführt, wenn der vom Benutzer einstellbare Modus ausgewählt wird.
|
||||
# Wird ausgeführt, wenn der vom Benutzer einstellbare Modus ausgewählt wird.
|
||||
if program_choice >= 1 and program_choice < 2:
|
||||
title("Custom Design")
|
||||
reset()
|
||||
ht()
|
||||
speed(10000)
|
||||
print("Custom Design")
|
||||
seiteninput = int(numinput("Wie viele Seiten?", " Gerade Zahl von 3-unendlich ",10,minval=3))
|
||||
radiusinput = int(numinput("Wie gross soll der Radius sein?", " Gerade Zahl von 50-unendlich ",50,minval=50))
|
||||
anzahlkrinput = int(numinput("Wie viele Kreise sollen gezeichnet werden??", " Gerade Zahl von 1-unendlich ",5,minval=1))
|
||||
figureninput = int(numinput("Wie viele Figuren sollen gezeichnet werden?", " Gerade Zahl von 1-unendlich ",5,minval=1))
|
||||
erhinput = int(numinput("Um wieviel soll sich sich der Radius der Kreise erhöhen?", " Gerade Zahl von 20-unendlich ",50,minval=20))
|
||||
verzoegerung = int(numinput("Wie schnell soll die Animation laufen?", " Gerade Zahl von 1-unendlich, umso höher, desto schneller ",50,minval=0))
|
||||
seiteninput = int(
|
||||
numinput(
|
||||
"Wie viele Seiten?", " Gerade Zahl von 3-unendlich ", 10, minval=3
|
||||
)
|
||||
)
|
||||
radiusinput = int(
|
||||
numinput(
|
||||
"Wie gross soll der Radius sein?",
|
||||
" Gerade Zahl von 50-unendlich ",
|
||||
50,
|
||||
minval=50,
|
||||
)
|
||||
)
|
||||
anzahlkrinput = int(
|
||||
numinput(
|
||||
"Wie viele Kreise sollen gezeichnet werden??",
|
||||
" Gerade Zahl von 1-unendlich ",
|
||||
5,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
figureninput = int(
|
||||
numinput(
|
||||
"Wie viele Figuren sollen gezeichnet werden?",
|
||||
" Gerade Zahl von 1-unendlich ",
|
||||
5,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
erhinput = int(
|
||||
numinput(
|
||||
"Um wieviel soll sich sich der Radius der Kreise erhöhen?",
|
||||
" Gerade Zahl von 20-unendlich ",
|
||||
50,
|
||||
minval=20,
|
||||
)
|
||||
)
|
||||
verzoegerung = int(
|
||||
numinput(
|
||||
"Wie schnell soll die Animation laufen?",
|
||||
" Gerade Zahl von 1-unendlich, umso höher, desto schneller ",
|
||||
50,
|
||||
minval=0,
|
||||
)
|
||||
)
|
||||
print("starting process...")
|
||||
tracer(verzoegerung)
|
||||
print(anzahlkrinput * figureninput, "circles need to be printed. Estimated time until completion:", (anzahlkrinput * figureninput * (seiteninput * 0.0330383)), "seconds or", (anzahlkrinput * figureninput * (seiteninput * 0.0330383)) / 60, "minutes")
|
||||
print(
|
||||
anzahlkrinput * figureninput,
|
||||
"circles need to be printed. Estimated time until completion:",
|
||||
(anzahlkrinput * figureninput * (seiteninput * 0.0330383)),
|
||||
"seconds or",
|
||||
(anzahlkrinput * figureninput * (seiteninput * 0.0330383)) / 60,
|
||||
"minutes",
|
||||
)
|
||||
time.sleep(2)
|
||||
draw_time_start = time.time()
|
||||
figur(seiteninput,radiusinput,anzahlkrinput,figureninput,erhinput)
|
||||
figur(seiteninput, radiusinput, anzahlkrinput, figureninput, erhinput)
|
||||
draw_time_end = time.time()
|
||||
draw_time = (draw_time_end - draw_time_start) - (anzahlkrinput * figureninput * (seiteninput * 0.0330383))
|
||||
print("Drawing of", anzahlkrinput * figureninput, "shapes has taken", draw_time_end - draw_time_start , "seconds or", (draw_time_end - draw_time_start) / 60, "minutes, estimated:", (anzahlkrinput * figureninput * (seiteninput * 0.0330383)), "seconds, which means a diffrence of", draw_time, "seconds or missed by", draw_time * 100, "%")
|
||||
draw_time = (draw_time_end - draw_time_start) - (
|
||||
anzahlkrinput * figureninput * (seiteninput * 0.0330383)
|
||||
)
|
||||
print(
|
||||
"Drawing of",
|
||||
anzahlkrinput * figureninput,
|
||||
"shapes has taken",
|
||||
draw_time_end - draw_time_start,
|
||||
"seconds or",
|
||||
(draw_time_end - draw_time_start) / 60,
|
||||
"minutes, estimated:",
|
||||
(anzahlkrinput * figureninput * (seiteninput * 0.0330383)),
|
||||
"seconds, which means a diffrence of",
|
||||
draw_time,
|
||||
"seconds or missed by",
|
||||
draw_time * 100,
|
||||
"%",
|
||||
)
|
||||
print("Click to exit")
|
||||
|
||||
|
||||
@@ -222,7 +382,7 @@ else:
|
||||
draw_time_start = time.time()
|
||||
vieleck_random_randomize()
|
||||
draw_time_end = time.time()
|
||||
print("Drawing has taken", draw_time_end - draw_time_start , "seconds")
|
||||
print("Drawing has taken", draw_time_end - draw_time_start, "seconds")
|
||||
print("Click to exit")
|
||||
else:
|
||||
if program_choice >= 3 and program_choice < 4:
|
||||
@@ -231,20 +391,72 @@ else:
|
||||
ht()
|
||||
speed(0)
|
||||
print("Drunken Man's Walk")
|
||||
easy_difficult = int(numinput("Soll es gezeigt oder eine Tabelle erstellt werden?", " 1=Normal, 2=Tabelle ",1,minval=1))
|
||||
easy_difficult = int(
|
||||
numinput(
|
||||
"Soll es gezeigt oder eine Tabelle erstellt werden?",
|
||||
" 1=Normal, 2=Tabelle ",
|
||||
1,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
if easy_difficult == 1:
|
||||
title("Drunken Man's Walk: standard")
|
||||
drunken_man_walk_show(100,20)
|
||||
drunken_man_walk_show(100, 20)
|
||||
else:
|
||||
title("Drunken Man's Walk: List")
|
||||
tests_total = int(numinput("Wie viele unterschiedliche Längen sollten getestet werden?", " Dauer erhöht sich extrem, Genauigkeit genauso ",10,minval=1))
|
||||
tests_per = int(numinput("Wieviele Tests sollten pro Länge durchgeführt werden?", " Dauer erhöht sich extrem, Genauigkeit genauso ",10,minval=1))
|
||||
addition = int(numinput("Um wieviel soll die Schrittzahl vergrössert werden?", " Dauer erhöht sich unbedeutend, abhängig von Tests ", 100, minval=1))
|
||||
executes_per = int(numinput("Wie viele Spuren sollen gezeichnet werden?", " Dauer erhöht sich ziemlich, Genauigkeit genauso ",1000,minval=1))
|
||||
tracerdelay = int(numinput("Alle wie viele Striche soll aktualisiert werden?", " umso höher, desto schneller ",10000,minval=1))
|
||||
output = int(numinput("Wie soll die Liste ausgegeben werden?", " 1 = Liste, 2 = Tabelle ",1,minval=1, maxval=2))
|
||||
tests_total = int(
|
||||
numinput(
|
||||
"Wie viele unterschiedliche Längen sollten getestet werden?",
|
||||
" Dauer erhöht sich extrem, Genauigkeit genauso ",
|
||||
10,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
tests_per = int(
|
||||
numinput(
|
||||
"Wieviele Tests sollten pro Länge durchgeführt werden?",
|
||||
" Dauer erhöht sich extrem, Genauigkeit genauso ",
|
||||
10,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
addition = int(
|
||||
numinput(
|
||||
"Um wieviel soll die Schrittzahl vergrössert werden?",
|
||||
" Dauer erhöht sich unbedeutend, abhängig von Tests ",
|
||||
100,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
executes_per = int(
|
||||
numinput(
|
||||
"Wie viele Spuren sollen gezeichnet werden?",
|
||||
" Dauer erhöht sich ziemlich, Genauigkeit genauso ",
|
||||
1000,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
tracerdelay = int(
|
||||
numinput(
|
||||
"Alle wie viele Striche soll aktualisiert werden?",
|
||||
" umso höher, desto schneller ",
|
||||
10000,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
output = int(
|
||||
numinput(
|
||||
"Wie soll die Liste ausgegeben werden?",
|
||||
" 1 = Liste, 2 = Tabelle ",
|
||||
1,
|
||||
minval=1,
|
||||
maxval=2,
|
||||
)
|
||||
)
|
||||
tracer(tracerdelay)
|
||||
drunken_man_walk_calculate(tests_per,tests_total,addition,executes_per,output)
|
||||
drunken_man_walk_calculate(
|
||||
tests_per, tests_total, addition, executes_per, output
|
||||
)
|
||||
|
||||
else:
|
||||
print("wrong")
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import time
|
||||
#tracer(1)
|
||||
#ht()
|
||||
|
||||
# tracer(1)
|
||||
# ht()
|
||||
|
||||
|
||||
def viereck():
|
||||
for i in range(1000000000000000):
|
||||
clear()
|
||||
pu()
|
||||
setpos(0,0)
|
||||
setpos(0, 0)
|
||||
rt(10)
|
||||
fd(50)
|
||||
rt(90)
|
||||
@@ -18,4 +20,5 @@ def viereck():
|
||||
fd(50)
|
||||
time.sleep(0.05)
|
||||
|
||||
|
||||
viereck()
|
||||
@@ -19,6 +19,6 @@ while True:
|
||||
else:
|
||||
print("\t/", end="\r")
|
||||
time.sleep(0.5)
|
||||
os.system( 'clear' )
|
||||
os.system("clear")
|
||||
strich += 1
|
||||
strich = 1
|
||||
@@ -1,3 +1,3 @@
|
||||
inventory = ["Test", "Test2"]
|
||||
for item in inventory:
|
||||
print("*"+item)
|
||||
print("*" + item)
|
||||
|
||||
10
C/Addierer.c
10
C/Addierer.c
@@ -1,10 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int summe = 0;
|
||||
for(int i=0; i<5; i++) {
|
||||
printf("Gib die Zahl ein:")
|
||||
for ( int i = 0; i < 5; i++ ) {
|
||||
printf( "Gib die Zahl ein:" );
|
||||
int zahl;
|
||||
scanf("%d", &zahl);
|
||||
scanf( "%d", &zahl );
|
||||
summe = summe + zahl;
|
||||
}
|
||||
printf("Summe: %d\n", summe);
|
||||
printf( "Summe: %d\n", summe );
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};
|
||||
int main() {
|
||||
vector<string> msg { "Hello", "C++", "World", "from", "VS Code", "and the C++ extension!" };
|
||||
|
||||
for (const string& word : msg)
|
||||
{
|
||||
for ( const string &word : msg )
|
||||
cout << word << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int main() {
|
||||
// Deklaration der Variablen
|
||||
int hist[26] = {};
|
||||
int hist[ 26 ] = {};
|
||||
int i, k, c, count;
|
||||
int num = 0;
|
||||
|
||||
// Zeichen bis EOF einlesen (nur a-z werden berücksichtigt)
|
||||
// EOF wird im Terminal mit CTRL-D eingegeben!
|
||||
while ((c = getchar()) != EOF) {
|
||||
if ((c>96) && (c<123)) {
|
||||
while ( ( c = getchar() ) != EOF ) {
|
||||
if ( ( c > 96 ) && ( c < 123 ) ) {
|
||||
// Zähler für diesen Buchstaben erhöhen
|
||||
hist[c-97]++;
|
||||
hist[ c - 97 ]++;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
// Histogramm ausgeben
|
||||
printf("\n");
|
||||
for (i=0; i<26; i++) {
|
||||
count = hist[i];
|
||||
if (count > 0) {
|
||||
printf("%c : %f\n",i+97, (count/(float)num)*100);
|
||||
}
|
||||
printf( "\n" );
|
||||
for ( i = 0; i < 26; i++ ) {
|
||||
count = hist[ i ];
|
||||
if ( count > 0 )
|
||||
printf( "%c : %f\n", i + 97, ( count / (float) num ) * 100 );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int main() {
|
||||
// Deklaration der Variablen
|
||||
int hist[26] = {};
|
||||
int hist[ 26 ] = {};
|
||||
int i, k, c, count;
|
||||
|
||||
// Zeichen bis EOF einlesen (nur a-z werden berücksichtigt)
|
||||
// EOF wird im Terminal mit CTRL-D eingegeben!
|
||||
while ((c = getchar()) != EOF) {
|
||||
if ((c>96) && (c<123)) {
|
||||
while ( ( c = getchar() ) != EOF ) {
|
||||
if ( ( c > 96 ) && ( c < 123 ) ) {
|
||||
// Zähler für diesen Buchstaben erhöhen
|
||||
hist[c-97]++;
|
||||
hist[ c - 97 ]++;
|
||||
}
|
||||
}
|
||||
|
||||
// Histogramm ausgeben
|
||||
printf("\n");
|
||||
for (i=0; i<26; i++) {
|
||||
count = hist[i];
|
||||
if (count > 0) {
|
||||
printf("%c : ",i+97);
|
||||
for (k=0; k<count; k++)
|
||||
printf("*");
|
||||
printf("\n");
|
||||
printf( "\n" );
|
||||
for ( i = 0; i < 26; i++ ) {
|
||||
count = hist[ i ];
|
||||
if ( count > 0 ) {
|
||||
printf( "%c : ", i + 97 );
|
||||
for ( k = 0; k < count; k++ )
|
||||
printf( "*" );
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
shape("turtle")
|
||||
color("blue")
|
||||
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import math
|
||||
|
||||
rt(45)
|
||||
go = 1
|
||||
color("red")
|
||||
|
||||
distance_in = int(numinput("Wie weit darf sich die Turtle vom Mittelpunkt entfernen??", " Gerade Zahl von 1-unendlich ",300,minval=1))
|
||||
distance_in = int(
|
||||
numinput(
|
||||
"Wie weit darf sich die Turtle vom Mittelpunkt entfernen??",
|
||||
" Gerade Zahl von 1-unendlich ",
|
||||
300,
|
||||
minval=1,
|
||||
)
|
||||
)
|
||||
|
||||
for i in range(4):
|
||||
go = 1
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#Library import
|
||||
# Library import
|
||||
import math
|
||||
|
||||
|
||||
#Startup
|
||||
# Startup
|
||||
out = 0
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
,--------. ,--. ,--.
|
||||
'--. .--',--,--. ,---. ,---.| ,---. ,---. ,--,--, ,--.--. ,---. ,---.| ,---. ,--,--, ,---. ,--.--.
|
||||
@@ -17,17 +18,18 @@ print("""
|
||||
Build 1
|
||||
28.05.21
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
#Userinput
|
||||
# Userinput
|
||||
i = input("Rechung eingeben: ")
|
||||
|
||||
#Separation
|
||||
# Separation
|
||||
l = i.split()
|
||||
x1 = l.pop(0)
|
||||
x = int(x1)
|
||||
|
||||
#Calculation
|
||||
# Calculation
|
||||
if len(l) == 1:
|
||||
print("Wrong entry, retry, use spaces in between numbers and operands.")
|
||||
else:
|
||||
@@ -47,7 +49,7 @@ else:
|
||||
out = x / y
|
||||
|
||||
elif "^" or "**" in l:
|
||||
out = x ** y
|
||||
out = x**y
|
||||
|
||||
elif "<>" in l:
|
||||
math.sqrt(x)
|
||||
@@ -62,5 +64,5 @@ else:
|
||||
print("The result is:")
|
||||
|
||||
|
||||
#Output
|
||||
# Output
|
||||
print(out)
|
||||
@@ -11,7 +11,7 @@ go = 1
|
||||
|
||||
|
||||
while go == 1:
|
||||
zahl = random.randint(1,2)
|
||||
zahl = random.randint(1, 2)
|
||||
|
||||
if st1 == st2:
|
||||
if st2a == st3:
|
||||
|
||||
@@ -16,6 +16,3 @@ elif system == 8:
|
||||
|
||||
else:
|
||||
print("wrong")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
#FRANKENGEWINNSPIEL
|
||||
#-------------------------------------------------
|
||||
# FRANKENGEWINNSPIEL
|
||||
# -------------------------------------------------
|
||||
|
||||
|
||||
#Import of Modules and setup variables
|
||||
#import turtle
|
||||
# Import of Modules and setup variables
|
||||
# import turtle
|
||||
|
||||
#Definition of Turtle instances
|
||||
# Definition of Turtle instances
|
||||
|
||||
|
||||
|
||||
#Preparations, so setup of the game output window and choice of diffrent gamemodes
|
||||
# Preparations, so setup of the game output window and choice of diffrent gamemodes
|
||||
programchoice = 200
|
||||
while (programchoice < 1) or (programchoice > 99):
|
||||
programchoice = programchoice = int(input("Welcher Modus? 1 = Normales Spiel, 2 = Liste aller Gewinne mit angabe des Höchsten, 3 = angabe des höchsten Gewinnes, 4 = andgabe des höchsten erreichbaren Feldes: "))
|
||||
programchoice = programchoice = int(
|
||||
input(
|
||||
"Welcher Modus? 1 = Normales Spiel, 2 = Liste aller Gewinne mit angabe des Höchsten, 3 = angabe des höchsten Gewinnes, 4 = andgabe des höchsten erreichbaren Feldes: "
|
||||
)
|
||||
)
|
||||
if (programchoice < 1) or (programchoice > 99):
|
||||
print("Number not within designated range. Try again")
|
||||
print("Willkommen")
|
||||
|
||||
|
||||
|
||||
#MAINGAME
|
||||
#-----------------------
|
||||
# MAINGAME
|
||||
# -----------------------
|
||||
def playgame(field):
|
||||
global winning
|
||||
winning = 0
|
||||
@@ -34,8 +36,9 @@ def playgame(field):
|
||||
winning += next
|
||||
field = next
|
||||
|
||||
#GAMEMODE 1
|
||||
#-------------------------
|
||||
|
||||
# GAMEMODE 1
|
||||
# -------------------------
|
||||
def gamemode1():
|
||||
s = 200
|
||||
while (s < 1) or (s > 99):
|
||||
@@ -49,17 +52,18 @@ def gamemode1():
|
||||
print("Your winnings:", winning)
|
||||
|
||||
|
||||
#GAMEMODE 2
|
||||
#--------------------------
|
||||
# GAMEMODE 2
|
||||
# --------------------------
|
||||
def gamemode2():
|
||||
fieldascending = 1
|
||||
for i in range(99):
|
||||
playgame(fieldascending)
|
||||
print("You win",winning,"with startpoint",fieldascending)
|
||||
print("You win", winning, "with startpoint", fieldascending)
|
||||
fieldascending += 1
|
||||
|
||||
#GAMEMODE 3
|
||||
#--------------------------
|
||||
|
||||
# GAMEMODE 3
|
||||
# --------------------------
|
||||
def gamemode3():
|
||||
fieldascending = 1
|
||||
global winning
|
||||
@@ -71,10 +75,11 @@ def gamemode3():
|
||||
currentwinning = winning
|
||||
currentfield = fieldascending
|
||||
fieldascending += 1
|
||||
print("Biggest possible winning is", currentwinning,"on field", currentfield)
|
||||
print("Biggest possible winning is", currentwinning, "on field", currentfield)
|
||||
|
||||
#GAMEMODE 4
|
||||
#-----------------------------
|
||||
|
||||
# GAMEMODE 4
|
||||
# -----------------------------
|
||||
def gamemode4():
|
||||
fieldascending = 1
|
||||
global winning
|
||||
@@ -94,10 +99,11 @@ def gamemode4():
|
||||
next = field / 2
|
||||
field = next
|
||||
fieldascending += 1
|
||||
print("Biggest possible field is", biggestfield,"on startfield", currentfield)
|
||||
print("Biggest possible field is", biggestfield, "on startfield", currentfield)
|
||||
|
||||
#RUN
|
||||
#-------------------------
|
||||
|
||||
# RUN
|
||||
# -------------------------
|
||||
if programchoice == 1:
|
||||
gamemode1()
|
||||
|
||||
|
||||
16
IO/Idioms.py
16
IO/Idioms.py
@@ -1,7 +1,7 @@
|
||||
#Idioms
|
||||
# Idioms
|
||||
import random
|
||||
|
||||
#Check user input
|
||||
# Check user input
|
||||
s = 200
|
||||
|
||||
while (s < 1) or (s > 99):
|
||||
@@ -12,7 +12,7 @@ while (s < 1) or (s > 99):
|
||||
print("Ok")
|
||||
|
||||
|
||||
#Find biggest number
|
||||
# Find biggest number
|
||||
output = 0
|
||||
for i in range(100):
|
||||
n = random.randint(1, 1000)
|
||||
@@ -22,16 +22,16 @@ for i in range(100):
|
||||
print(output)
|
||||
|
||||
|
||||
#Summ up
|
||||
summ = 0
|
||||
# Sum up
|
||||
sum = 0
|
||||
for i in range(100):
|
||||
n = random.randint(1, 1000)
|
||||
summ += n
|
||||
sum += n
|
||||
|
||||
print(summ)
|
||||
print(sum)
|
||||
|
||||
|
||||
#even or uneven?
|
||||
# even or uneven?
|
||||
z = random.randint(1, 1000)
|
||||
if (z % 2) == 1:
|
||||
print("odd")
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import math
|
||||
|
||||
#Eingabe
|
||||
# Eingabe
|
||||
s = int(input("Seitenlänge: "))
|
||||
|
||||
|
||||
#Verarbeitung
|
||||
# Verarbeitung
|
||||
for i in range(s):
|
||||
print(s * "* ")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ stelle = 1
|
||||
while y > 0:
|
||||
y = y // system
|
||||
outadd = y % system
|
||||
out += (outadd * stelle)
|
||||
out += outadd * stelle
|
||||
stelle *= 10
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
c = (1.4962375e8 / 2.99792458e5)/60
|
||||
c = (1.4962375e8 / 2.99792458e5) / 60
|
||||
|
||||
print(c)
|
||||
@@ -6,5 +6,5 @@ m = 32
|
||||
x = int(time.time()) % m
|
||||
|
||||
for i in range(10):
|
||||
x = (a*x + c) % m
|
||||
x = (a * x + c) % m
|
||||
print(x)
|
||||
@@ -4,3 +4,5 @@ All project files of GLF Informatik at KSWO (bad, but mostly working code)
|
||||
|
||||
# Contents
|
||||
This repo contains all the code that was used in the Computer Science basics course @KSWO. Use at your own risk :)... I wasn't even remotely at the level I am at now when it comes to coding!
|
||||
|
||||
***Please!!!*** Do as as I say (do not put any umlaut or any other kind of non-ascii BS or spaces into filenames), not as I did
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#Import der Module
|
||||
# Import der Module
|
||||
import turtle
|
||||
import time
|
||||
import datetime
|
||||
|
||||
#Setup der einzelnen Turtle instanzen.
|
||||
# Setup der einzelnen Turtle instanzen.
|
||||
turtle.tracer(0)
|
||||
sekundenzeiger = turtle.Turtle()
|
||||
minutenzeiger = turtle.Turtle()
|
||||
@@ -13,7 +13,8 @@ sekundenzeiger.color("red")
|
||||
minutenzeiger.color("blue")
|
||||
stundenzeiger.width(2)
|
||||
|
||||
#Definition des Ziffernblattes
|
||||
|
||||
# Definition des Ziffernblattes
|
||||
def clock_bg():
|
||||
uhr.pd()
|
||||
uhr.dot(10)
|
||||
@@ -32,7 +33,8 @@ def clock_bg():
|
||||
uhr.rt(0.5)
|
||||
uhr.pu()
|
||||
|
||||
#Funktion des Sekundenzeigers
|
||||
|
||||
# Funktion des Sekundenzeigers
|
||||
def sekzeiger():
|
||||
sekundenzeiger.pu()
|
||||
sekundenzeiger.home()
|
||||
@@ -44,19 +46,19 @@ def sekzeiger():
|
||||
sekundenzeiger.fd(220)
|
||||
|
||||
|
||||
#Funktion des Minutenzeigers
|
||||
# Funktion des Minutenzeigers
|
||||
def minzeiger():
|
||||
minutenzeiger.pu()
|
||||
minutenzeiger.home()
|
||||
minutenzeiger.pd()
|
||||
minuten = datetime.datetime.now().minute
|
||||
minutenzeiger.lt((minuten * 6) *(-1))
|
||||
minutenzeiger.lt((minuten * 6) * (-1))
|
||||
minutenzeiger.lt(90)
|
||||
minutenzeiger.bk(30)
|
||||
minutenzeiger.fd(215)
|
||||
|
||||
|
||||
#Funktion des Stundenzeigers
|
||||
# Funktion des Stundenzeigers
|
||||
def stzeiger():
|
||||
stundenzeiger.pu()
|
||||
stundenzeiger.home()
|
||||
@@ -77,7 +79,8 @@ def stzeiger():
|
||||
stundenzeiger.bk(15)
|
||||
stundenzeiger.fd(135)
|
||||
|
||||
#Ganze Uhr
|
||||
|
||||
# Ganze Uhr
|
||||
def clock():
|
||||
sekundenzeiger.clear()
|
||||
minutenzeiger.clear()
|
||||
@@ -93,13 +96,14 @@ def clock():
|
||||
stzeiger()
|
||||
turtle.update()
|
||||
|
||||
#Stoppen der Uhr
|
||||
|
||||
# Stoppen der Uhr
|
||||
def stop():
|
||||
global run
|
||||
run = 0
|
||||
|
||||
|
||||
#Hauptschleife
|
||||
# Hauptschleife
|
||||
def settings():
|
||||
print("Welcome!")
|
||||
global run
|
||||
@@ -117,9 +121,8 @@ def settings():
|
||||
print("process ended")
|
||||
|
||||
|
||||
|
||||
#Startzeit einblenden
|
||||
# Startzeit einblenden
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
|
||||
#Ausführen des Programms
|
||||
# Ausführen des Programms
|
||||
settings()
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
|
||||
addshape("testimage.gif")
|
||||
screensize(1080,1920)
|
||||
screensize(1080, 1920)
|
||||
shape("testimage.gif")
|
||||
color("red")
|
||||
speed(1000)
|
||||
|
||||
|
||||
def walk():
|
||||
w=10
|
||||
length=100
|
||||
w = 10
|
||||
length = 100
|
||||
for i in range(4):
|
||||
w += 10
|
||||
width(w)
|
||||
@@ -17,5 +19,6 @@ def walk():
|
||||
fd(length)
|
||||
rt(90)
|
||||
|
||||
|
||||
walk()
|
||||
exitonclick()
|
||||
@@ -1,4 +1,4 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import subprocess
|
||||
|
||||
subprocess.run(Kreis_zufall_pre.py)
|
||||
@@ -1,3 +1,4 @@
|
||||
# Yes, that is called concat, but sure
|
||||
x = input("Wert x: ")
|
||||
y = input("Wert y: ")
|
||||
z = input("Wert z: ")
|
||||
@@ -11,5 +12,3 @@ while remaining > 1:
|
||||
start += 6
|
||||
ending += 6
|
||||
remaining -= 6
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from turtle import*
|
||||
# No, there is not in fact any recursion here
|
||||
from turtle import *
|
||||
|
||||
t1 = Turtle()
|
||||
t2 = Turtle()
|
||||
|
||||
|
||||
|
||||
go = 3
|
||||
t1.lt(90)
|
||||
t1.speed(1000)
|
||||
@@ -13,37 +13,37 @@ t1.ht()
|
||||
|
||||
def gogo():
|
||||
go = 2
|
||||
while go>1:
|
||||
if t1.xcor() < (window_width()/2 -50):
|
||||
while go > 1:
|
||||
if t1.xcor() < (window_width() / 2 - 50):
|
||||
for i in range(50):
|
||||
t1.fd(2)
|
||||
t1.rt(180/50)
|
||||
if t1.xcor() < (window_width()/2 -50):
|
||||
t1.rt(180 / 50)
|
||||
if t1.xcor() < (window_width() / 2 - 50):
|
||||
for i in range(50):
|
||||
t1.fd(2)
|
||||
t1.lt(180/50)
|
||||
t1.lt(180 / 50)
|
||||
|
||||
else:
|
||||
print("done")
|
||||
print(xcor())
|
||||
go = 1
|
||||
|
||||
|
||||
while go>0 and go<2:
|
||||
if t1.xcor() > (window_width()/2 - window_width()/2 + 50):
|
||||
while go > 0 and go < 2:
|
||||
if t1.xcor() > (window_width() / 2 - window_width() / 2 + 50):
|
||||
for i in range(50):
|
||||
t1.bk(2)
|
||||
t1.lt(180/50)
|
||||
if t1.xcor() > (window_width()/2 - window_width()/2 + 50):
|
||||
t1.lt(180 / 50)
|
||||
if t1.xcor() > (window_width() / 2 - window_width() / 2 + 50):
|
||||
for i in range(50):
|
||||
t1.bk(2)
|
||||
t1.rt(180/50)
|
||||
t1.rt(180 / 50)
|
||||
else:
|
||||
print("home")
|
||||
go = 0
|
||||
onkey(gogo, "space")
|
||||
print("ready")
|
||||
|
||||
|
||||
t2.ht()
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
|
||||
global mistakes
|
||||
mistakes = 0
|
||||
global wortelements
|
||||
@@ -6,8 +7,9 @@ wortelements = []
|
||||
global done
|
||||
done = []
|
||||
|
||||
|
||||
def clear_screen():
|
||||
os.system('cls')
|
||||
os.system("cls")
|
||||
|
||||
|
||||
def worteingabe():
|
||||
@@ -18,16 +20,20 @@ def worteingabe():
|
||||
print("Geben Sie das Gerät weiter.")
|
||||
ausgabe(wort)
|
||||
|
||||
|
||||
def ausgabe(wort):
|
||||
global wortelements
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
Das Wort:
|
||||
""")
|
||||
print(len(wort)*"*")
|
||||
"""
|
||||
)
|
||||
print(len(wort) * "*")
|
||||
global wholewordlist
|
||||
wholewordlist = list(wort)
|
||||
wortelements = list(len(wort)*"*")
|
||||
wortelements = list(len(wort) * "*")
|
||||
|
||||
|
||||
def ersetzen(letter):
|
||||
global wort
|
||||
@@ -49,7 +55,9 @@ def raten():
|
||||
global go
|
||||
go = 1
|
||||
while go == 1:
|
||||
buchstabe = input("Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: ")
|
||||
buchstabe = input(
|
||||
"Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: "
|
||||
)
|
||||
if buchstabe in wholewordlist:
|
||||
print("Der Buchstabe kommt hier vor:")
|
||||
ersetzen(buchstabe)
|
||||
@@ -59,7 +67,7 @@ def raten():
|
||||
print("Dieser Buchstabe wurde bereits eingetippt.")
|
||||
addman()
|
||||
elif buchstabe == wort:
|
||||
wholewordlist = list(len(wort)*"*")
|
||||
wholewordlist = list(len(wort) * "*")
|
||||
else:
|
||||
print("Dieser Buchstabe ist nicht Teil des Wortes")
|
||||
done.append(buchstabe)
|
||||
@@ -69,12 +77,14 @@ def raten():
|
||||
if len(wort) - counts <= 0:
|
||||
go = 0
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
DAS WORT WURDE GEFUNDEN
|
||||
Das Wort:
|
||||
""")
|
||||
"""
|
||||
)
|
||||
print(wort)
|
||||
|
||||
|
||||
@@ -82,15 +92,18 @@ def addman():
|
||||
global mistakes
|
||||
mistakes += 1
|
||||
if mistakes == 1:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
__________
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 2:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -98,9 +111,11 @@ def addman():
|
||||
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 3:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -108,9 +123,11 @@ def addman():
|
||||
|
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 4:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
|
||||
|
|
||||
@@ -118,9 +135,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 5:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
|
|
||||
|
|
||||
@@ -128,9 +147,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -138,9 +159,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -148,9 +171,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 7:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -158,9 +183,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 8:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -168,9 +195,11 @@ def addman():
|
||||
| /
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 9:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -181,13 +210,11 @@ def addman():
|
||||
|
||||
|
||||
DEAD
|
||||
""")
|
||||
"""
|
||||
)
|
||||
global go
|
||||
go = 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
worteingabe()
|
||||
raten()
|
||||
@@ -1,5 +1,5 @@
|
||||
import time
|
||||
|
||||
print ("time.time(): %f " % time.time())
|
||||
print (time.localtime( time.time()))
|
||||
print (time.asctime( time.localtime(time.time())))
|
||||
print("time.time(): %f " % time.time())
|
||||
print(time.localtime(time.time()))
|
||||
print(time.asctime(time.localtime(time.time())))
|
||||
|
||||
@@ -3,12 +3,13 @@ import datetime
|
||||
import time
|
||||
|
||||
|
||||
#Setup
|
||||
# Setup
|
||||
turtle.ht()
|
||||
turtle.tracer(0)
|
||||
turtle.speed(0)
|
||||
|
||||
#Definition der Kreise
|
||||
|
||||
# Definition der Kreise
|
||||
def circles(fill):
|
||||
turtle.pu()
|
||||
turtle.bk(20)
|
||||
@@ -21,11 +22,13 @@ def circles(fill):
|
||||
turtle.end_fill()
|
||||
turtle.pu()
|
||||
|
||||
|
||||
turtle.home()
|
||||
turtle.pu()
|
||||
turtle.bk(25)
|
||||
|
||||
#Postitionieren der Turtle
|
||||
|
||||
# Postitionieren der Turtle
|
||||
def distance(pixels):
|
||||
turtle.home()
|
||||
turtle.pu()
|
||||
@@ -33,17 +36,17 @@ def distance(pixels):
|
||||
turtle.bk(pixels)
|
||||
turtle.rt(90)
|
||||
|
||||
#Berechnen der einzelnen Stellen
|
||||
|
||||
# Berechnen der einzelnen Stellen
|
||||
def main():
|
||||
turtle.clear()
|
||||
turtle.home()
|
||||
h = datetime.datetime.now().hour
|
||||
min = datetime.datetime.now().minute
|
||||
sec = datetime.datetime.now().second
|
||||
hr_pos2 = h//2
|
||||
mn_pos2 = min//2
|
||||
sk_pos2 = sec//2
|
||||
|
||||
hr_pos2 = h // 2
|
||||
mn_pos2 = min // 2
|
||||
sk_pos2 = sec // 2
|
||||
|
||||
for i in range(6):
|
||||
hr_pos2 = hr_pos2 // 2
|
||||
@@ -66,7 +69,8 @@ def main():
|
||||
|
||||
turtle.update()
|
||||
|
||||
#Ausführen
|
||||
|
||||
# Ausführen
|
||||
while True:
|
||||
main()
|
||||
time.sleep(0.1)
|
||||
@@ -1,11 +1,11 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import datetime
|
||||
import time
|
||||
|
||||
style = ("Minecraftia", 75, "normal")
|
||||
tracer(0)
|
||||
|
||||
#Ausführen der Uhr.
|
||||
# Ausführen der Uhr.
|
||||
while True:
|
||||
time.sleep(1)
|
||||
clear()
|
||||
@@ -15,7 +15,7 @@ while True:
|
||||
min = datetime.datetime.now().minute
|
||||
h = datetime.datetime.now().hour
|
||||
bk(350)
|
||||
#Abstände definieren
|
||||
# Abstände definieren
|
||||
if h >= 10:
|
||||
write(h, font=style)
|
||||
fd(200)
|
||||
@@ -24,7 +24,7 @@ while True:
|
||||
fd(100)
|
||||
write(h, font=style)
|
||||
fd(100)
|
||||
write(":", font=style, align = "left")
|
||||
write(":", font=style, align="left")
|
||||
fd(50)
|
||||
if min >= 10:
|
||||
write(min, font=style)
|
||||
@@ -34,7 +34,7 @@ while True:
|
||||
fd(100)
|
||||
write(min, font=style)
|
||||
fd(100)
|
||||
write(":", font=style, align = "left")
|
||||
write(":", font=style, align="left")
|
||||
fd(50)
|
||||
if sec >= 10:
|
||||
write(sec, font=style)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import time
|
||||
|
||||
|
||||
def scene(d):
|
||||
dot(500/d)
|
||||
dot(500 / d)
|
||||
|
||||
|
||||
ht()
|
||||
|
||||
@@ -1,36 +1,39 @@
|
||||
from turtle import *
|
||||
import time
|
||||
r = numinput("PENTAGON","Wie gross soll die Seitenlänge des Pentagons sein?",200)
|
||||
rl = numinput("PENTAGON","Wie viele Ebenen sollen benuzt werden?",3)
|
||||
|
||||
r = numinput("PENTAGON", "Wie gross soll die Seitenlänge des Pentagons sein?", 200)
|
||||
rl = numinput("PENTAGON", "Wie viele Ebenen sollen benuzt werden?", 3)
|
||||
tracer(0)
|
||||
|
||||
|
||||
def pentagon(n, radius):
|
||||
if n == 0:
|
||||
#ausgefülltes Pentagon zeichnen
|
||||
# ausgefülltes Pentagon zeichnen
|
||||
color("Red")
|
||||
begin_fill()
|
||||
for i in range(5):
|
||||
fd(radius)
|
||||
rt(360/5)
|
||||
rt(360 / 5)
|
||||
end_fill()
|
||||
else:
|
||||
for i in range(5):
|
||||
#Positionierung der Turtle
|
||||
# Positionierung der Turtle
|
||||
pu()
|
||||
fd(radius * 2.62 * 0.381966)
|
||||
rt(360/5)
|
||||
rt(360 / 5)
|
||||
pd()
|
||||
#Rekursion
|
||||
pentagon(n - 1,radius * 0.381966)
|
||||
# Rekursion
|
||||
pentagon(n - 1, radius * 0.381966)
|
||||
update()
|
||||
|
||||
|
||||
starttime = time.time()
|
||||
pu()
|
||||
lt(90)
|
||||
fd(r)
|
||||
rt(90)
|
||||
bk(r*0.6)
|
||||
bk(r * 0.6)
|
||||
pd()
|
||||
pentagon(rl, r)
|
||||
|
||||
exitonclick();
|
||||
exitonclick()
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
speed(10000)
|
||||
ht()
|
||||
|
||||
|
||||
|
||||
def kreis_halb(anzahl_seiten,radius):
|
||||
def kreis_halb(anzahl_seiten, radius):
|
||||
for i in range(anzahl_seiten):
|
||||
fd(radius / anzahl_seiten)
|
||||
rt(360 / anzahl_seiten)
|
||||
|
||||
kreis_halb(500,800)
|
||||
|
||||
kreis_halb(500, 800)
|
||||
exitonclick()
|
||||
|
||||
@@ -9,7 +9,9 @@ sideby = int(turtle.numinput("Huhn", "Punkt B, cord y", -100))
|
||||
sidebx = int(turtle.numinput("Huhn", "Punkt B, cord x", -200))
|
||||
sidecy = int(turtle.numinput("Huhn", "Punkt C, cord y", 200))
|
||||
sidecx = int(turtle.numinput("Huhn", "Punkt C, cord x", 0))
|
||||
anzahl_durchgaenge = int(turtle.numinput("Huhn", "Anzahl Durchgänge", 10, minval=1, maxval=100))
|
||||
anzahl_durchgaenge = int(
|
||||
turtle.numinput("Huhn", "Anzahl Durchgänge", 10, minval=1, maxval=100)
|
||||
)
|
||||
stiftdicke = int(turtle.numinput("Huhn", "Stiftdicke", 2, minval=1, maxval=50))
|
||||
durchgang = 0
|
||||
|
||||
@@ -23,8 +25,8 @@ huhn.pu()
|
||||
huhn.ht()
|
||||
|
||||
|
||||
def motion(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke):
|
||||
edge = random.randint(1,3)
|
||||
def motion(sideay, sideax, sideby, sidebx, sidecy, sidecx, stiftdicke):
|
||||
edge = random.randint(1, 3)
|
||||
if edge == 1:
|
||||
x = sideax
|
||||
y = sideay
|
||||
@@ -37,14 +39,15 @@ def motion(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke):
|
||||
y = sidecy
|
||||
|
||||
huhn.setheading(huhn.towards(x, y))
|
||||
nextpos = (math.sqrt((x - huhn.xcor())**2 + (y - huhn.ycor()) **2)) / 2
|
||||
nextpos = (math.sqrt((x - huhn.xcor()) ** 2 + (y - huhn.ycor()) ** 2)) / 2
|
||||
huhn.fd(nextpos)
|
||||
huhn.pd()
|
||||
huhn.dot(stiftdicke)
|
||||
huhn.pu()
|
||||
|
||||
def motion_pre(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke):
|
||||
edge = random.randint(1,3)
|
||||
|
||||
def motion_pre(sideay, sideax, sideby, sidebx, sidecy, sidecx, stiftdicke):
|
||||
edge = random.randint(1, 3)
|
||||
if edge == 1:
|
||||
x = sideax
|
||||
y = sideay
|
||||
@@ -57,31 +60,32 @@ def motion_pre(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke):
|
||||
y = sidecy
|
||||
|
||||
huhn.setheading(huhn.towards(x, y))
|
||||
nextpos = (math.sqrt((x - huhn.xcor())**2 + (y - huhn.ycor()) **2)) / 2
|
||||
nextpos = (math.sqrt((x - huhn.xcor()) ** 2 + (y - huhn.ycor()) ** 2)) / 2
|
||||
huhn.fd(nextpos)
|
||||
|
||||
def cagedraw(sideax,sideay,sidebx,sideby,sidecx,sidecy):
|
||||
|
||||
def cagedraw(sideax, sideay, sidebx, sideby, sidecx, sidecy):
|
||||
cage.pu()
|
||||
cage.setpos(sideax,sideay)
|
||||
cage.setpos(sideax, sideay)
|
||||
cage.pd()
|
||||
cage.setpos(sidebx,sideby)
|
||||
cage.setpos(sidecx,sidecy)
|
||||
cage.setpos(sideax,sideay)
|
||||
cage.setpos(sidebx, sideby)
|
||||
cage.setpos(sidecx, sidecy)
|
||||
cage.setpos(sideax, sideay)
|
||||
|
||||
|
||||
print("Started drawing Triangle")
|
||||
cagedraw(sideax,sideay,sidebx,sideby,sidecx,sidecy)
|
||||
cagedraw(sideax, sideay, sidebx, sideby, sidecx, sidecy)
|
||||
|
||||
print("Started mapping... Printing Points of Tranche:")
|
||||
turtle.tracer(1000)
|
||||
print("initialisation")
|
||||
for i in range(50):
|
||||
motion_pre(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke)
|
||||
motion_pre(sideay, sideax, sideby, sidebx, sidecy, sidecx, stiftdicke)
|
||||
|
||||
for i in range(anzahl_durchgaenge):
|
||||
for i in range(1000):
|
||||
motion(sideay,sideax,sideby,sidebx,sidecy,sidecx,stiftdicke)
|
||||
motion(sideay, sideax, sideby, sidebx, sidecy, sidecx, stiftdicke)
|
||||
durchgang += 1
|
||||
print(durchgang,"/", anzahl_durchgaenge)
|
||||
print(durchgang, "/", anzahl_durchgaenge)
|
||||
print("done, click to exit")
|
||||
turtle.exitonclick()
|
||||
@@ -1,17 +1,19 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
speed(1000)
|
||||
|
||||
def blatt(seite,winkel,anzahl):
|
||||
|
||||
def blatt(seite, winkel, anzahl):
|
||||
for i in range(anzahl):
|
||||
begin_fill()
|
||||
for i in range(3):
|
||||
fd(seite)
|
||||
lt(winkel)
|
||||
end_fill()
|
||||
rt(360/anzahl)
|
||||
rt(360 / anzahl)
|
||||
|
||||
|
||||
ht()
|
||||
color("green")
|
||||
blatt(100,120,4)
|
||||
blatt(100, 120, 4)
|
||||
exitonclick()
|
||||
@@ -4,14 +4,15 @@ import time
|
||||
|
||||
turtle.pu()
|
||||
|
||||
|
||||
def vieleck_random_randomize():
|
||||
for i in range(random.randint(25, 100)):
|
||||
turtle.color(random.random(),random.random(),random.random())
|
||||
turtle.color(random.random(), random.random(), random.random())
|
||||
size = random.randint(50, 200)
|
||||
turtle.width(random.randint(2, 10))
|
||||
ecken = random.randint(3, 20)
|
||||
turtle.setpos(random.randint(-300,300), random.randint(-300,300))
|
||||
fuellen = random.randint(0,1)
|
||||
turtle.setpos(random.randint(-300, 300), random.randint(-300, 300))
|
||||
fuellen = random.randint(0, 1)
|
||||
turtle.pd()
|
||||
if fuellen >= 1:
|
||||
turtle.begin_fill()
|
||||
@@ -25,11 +26,12 @@ def vieleck_random_randomize():
|
||||
turtle.rt(360 / ecken)
|
||||
turtle.pu()
|
||||
|
||||
|
||||
print("Random Design")
|
||||
draw_time_start = time.time()
|
||||
vieleck_random_randomize()
|
||||
draw_time_end = time.time()
|
||||
print("Drawing has taken", draw_time_end - draw_time_start , "seconds")
|
||||
print("Drawing has taken", draw_time_end - draw_time_start, "seconds")
|
||||
print("Click to exit")
|
||||
|
||||
turtle.exitonclick();
|
||||
turtle.exitonclick()
|
||||
|
||||
@@ -3,9 +3,9 @@ import os
|
||||
|
||||
while True:
|
||||
for i in range(4):
|
||||
print("=", end=" ",flush=True)
|
||||
print("=", end=" ", flush=True)
|
||||
time.sleep(0.5)
|
||||
print("=", end="\r",flush=True)
|
||||
print("=", end="\r", flush=True)
|
||||
time.sleep(0.5)
|
||||
os.system( 'cls' )
|
||||
os.system("cls")
|
||||
time.sleep(0.5)
|
||||
@@ -1,4 +1,4 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
dicke = 3
|
||||
lt(90)
|
||||
@@ -13,4 +13,3 @@ for i in range(10):
|
||||
lt(90)
|
||||
width(dicke)
|
||||
dicke += 2
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
a = int(numinput("Wie alt bist du?", "Bitte als Zahl eingeben",16,minval=1,maxval=100))
|
||||
a = int(
|
||||
numinput("Wie alt bist du?", "Bitte als Zahl eingeben", 16, minval=1, maxval=100)
|
||||
)
|
||||
|
||||
while (a>=16) and (a<=20):
|
||||
while (a >= 16) and (a <= 20):
|
||||
fd(100)
|
||||
a = 1
|
||||
@@ -1,10 +1,10 @@
|
||||
#TICTACTOE V 1.0
|
||||
# TICTACTOE V 1.0
|
||||
|
||||
import time
|
||||
|
||||
#Variables5
|
||||
# Variables5
|
||||
global bd
|
||||
bd = [[0,0,0],[0,0,0],[0,0,0]]
|
||||
bd = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
|
||||
global filled_fields
|
||||
filled_fields = 0
|
||||
global player
|
||||
@@ -15,8 +15,8 @@ global play
|
||||
play = 1
|
||||
|
||||
|
||||
#FUNCTIONS
|
||||
#--------------------
|
||||
# FUNCTIONS
|
||||
# --------------------
|
||||
def inputs():
|
||||
global playershow
|
||||
global bd
|
||||
@@ -28,16 +28,21 @@ def inputs():
|
||||
z = int(zl) - 1
|
||||
s = ord(sp) - 65
|
||||
if bd[z][s] > 0:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
THAT FIELD IS ALREADY TAKEN, CHOOSE DIFFERENT ONE!
|
||||
""")
|
||||
"""
|
||||
)
|
||||
else:
|
||||
inputremap(z,s)
|
||||
inputremap(z, s)
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
PLEASE TYPE IN A LEGIT COORDINATE:
|
||||
FORM: Coordinate Y Coordinate X --> Ex. A1/A2
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def inputremap(z, s):
|
||||
global player
|
||||
@@ -63,9 +68,11 @@ def winning():
|
||||
global go
|
||||
go = 1
|
||||
count = 0
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
checking for winner
|
||||
""")
|
||||
"""
|
||||
)
|
||||
while go == 1:
|
||||
if sum(bd[x]) == 3:
|
||||
go = 0
|
||||
@@ -88,11 +95,14 @@ checking for winner
|
||||
y += 1
|
||||
if count >= 2:
|
||||
go = 0
|
||||
print("""no winner yet
|
||||
""")
|
||||
print(
|
||||
"""no winner yet
|
||||
"""
|
||||
)
|
||||
else:
|
||||
count += 1
|
||||
|
||||
|
||||
def full(filled_field):
|
||||
global bd
|
||||
if filled_field == 9:
|
||||
@@ -103,7 +113,7 @@ def full(filled_field):
|
||||
winning()
|
||||
|
||||
|
||||
#BOARD DRAWING
|
||||
# BOARD DRAWING
|
||||
def board_draw():
|
||||
print("\n")
|
||||
xx = 0
|
||||
@@ -112,17 +122,17 @@ def board_draw():
|
||||
while yy < 3:
|
||||
while xx < 3:
|
||||
if bd[xx][yy] == 0:
|
||||
print(" ", end = " ")
|
||||
print(" ", end=" ")
|
||||
elif bd[xx][yy] == 1:
|
||||
print(" X ", end = " ")
|
||||
print(" X ", end=" ")
|
||||
elif bd[xx][yy] == 7:
|
||||
print(" O ", end = " ")
|
||||
print(" O ", end=" ")
|
||||
else:
|
||||
print(""" CRITICAL ERROR""")
|
||||
if xx < 2:
|
||||
print("|", end = " ")
|
||||
print("|", end=" ")
|
||||
else:
|
||||
print(" ", end = " ")
|
||||
print(" ", end=" ")
|
||||
xx += 1
|
||||
print(" ")
|
||||
xx = 0
|
||||
@@ -133,12 +143,11 @@ def board_draw():
|
||||
yy += 1
|
||||
|
||||
|
||||
# MAIN CYCLE
|
||||
print(50 * ("\n"))
|
||||
|
||||
|
||||
#MAIN CYCLE
|
||||
print(50*("\n"))
|
||||
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
------------------------------------------------------
|
||||
|
||||
@@ -153,35 +162,42 @@ print("""
|
||||
|
||||
|
||||
by Janis Hutz
|
||||
""")
|
||||
"""
|
||||
)
|
||||
time.sleep(2)
|
||||
print("starting...")
|
||||
time.sleep(3)
|
||||
print("\n\n\n")
|
||||
goahead = 1
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
| |
|
||||
----------------
|
||||
| |
|
||||
----------------
|
||||
| |
|
||||
""")
|
||||
"""
|
||||
)
|
||||
while goahead == 1:
|
||||
while play == 1:
|
||||
inputs()
|
||||
board_draw()
|
||||
time.sleep(2)
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
REPLAY?
|
||||
""")
|
||||
"""
|
||||
)
|
||||
i = input("""Choose: (y/n)""")
|
||||
if i == "y":
|
||||
goahead = 1
|
||||
play = 1
|
||||
else:
|
||||
goahead = 0
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
GOOD BYE!
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
lt(90)
|
||||
width(3)
|
||||
speed(1000)
|
||||
|
||||
|
||||
def stiel(orientation):
|
||||
color("green")
|
||||
for i in range(50):
|
||||
@@ -19,25 +20,23 @@ def leaves():
|
||||
color("red")
|
||||
for i in range(100):
|
||||
fd(3)
|
||||
rt(360/100)
|
||||
rt(360 / 100)
|
||||
|
||||
|
||||
|
||||
|
||||
def blume(orientation_in,blaetter):
|
||||
def blume(orientation_in, blaetter):
|
||||
stiel(orientation_in)
|
||||
for i in range(blaetter):
|
||||
leaves()
|
||||
rt(360/blaetter)
|
||||
rt(360 / blaetter)
|
||||
|
||||
|
||||
ht()
|
||||
|
||||
blume(2,5)
|
||||
blume(2, 5)
|
||||
pu()
|
||||
home()
|
||||
fd(50)
|
||||
lt(90)
|
||||
pd()
|
||||
blume(1,10)
|
||||
blume(1, 10)
|
||||
exitonclick()
|
||||
@@ -2,12 +2,10 @@ eingabe = input("Dein Text: ")
|
||||
caracter = -1
|
||||
morecaracters = True
|
||||
amountleft = len(eingabe)
|
||||
while morecaracters == True:
|
||||
while morecaracters:
|
||||
print(eingabe[caracter], end="")
|
||||
if amountleft > 1:
|
||||
caracter -= 1
|
||||
amountleft -= 1
|
||||
else:
|
||||
morecaracters = False
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import time
|
||||
import random
|
||||
|
||||
global stepscount
|
||||
stepscount = 0
|
||||
inventory = []
|
||||
@@ -9,10 +10,9 @@ global goahead
|
||||
goahead = 0
|
||||
|
||||
|
||||
|
||||
|
||||
def cover():
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -48,15 +48,18 @@ def cover():
|
||||
|
||||
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
time.sleep(2)
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
DIES BASIERT AUF EINER WAHREN TATSACHE. DIE SPIELELEMENTE SIND VEREINFACHT UND TEILS
|
||||
UNREALISTISCH DARGESTELLT. WICHTIGE DETAILS WERDEN ZUR EINFACHEREN VERSTÄNDLICHKEIT
|
||||
WEGGELASSEN. DER ERMITTLUNGSPROZESS IST IN WIRKLICHKEIT EINE UNGEHEURLICH SCHWIERIGE
|
||||
AUFGABE UND WIRD HIER AUF EIN MÖGLICHST ÜBERSCHAUBARES MASS GEKÜRZT.
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
time.sleep(5)
|
||||
go = 0
|
||||
while go == 0:
|
||||
@@ -69,7 +72,6 @@ AUFGABE UND WIRD HIER AUF EIN MÖGLICHST ÜBERSCHAUBARES MASS GEKÜRZT.
|
||||
start = time.time()
|
||||
|
||||
|
||||
|
||||
def gameoverpossible():
|
||||
global start
|
||||
if "grounding" not in done:
|
||||
@@ -85,30 +87,35 @@ def gameoverpossible():
|
||||
else:
|
||||
current = time.time()
|
||||
|
||||
|
||||
def gameover1():
|
||||
if random.randint(0,10) == 1:
|
||||
if random.randint(0, 10) == 1:
|
||||
gameover()
|
||||
else:
|
||||
current = time.time()
|
||||
|
||||
|
||||
def gameover2():
|
||||
if random.randint(0,6) == 1:
|
||||
if random.randint(0, 6) == 1:
|
||||
gameover()
|
||||
else:
|
||||
current = time.time()
|
||||
|
||||
|
||||
def gameover3():
|
||||
if random.randint(0,3) == 1:
|
||||
if random.randint(0, 3) == 1:
|
||||
gameover()
|
||||
else:
|
||||
current = time.time()
|
||||
|
||||
|
||||
def gameover():
|
||||
global next
|
||||
next = 0
|
||||
global exit
|
||||
exit = 0
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
NEW YORK TIMES
|
||||
|
||||
DIE KATASTROPHE
|
||||
@@ -125,34 +132,41 @@ Flugverbot für die 737 MAX ausgesprochen hatte.
|
||||
|
||||
Oh weh.
|
||||
Das wird einige Konsequenzen für dich nach sich ziehen.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
time.sleep(4)
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
Es ist der nächste Morgen. Du machst dich auf zum Gericht.
|
||||
Die Richter entziehen den Fall deiner Verantwortung und verurteilen dich zu
|
||||
lebenslänglicher Haft, aufgrund von fahrlässiger Tötung. Das ist das Ende deiner
|
||||
Karriere.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
print("Punktezahl: 0")
|
||||
|
||||
|
||||
|
||||
def einfuehrung():
|
||||
print("""Es ist Samstagmorgen... Urplötzlich stürzt eine fast brandneue Boeing 737MAX
|
||||
print(
|
||||
"""Es ist Samstagmorgen... Urplötzlich stürzt eine fast brandneue Boeing 737MAX
|
||||
von Ethiopian Airlines ab. Die Welt ist schockiert, da dies bereits der zweite Absturz dieses
|
||||
Typs ist. Beides Mal waren fast brandneue Flugzeuge involviert. Beide Abstürze ähnelten sich
|
||||
massiv. Deine Aufgabe ist es nun, die Absturze zu klären.""")
|
||||
print("""
|
||||
massiv. Deine Aufgabe ist es nun, die Absturze zu klären."""
|
||||
)
|
||||
print(
|
||||
"""
|
||||
Als neu ernannter Ermittler musst du dir bereits jetzt eine wichtige Frage stellen:
|
||||
Solltest du ein weltweites Flugverbot für diesen Flugzeugtypen verhängen?
|
||||
Sowohl Boeing als auch die Fluggesellschaften werden sich dagegen sträuben.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
i = userinput("Willst du das Flugverbot verhängen? (y/n)")
|
||||
if i == "y":
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
NEW YORK TIMES
|
||||
|
||||
NTSB ERMITTLER VERHÄNGT FLUGVERBOT FÜR UNGLÜCKSFLIEGER
|
||||
@@ -163,22 +177,27 @@ zu verhängen. Dies ist auf massive Proteste seitens der Fluggesellschaften und
|
||||
gestossen. Jedoch: Viele Aviatikexperten befürworten den Entscheid des Ermittlers. Die
|
||||
Sicherheit der Passagiere muss um jeden Preis gewährleistet werden. Die einzige Möglichkeit
|
||||
dies zu gewährleisten ist, ein Flugverbot auszusprechen.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
done.append("grounding")
|
||||
elif i == "n":
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Die Wirtschaft ist wichtig, ein Pilotenfehler kann ja nicht ausgeschlossen werden.
|
||||
Ermitteln wir!
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
else:
|
||||
print("wrong, retry")
|
||||
einfuehrung()
|
||||
time.sleep(4)
|
||||
|
||||
|
||||
def grundriss():
|
||||
if "grounding" in done:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
_________________________________________________________________________________________________________
|
||||
|
||||
@@ -188,9 +207,11 @@ braucht sie, um das Flugzeug zu verbessern. Der Zeitdruck ist aber geringer, da
|
||||
weiteren Abstürze geschehen können.
|
||||
Hier kannst du alle Gegenstände, welche du auf der Unfallstelle finden kannst
|
||||
untersuchen, um die mögliche Unfallursache herauszufinden.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
_________________________________________________________________________________________________________
|
||||
|
||||
@@ -199,33 +220,39 @@ Dies ist dein Arbeitsplatz an der Unfallstelle. Du solltest dich so schnell wie
|
||||
möglich um diesen Fall kümmern, denn sonst könnte es zu weiteren Abstürzen kommen.
|
||||
Hier kannst du alle Gegenstände, welche du auf der Unfallstelle finden kannst
|
||||
untersuchen, um die mögliche Unfallursache herauszufinden.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def abspann():
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
DU HAST ES GESCHAFFT!
|
||||
GLÜCKWUNSCH!
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
global start
|
||||
global stepscount
|
||||
times = time.time() - start
|
||||
points = times*2 + stepscount**2 - 110
|
||||
points = times * 2 + stepscount**2 - 110
|
||||
if points < 0:
|
||||
print("Deine Zeit: ",times)
|
||||
print("Deine Zeit: ", times)
|
||||
print("\n\nDeine Punkte (Je geringer desto besser): 0")
|
||||
print("\nDeine Anzahl Schritte (Je geringer desto besser):", stepscount)
|
||||
else:
|
||||
print("Deine Zeit: ",times)
|
||||
print("\n\nDeine Punkte (Je geringer desto besser): ",points)
|
||||
print("Deine Zeit: ", times)
|
||||
print("\n\nDeine Punkte (Je geringer desto besser): ", points)
|
||||
print("\nDeine Anzahl Schritte (Je geringer desto besser):", stepscount)
|
||||
bewertung(points)
|
||||
|
||||
|
||||
def bewertung(punkte):
|
||||
print("""
|
||||
DEINE BEWERTUNG:""")
|
||||
print(
|
||||
"""
|
||||
DEINE BEWERTUNG:"""
|
||||
)
|
||||
if punkte <= 0:
|
||||
print(""" GOD """)
|
||||
if punkte < 20:
|
||||
@@ -245,71 +272,92 @@ def bewertung(punkte):
|
||||
def userinput(question):
|
||||
return input(question).lower()
|
||||
|
||||
|
||||
def makedone(item):
|
||||
inventory.remove(item)
|
||||
done.append(item)
|
||||
|
||||
|
||||
def eb():
|
||||
global stepscount
|
||||
stepscount += 1
|
||||
print("""Du befindest dich jetzt im Ermittlerbüro.
|
||||
""")
|
||||
print(
|
||||
"""Du befindest dich jetzt im Ermittlerbüro.
|
||||
"""
|
||||
)
|
||||
while len(inventory) > 0:
|
||||
stepscount += 1
|
||||
if "blackbox" in inventory:
|
||||
makedone("blackbox")
|
||||
print("""Da du ja jetzt die Blackbox des Flugzeugs gefunden hast,
|
||||
print(
|
||||
"""Da du ja jetzt die Blackbox des Flugzeugs gefunden hast,
|
||||
kannst du sie hier im Ermittlerbüro aufmachen und die Flugdaten auslesen.
|
||||
Dies dauert jedoch eine gewisse Zeit. Du öffnest ihn und hoffst, dass einer
|
||||
deiner Spezialisten die Daten retten kann.""")
|
||||
deiner Spezialisten die Daten retten kann."""
|
||||
)
|
||||
time.sleep(7)
|
||||
print("""Dein Spezialist hat es geschafft! Die Daten konten wiederhergestellt werden!
|
||||
print(
|
||||
"""Dein Spezialist hat es geschafft! Die Daten konten wiederhergestellt werden!
|
||||
Du siehst eine Auffälligkeit in den Daten der Flughöhe und der vertikalen Geschwindigkeit.
|
||||
Dies deutet auf massive technische Probleme hin. Auch die Daten des Anstellwinkelsensors 1,
|
||||
sind auffällig: Er hatte die ganze Zeit denselben Anstellwinkel angezeigt.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
if "anstellwinkelsensor" in inventory:
|
||||
print("""Glücklicherweise hast du ihn bereits auf dem Trümmerfeld entdeckt.
|
||||
Du untersuchst ihn nun.""")
|
||||
print(
|
||||
"""Glücklicherweise hast du ihn bereits auf dem Trümmerfeld entdeckt.
|
||||
Du untersuchst ihn nun."""
|
||||
)
|
||||
elif "anstellwinkelsensor" in done:
|
||||
print("""Du hast ihn ja bereits untersucht. """)
|
||||
else:
|
||||
print("""Du solltest dich vielleicht nach dem Sensor umsehen.""")
|
||||
elif "anstellwinkelsensor" in inventory:
|
||||
makedone("anstellwinkelsensor")
|
||||
print("""Da du ja zuvor den Anstellwinkelsensor des Flugzeugs gefunden hast,
|
||||
print(
|
||||
"""Da du ja zuvor den Anstellwinkelsensor des Flugzeugs gefunden hast,
|
||||
kannst du ihn jetzt auf Schäden überprüfen. Du untersuchst die Ströme, welche der
|
||||
Sensor bei Bewegung ausgibst und machst eine Entdeckung:
|
||||
ER FUNKTIONIERT NICHT!
|
||||
Logischerweise könnte er auch durch den Aufprall beschädigt sein, """)
|
||||
Logischerweise könnte er auch durch den Aufprall beschädigt sein, """
|
||||
)
|
||||
if "blackbox" in done:
|
||||
print("""aber die Blackbox bestätigt ja den Ausfall des Sensors.
|
||||
Du bist der Ursache auf der Spur. Glückwunsch!""")
|
||||
print(
|
||||
"""aber die Blackbox bestätigt ja den Ausfall des Sensors.
|
||||
Du bist der Ursache auf der Spur. Glückwunsch!"""
|
||||
)
|
||||
global goahead
|
||||
goahead = 1
|
||||
inventory.clear()
|
||||
else:
|
||||
print("""du solltest deshalb die Blackbox finden, um den Ausfall zu
|
||||
print(
|
||||
"""du solltest deshalb die Blackbox finden, um den Ausfall zu
|
||||
bestätigen.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
print("\n")
|
||||
elif "turbine" in inventory:
|
||||
print("""Du hast eine der beiden Turbinen in das Büro transportieren lassen.
|
||||
print(
|
||||
"""Du hast eine der beiden Turbinen in das Büro transportieren lassen.
|
||||
Als mögliche Absturzursache hast du Triebwerksversagen im Verdacht. Beim Betrachten
|
||||
der Triebwerke erkennst du aber an der Verformung der Schaufeln und dem Dreck
|
||||
in der Turbine selbst, also im Kompressor, dass sie voll funktionstüchtig war.
|
||||
Somit kann ein Absturz durch Triebwerksversagen ausgeschlossen werden.
|
||||
Denn ein modernes Flugzeug kann auch mit nur einem Triebwerk problemlos fliegen.""")
|
||||
Denn ein modernes Flugzeug kann auch mit nur einem Triebwerk problemlos fliegen."""
|
||||
)
|
||||
makedone("turbine")
|
||||
elif "zeugen" in inventory:
|
||||
makedone("zeugen")
|
||||
print("""Du hast ja auch bereits die Zeugen befragt. Du schaust dir deine
|
||||
print(
|
||||
"""Du hast ja auch bereits die Zeugen befragt. Du schaust dir deine
|
||||
Notizen lange an, kannst aber nichts erkennen, was dir für den Fall helfen könnte.
|
||||
Du verwirfst die Aussagen als nicht aussagekräftig.""")
|
||||
Du verwirfst die Aussagen als nicht aussagekräftig."""
|
||||
)
|
||||
time.sleep(5)
|
||||
if goahead == 1:
|
||||
stepscount += 1
|
||||
print("""Du wendest dich nun den Pilotenakten zu. Der Kapitän hatte beachtliche
|
||||
print(
|
||||
"""Du wendest dich nun den Pilotenakten zu. Der Kapitän hatte beachtliche
|
||||
8000 Flugstunden und soweit du erkennen magst, auch keine bekannten Probleme. Auch die
|
||||
(kurze) Karriere des Copiloten war makellos, er hatte jedoch nur 200 Flugstunden.
|
||||
Die Piloten hatten beim Kontakt mit dem Tower Probleme gemeldet und zur Umkehr
|
||||
@@ -328,32 +376,41 @@ gewährleisten. Dies hatte dazu geführt, dass bei dem schon sehr alten Flugzeug
|
||||
Pitch-Up moment grösser wurde und somit die Nase des Flugzeugs in gewissen Fluglagen
|
||||
unkontrolliert nach oben gehen kann. Das MCAS sollte dies verhindern, denn diese Fluglage
|
||||
führt unweigerlich zu einem Strömungsabriss, bei welchem das Flugzeug sogesagt "vom Himmel
|
||||
fallen würde".""")
|
||||
fallen würde"."""
|
||||
)
|
||||
time.sleep(10)
|
||||
if "grounding" in done:
|
||||
stepscount -= 2
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Nachdem du ja glücklicherweise bereits bei Ermittlungsbeginn das Grounding des Typs andgeordnet hattest.
|
||||
Die Fluggesellschaften und Boeing hatten zwar nicht sehr positiv darauf reagiert, aber mit dem was
|
||||
du herausgefunden hattest, sind jetzt alle froh, dass du es getan hattest.
|
||||
Die 737 MAX war anschliessend bis im Dezember 2020 gegroundet und Boeing fuhr durch dieses Problem
|
||||
massive Verluste ein.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
else:
|
||||
stepscount += 10
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Alle sind schockiert, dass du nicht bereits bei Ermittlungsbeginn ein Grounding angeordnet hattest.
|
||||
Boeing und auch die Fluggesellschaften fanden es zwar erst besser, aber auch sie sind jetzt der Meinung,
|
||||
dass es besser gewesen wäre, wenn du bereits da ein Grounding angeordnet hättest. Deine Haltung davon ist
|
||||
zwar verständlich, aber du wirst trotzdem zur Verantwortung gezogen. Du musst eine Haftstrafe von einem
|
||||
Jahr absitzen, da du viele Personen in Gefahr gebracht hast. Trotzdem, der Fall ist geklärt.
|
||||
""")
|
||||
"""
|
||||
)
|
||||
return 0
|
||||
else:
|
||||
print("""Um etwas untersuchen zu können, musst du erst etwas in dein Inventar nehmen,
|
||||
print(
|
||||
"""Um etwas untersuchen zu können, musst du erst etwas in dein Inventar nehmen,
|
||||
dann hier zurückkehren. Gehe dazu hinaus auf die Unfallstelle.
|
||||
Auch da könnten sich wichtige Hinweise verstecken.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Heck (h) oder willst du Zeugen befragen (z)? ")
|
||||
Auch da könnten sich wichtige Hinweise verstecken."""
|
||||
)
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Heck (h) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "f":
|
||||
@@ -364,13 +421,14 @@ Auch da könnten sich wichtige Hinweise verstecken.""")
|
||||
return 5
|
||||
|
||||
|
||||
|
||||
def fl():
|
||||
global stepscount
|
||||
stepscount += 1
|
||||
if "flügel" in visited:
|
||||
print("""Du hast den Flügel bereits untersucht.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Heck (h), zum Büro (b) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Heck (h), zum Büro (b) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "b":
|
||||
@@ -383,19 +441,23 @@ def fl():
|
||||
print("wrong, retry")
|
||||
return 2
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Der Flügel. Komplett zertrümmert. Er scheint in einem beinahe 90° Winkel
|
||||
aufgeschlagen zu sein. Du und dein Team finden eine der beiden Turbinen. Du lässt
|
||||
sie in dein Büro transportieren, um sie dort zu untersuchen. Du kannst entweder
|
||||
in dein Büro gehen oder weitersuchen.""")
|
||||
in dein Büro gehen oder weitersuchen."""
|
||||
)
|
||||
i = userinput("Willst du zurück? (y/n)")
|
||||
visited.append("flügel")
|
||||
time.sleep(2)
|
||||
if i == 'y':
|
||||
if i == "y":
|
||||
return 1
|
||||
elif i == 'n':
|
||||
elif i == "n":
|
||||
print("""Du willst also weitersuchen.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Heck (h) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Heck (h) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "h":
|
||||
@@ -407,13 +469,14 @@ in dein Büro gehen oder weitersuchen.""")
|
||||
return 2
|
||||
|
||||
|
||||
|
||||
def hk():
|
||||
global stepscount
|
||||
stepscount += 1
|
||||
if "heck" in visited:
|
||||
print("""Du hast das Heck bereits untersucht.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Büro (b) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Büro (b) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "b":
|
||||
@@ -426,19 +489,23 @@ def hk():
|
||||
print("wrong, retry")
|
||||
return 3
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Du entdeckst etwas, das wie das Seitenleitwerks des Flugzeugs aussehen könnte.
|
||||
Dein grösstes Ziel ist, die Blackbox zu finden. Du hebst Teile an, und plötzlich siehst du sie:
|
||||
Die Blackbox. Du hebst sie auf und lässt sie in dein Büro bringen. """)
|
||||
Die Blackbox. Du hebst sie auf und lässt sie in dein Büro bringen. """
|
||||
)
|
||||
inventory.append("blackbox")
|
||||
time.sleep(1)
|
||||
visited.append("heck")
|
||||
i = userinput("Willst du zurück? (y/n)")
|
||||
if i == 'y':
|
||||
if i == "y":
|
||||
return 1
|
||||
elif i == 'n':
|
||||
elif i == "n":
|
||||
print("""Du willst also weitersuchen.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Flügel (h) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Flügel (h) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "f":
|
||||
@@ -450,13 +517,14 @@ Die Blackbox. Du hebst sie auf und lässt sie in dein Büro bringen. """)
|
||||
return 3
|
||||
|
||||
|
||||
|
||||
def zg():
|
||||
global stepscount
|
||||
stepscount += 1
|
||||
if "zeugen" in visited:
|
||||
print("""Du hast die Zeugen bereits befragt.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Büro (b) oder zum Heck (h)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Flügel (f), zum Büro (b) oder zum Heck (h)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "b":
|
||||
@@ -469,7 +537,8 @@ def zg():
|
||||
print("wrong, retry")
|
||||
return 5
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Du machst dich auf den Weg in ein nahegelegenes Dorf, da du gehört hast, dass eine Person
|
||||
den Absturz gesehen hat.
|
||||
- Hallo. Sie haben den Absturz mitverfolgt?
|
||||
@@ -481,16 +550,19 @@ den Absturz gesehen hat.
|
||||
- Vielen Dank. Sie haben mir geholfen.
|
||||
|
||||
Du machst dich auf den Weg zurück zur Unfallstelle. Willst du dir direkt Gedanken über die
|
||||
Aussagen machen? Dafür musst du ins Büro zurück. """)
|
||||
Aussagen machen? Dafür musst du ins Büro zurück. """
|
||||
)
|
||||
inventory.append("zeugen")
|
||||
time.sleep(1)
|
||||
visited.append("zeugen")
|
||||
i = userinput("Willst du zurück? (y/n)")
|
||||
if i == 'y':
|
||||
if i == "y":
|
||||
return 1
|
||||
elif i == 'n':
|
||||
elif i == "n":
|
||||
print("""Du willst also weitersuchen.""")
|
||||
i = userinput("Wo willst du hin? Zum Cockpit (c), zum Heck (h) oder zum Flügel (f)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Cockpit (c), zum Heck (h) oder zum Flügel (f)? "
|
||||
)
|
||||
if i == "c":
|
||||
return 4
|
||||
if i == "h":
|
||||
@@ -502,13 +574,14 @@ den Absturz gesehen hat.
|
||||
return 5
|
||||
|
||||
|
||||
|
||||
def co():
|
||||
global stepscount
|
||||
stepscount += 1
|
||||
if "cockpit" in visited:
|
||||
print("""Du hast das Cockpit bereits untersucht.""")
|
||||
i = userinput("Wo willst du hin? Zum Heck (h), zum Flügel (f), zum Büro (b) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Heck (h), zum Flügel (f), zum Büro (b) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "h":
|
||||
return 3
|
||||
if i == "b":
|
||||
@@ -521,19 +594,23 @@ def co():
|
||||
print("wrong, retry")
|
||||
return 4
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
Du näherst dich der Nase des Flugzeugs. Vorsichtig läufst du umher. Vor dir liegt ein Sensor.
|
||||
Er scheint defekt zu sein. Du hebst ihn auf und lässt ihn in dein Büro bringen.
|
||||
Du kannst zurück gehen und ihn untersuchen oder weitersuchen.""")
|
||||
Du kannst zurück gehen und ihn untersuchen oder weitersuchen."""
|
||||
)
|
||||
inventory.append("anstellwinkelsensor")
|
||||
time.sleep(1)
|
||||
visited.append("cockpit")
|
||||
i = userinput("Willst du zurück? (y/n)")
|
||||
if i == 'y':
|
||||
if i == "y":
|
||||
return 1
|
||||
elif i == 'n':
|
||||
elif i == "n":
|
||||
print("""Du willst also weitersuchen.""")
|
||||
i = userinput("Wo willst du hin? Zum Flügel (f), zum Heck (h) oder willst du Zeugen befragen (z)? ")
|
||||
i = userinput(
|
||||
"Wo willst du hin? Zum Flügel (f), zum Heck (h) oder willst du Zeugen befragen (z)? "
|
||||
)
|
||||
if i == "f":
|
||||
return 2
|
||||
if i == "h":
|
||||
@@ -545,8 +622,6 @@ Du kannst zurück gehen und ihn untersuchen oder weitersuchen.""")
|
||||
return 4
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
cover()
|
||||
einfuehrung()
|
||||
@@ -574,4 +649,5 @@ def main():
|
||||
if exit == 1:
|
||||
abspann()
|
||||
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user