This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IntroConfiguration import IntroConfiguration # Own file-import | |
class MenuConfiguration: | |
@staticmethod | |
def start_menu(): | |
inputting = True | |
while inputting: | |
start_input = input("Programm starten (P)\nIntro starten (I)\nVersionshistorie starten (V)\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from TicketCalculation import start_ticket_machine | |
from IntroConfiguration import IntroConfiguration | |
try: | |
IntroConfiguration.print_intro() | |
start_ticket_machine() | |
except Exception as ex: | |
exit("Programm wird wegen folgender Ausnahme beendet: " + str(ex)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stderr, stdout | |
from random import randint | |
def start_game(): | |
player1_score = 0 | |
player2_score = 0 | |
print("Es liegen Streichhölzer auf dem Tisch.\n" | |
"Jeder Spieler nimmt abwechselnd 1 bis 3 Streichhölzer vom Tisch runter.\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from BubblesortAlgorithm import BubblesortAlgorithm | |
from IntroConfiguration import IntroConfiguration | |
try: | |
IntroConfiguration.print_intro() | |
bs = BubblesortAlgorithm() | |
arr1 = ['30', '50', '40'] | |
arr2 = bs.fill_array(1000, 100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IntroConfiguration: # Class begin | |
@staticmethod # Upcoming method is independent | |
def print_intro(): # Defining method | |
program_name = "Quicksort-Algorithmus" | |
version_number = "0.1.0" | |
release_date = "28.02.2018" | |
owner_email = "philipp.mindt@crs-online.de" | |
print("".center(50, "*") + "\n**" + # Fifty * in a row + two * at new line | |
"{0:>51}".format("**\n**") + # Two * at the end + two * at new line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
class ShowStrategyAbstract(): # object parameter? | |
@abc.abstractmethod | |
def show(self): | |
pass | |
class ShowEightBitAdderStrategy(ShowEightBitAdderStrategy) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stdout | |
class TrafficLight: | |
def __init__(self): | |
self.greenOn = False | |
self.yellowOn = False | |
self.redOn = False | |
self.operational = True | |
self.operation = "" |