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
| import 'dart:math'; // Random Funktion | |
| class Spaceship{ | |
| int posX; | |
| int posY; | |
| int speed; | |
| int shipHp; | |
| //Constructor |
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 Morsecode{ | |
| String inputString = ""; | |
| // Konstruktor | |
| Morsecode(this.inputString); | |
| String generateMorsecode(){ | |
| String stringOutput = ""; | |
| List<String> letters = inputString.split(''); // Der Satz wird durch split('') in Zeichen zerlegt | |
| print("$inputString \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
| class Calculate{ | |
| int operation = 0; | |
| var input1 = 0; | |
| var input2 = 0; | |
| //Kostruktor | |
| Calculate(this.input1, this.input2, this.operation); | |
| double calculateOutput(){ |
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
| /* | |
| Schreibe eine Dart-Anwendung, die eine Zeichenkette von Benutzer entgegennimmt und die Anzahl | |
| der Buchstaben, Wörter und Sätze in dieser Zeichenkette zählt.. | |
| */ | |
| class stringListFunktion{ | |
| List<String> stringList = [""]; | |
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
| /* | |
| Schreibe eine Dart-Anwendung, die das Alter einer Person anhand ihres Geburtsdatums und des | |
| aktuellen Datums berechnet. | |
| */ | |
| void main() { | |
| var currentDate = DateTime.now(); | |
| var birthDate = DateTime(1985, 01, 12); |
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
| /* | |
| Erstelle eine Dart-Anwendung, die es dem Benutzer ermöglicht, Aufgaben mit Titel und Beschreibung hinzuzufügen, | |
| zu bearbeiten und zu löschen. Die Aufgabenliste sollte angezeigt werden können | |
| */ | |
| void main() { | |
| var todo = { |
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
| void main() { | |
| var dictonary = { | |
| "Stinktier": "Skunk", | |
| "Affe": "Monkey", | |
| "Pfirsich": "Peach", | |
| }; | |
| // Add new key/value | |
| dictonary['Wasser'] = "Water"; |
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
| import 'dart:math'; // Random Funktion | |
| // Global vars | |
| List<String> firstCommand = []; | |
| List<String> secondCommand = []; | |
| class Fight{ | |
| List<int> actions; | |
| List<String> speechList = ["seine Fäuste verwandelten das Gesicht seines Gegners in ein Picasso-Gemälde!","hat dem Gegner ins Gesicht geschlagen und ihm eine gratis Clownsnase verpasst.","- meine Schläge sind wie Gedichte - kurz und schmerzhaft!","- ich hoffe, dass der Gegner heute Morgen sein Schmerzmittel genommen hat!","traf den Gegner mit einem Nasentreffer und verwandelte seine Nase in einen Clownshut!","hat dem Gegner ins Gesicht geschlagen und gesagt: 'Willkommen im Club der schmerzhaften Erinnerungen!'","traf den Gegner mit einem Bodyshot und schickte ihn auf eine Bauchlandung!","hat dem Gegner gezeigt, wie man sich im Kreis dreht!","schlug den Gegner mit einem schweren stumpfen Gegenstand","- was soll Ich dazu noch sagen? Das war wie ein Kampf zwischen zwei glatzköpfigen um einen Kamm.","erinnerte sich während des Kampfes an das, was sein |
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
| import 'dart:math'; // Random Funktion | |
| void main() { | |
| print("And the Winner is:\n"); | |
| String theWinner = ""; | |
| List<String> randomList = ["Sabastian", "Sorin", "Alex", "Elena", "Anja", "Shelly", "Giulia", "Marc", "Yaroslawa", "Paul", "Benni", "Dieson", "Timo", "Ladan", "Hiwa", "Sven", "Michael", "Marvin"]; |
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
| import 'dart:math'; // Random Funktion | |
| const charStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; | |
| Random random = Random(); | |
| String getRandomString(int length) => String.fromCharCodes(Iterable.generate( | |
| length, (_) => charStr.codeUnitAt(random.nextInt(charStr.length)))); | |
| void main() { | |
NewerOlder