2 files deleted
47 files modified
2 files added
| New file |
| | |
| | | */.idea/* |
| | | .idea/* |
| | | .idea |
| | | helloworld-terminal/dfhi-dom.js |
| | | */data.csv |
| | | **/img/permutation.* |
| | | */.parcel-cache |
| | | node_modules |
| New file |
| | |
| | | Beispiel-Projekten im Jahrgang 2024/2025 |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | |
| | | window.main = function(...argv) { |
| | | let a = 12; |
| | | let b = 5; |
| | | let c = Math.floor(12/5); // 2 |
| | | let d = (12/5) | 0; |
| | | terminal.print(c); |
| | | window.main = (...argv)=> { |
| | | const a = 12; |
| | | const b = 5; |
| | | const c = Math.floor(a/b); // 2 |
| | | const d = (a/b) | 0; |
| | | terminal.print(c, d); |
| | | }; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let n = BigInt(argv[0]); |
| | | let power = 1n; |
| | | const LIMIT = n / 2n; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | let Calendar = { |
| | | const Calendar = { |
| | | months: [undefined, |
| | | "JAN", "FEB", "MÄR", "APR", |
| | | "MAI", "JUN", "JUL", "AUG", |
| | |
| | | return leapYear; |
| | | } |
| | | |
| | | window.main = function(...argv) { |
| | | let month = Number.parseInt(argv[0]); |
| | | let year = Number.parseInt( argv[1] || 2021 ); |
| | | window.main = (...argv) => { |
| | | const month = Number.parseInt(argv[0]); |
| | | const year = Number.parseInt( argv[1] || 2021 ); |
| | | |
| | | Calendar.month = month; |
| | | Calendar.year = year; |
| | | |
| | | let cal = Calendar.showCalendar(); |
| | | const cal = Calendar.showCalendar(); |
| | | terminal.printh(cal); |
| | | }; |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let n = Number.parseInt(argv[0]); |
| | | terminal.clear(); |
| | | printTopBottomLine(n); |
| | |
| | | }; |
| | | |
| | | |
| | | function printTopBottomLine(n, symbol='_') |
| | | { |
| | | const printTopBottomLine = (n, symbol='_') => { |
| | | terminal.print('.'); |
| | | for(let i = 0; i < n; ++i) { |
| | | terminal.print(symbol); |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let a = 0, |
| | | b = 1; |
| | | for(let i = 0; i < 15; ++i) { |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | <p class="description">Simulation eines Würfel</p> |
| | | <label for="run">Klicken Sie auf „Run“ um eine Zahl zu würfeln</label> |
| | | <button name="run" id="run" >Run</button> |
| | | <p class="description">Simulation eines Würfels</p> |
| | | <label for="run">Roll the dice</label> |
| | | <button name="run" id="run" >Roll</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | |
| | | /** |
| | | * Simulation eines Würfel |
| | | * */ |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | const IMG_DIR = "./dice-simulation/assert"; |
| | | |
| | | let min = 1; |
| | |
| | | |
| | | let face = Math.floor(Math.random() * (max - min + 1) + min ); |
| | | let path = `${IMG_DIR}/${face}.png`; |
| | | let img = `<img width="20px" src="${path}" />`; |
| | | let img = `<img width="50px" src="${path}" />`; |
| | | terminal.clear(); |
| | | terminal.printh(img); |
| | | }; |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | Gegenseitige Auruf <input type="text" id="argv" name="argv" /> |
| | | <p class="description">Funktionen, die sich gegenseitig aufrufen</p> |
| | | |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | function leftHand() { |
| | | const leftHand = () => { |
| | | return rightHand(); |
| | | } |
| | | |
| | | function rightHand() { |
| | | const rightHand = () => { |
| | | return leftHand(); |
| | | } |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | terminal.printl(leftHand() + " draws first!"); |
| | | }; |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | terminal.clear(); |
| | | for(let arg of argv) { |
| | | terminal.printl(arg); |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let a = Number.parseInt(argv[0], 10); |
| | | let b = Number.parseInt(argv[1], 10); |
| | | let t = b; |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | <p class="description">Flip A Coin</p> |
| | | |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | <button name="run" id="run" >Flip</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | if( Math.random() < 0.5) { |
| | | terminal.printl("Kopf"); |
| | | } else { |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | <button name="run" id="run" >Rerun</button> |
| | | <p class="description">Programm zum Berechnen der Gravitationskraft zwischen 2 Masse</p> |
| | | |
| | | <label for="argv">Geben Sie das Gewicht von 2 Massen (in Kg) und die Distanz (in meter) ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | <pre id="text-output"></pre> |
| | | <script type="module" src="gravitation.js"></script> |
| | |
| | | |
| | | const G = 6.67430; |
| | | |
| | | window.main = function(...argv) { |
| | | /*const mass1 = parseFloat(argv[0]); |
| | | const mass2 = parseFloat(argv[1]); |
| | | const r = parseFloat(argv[2]); |
| | | let force = G * mass1 * mass2 / (r*r); |
| | | */ |
| | | //(a < b+ c) && (b < a + c) && (c < b + a); |
| | | terminal.printh(force); |
| | | window.main = (...argv) => { |
| | | const mass1 = Number(argv[0]); |
| | | const mass2 = Number(argv[1]); |
| | | const r = Number(argv[2]); |
| | | const force = G * mass1 * mass2 / (r*r); |
| | | terminal.printh(`${force} N`); |
| | | }; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | const n = Number.parseInt(argv[0]); |
| | | let h = 0; |
| | | for(let i = 1; i <=n; ++i) { |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let n = Number.parseInt(argv[0]); |
| | | let stars = '<table>'; |
| | | // Code to create table (with tr and td.... |
| | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let name = argv[0]; |
| | | terminal.print(`Hallo, ${name}!`) |
| | | }; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let name = argv[0]; |
| | | let color = 'blue'; |
| | | let greeting = `<span style='color:${color}'> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | terminal.printl("Hello world"); |
| | | }; |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | <p class="description">(Passen Sie die Beschreibung des Programs hier an.)</p> |
| | | <label for="argv"><code>main</code>'s arguments:</label> <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | <p class="description">Demo Linked List. </p> |
| | | <p>To start program click run</p> |
| | | <button name="run" id="run" >Run</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | function insert(list, value) { |
| | | window.main = () => { |
| | | let list = { |
| | | head: { |
| | | value: "b", |
| | | next: null |
| | | } |
| | | }; |
| | | append(list, "c"); |
| | | terminal.printl(toString(list)); // → (head) -> b -> c -> (null) |
| | | insert(list, "a"); |
| | | terminal.printl(toString(list)); // → (head) -> a -> b -> c -> (null) |
| | | }; |
| | | |
| | | const insert = (list, value) => { |
| | | try{ |
| | | let head = { |
| | | value: value, |
| | |
| | | } |
| | | } |
| | | |
| | | function append(list, value) { |
| | | const append = (list, value) => { |
| | | try{ |
| | | let nextElement = list.head; |
| | | while(nextElement.next != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | function toString(list) { |
| | | const toString = (list) => { |
| | | try{ |
| | | let nextElement = list.head; |
| | | let representation = `(head) -> ${nextElement.value}`; |
| | |
| | | } |
| | | } |
| | | |
| | | window.main = function(...argv) { |
| | | let list = { |
| | | head: { |
| | | value: "b", |
| | | next: null |
| | | } |
| | | }; |
| | | append(list, "c"); |
| | | terminal.printl(toString(list)); // → (head) -> b -> c -> (null) |
| | | insert(list, "a"); |
| | | terminal.printl(toString(list)); // → (head) -> a -> b -> c -> (null) |
| | | }; |
| | | |
| | | |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | <p class="description">(Passen Sie die Beschreibung des Programs hier an.)</p> |
| | | <label for="argv"><code>main</code>'s arguments:</label> <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | <p class="description">Demo literal object</p> |
| | | <button name="run" id="run" >(Re)run</button> |
| | | |
| | | <pre id="text-output"></pre> |
| | | <script type="module" src="literal-object.js"></script> |
| | | |
| | | <p> |
| | | Was passiert mit dem Objekt <code>v2</code> bzw. <code>v3</code> |
| | | wenn Sie <code>v1.key1 = 13</code> nach der Schleife schreiben? |
| | | (S. Sourcecode) |
| | | </p> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let v1 = undefined, |
| | | v2 = undefined, |
| | | v3 = undefined; |
| | |
| | | case 2:{v3 = obj; break;} |
| | | } |
| | | } |
| | | terminal.print(v1); |
| | | terminal.print(v2); |
| | | terminal.print(v3); |
| | | }; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let sumEvent = 0n; |
| | | let sumOdd = 0n; |
| | | let credit = argv[0]; |
| | |
| | | n = n/10n; |
| | | } |
| | | console.log({sumOdd, sumEvent}); |
| | | let sum =(sumEvent + sumOdd) % 10n; |
| | | const sum =(sumEvent + sumOdd) % 10n; |
| | | if (sum === 0n) { |
| | | terminal.printl(`${credit} maybe OK`); |
| | | terminal.printl(`${credit} may be a valid credit number`); |
| | | } else { |
| | | terminal.printl(`${credit} definitiv Wrong`); |
| | | terminal.printl(`${credit} is not a valid credit number`); |
| | | } |
| | | }; |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | // b:h als ratio, Bruch (numerator/denominator) |
| | | const numerator = Number.parseFloat(argv[0]); |
| | | const denominator = Number.parseFloat(argv[1]); |
| | |
| | | |
| | | import {{terminal}} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) {{ |
| | | window.main = (...argv) => {{ |
| | | terminal.print("{program}"); |
| | | }}; |
| | | """ |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | <p class="description">Programm zum Testen der Implementierung von Newton-Verfahen. Klicken Sie auf dem „Ok“ Button um das Erebnis anzeigen zu lassen. |
| | | Das Programm akzeptiert keine Eingabe.</p> |
| | | <!--code>main</code>'s arguments: <input disabled="disabled" type="text" id="argv" name="argv" /--> |
| | | <p class="description">Programm zum Testen der Implementierung von Newton-Verfahren. |
| | | Klicken Sie auf dem „Ok“ Button um das Erebnis anzeigen zu lassen. |
| | | Das Programm akzeptiert keine Eingabe. |
| | | </p> |
| | | <button name="run" id="run" >Ok</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | const testData = [0, 1.25, 3.758, 4.229, 6.735, 123456.789, (1<<30) + 1]; |
| | | for(const c of testData) { |
| | | const cquad = c*c; |
| | |
| | | } |
| | | }; |
| | | |
| | | function sqrt(c) { |
| | | const sqrt = (c) => { |
| | | const EPSILON = 1E-16; |
| | | let xn = c; |
| | | let q = c/xn; // auxiliary variable to avoid multiple division c/xn |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <p class="description">Zuordnung Punkten zu Leistung</p> |
| | | <label for="argv">Geben Sie die Punkte zwischen 0 und 100 ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let points = Number.parseFloat(argv[0]); |
| | | if (points < 0) { |
| | | terminal.printl("Kein gültiger Punkt"); |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <p class="description">Programm zum Berechnen 2^n</p> |
| | | <label for="argv">Geben Sie die Zahl n ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let n = Number.parseInt(argv[0], 10); |
| | | window.main = (...argv) => { |
| | | const n = Number.parseInt(argv[0], 10); |
| | | let power = 1; |
| | | let i = 0; |
| | | while (i <= n) { |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <p class="description">Programm zum Berechnen 2^n</p> |
| | | <label for="argv">Geben Sie die Zahl n ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let n = Number.parseInt(argv[0], 10); |
| | | window.main = (...argv) => { |
| | | const n = Number.parseInt(argv[0], 10); |
| | | let power = 1; |
| | | let i = -1; |
| | | while( ++i <= n) { |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | <p class="description">Primzahl test</p> |
| | | <label for="argv">Geben Sie eine natürliche Zahl ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >OK</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let n = BigInt(argv[0]); |
| | | let primeTest = isPrime(n); |
| | | window.main = (...argv) => { |
| | | const n = BigInt(argv[0]); |
| | | const primeTest = isPrime(n); |
| | | if (primeTest) { |
| | | terminal.printl(`${n} ist eine Primzahl`); |
| | | } else { |
| | |
| | | } |
| | | }; |
| | | |
| | | function isPrime(n) { |
| | | const isPrime = (n) => { |
| | | let p = BigInt(n); |
| | | if (p < 2n) { |
| | | return false; |
| | |
| | | </head> |
| | | <body> |
| | | |
| | | <code>Main Function</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | <p class="description">Primzahl test</p> |
| | | <label for="argv">Geben Sie eine natürliche Zahl ein!</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >OK</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let n = BigInt(argv[0]); |
| | | for (var factor = 2n; factor <= n/factor; ++factor) { // factor is used after the for-loop, therefore var |
| | | window.main = (...argv) => { |
| | | const n = BigInt(argv[0]); |
| | | // factor is used after the for-loop, therefore var |
| | | for (var factor = 2n; factor <= n/factor; ++factor) { |
| | | if (n % factor === 0n) { |
| | | break; |
| | | } |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <p class="description">Programm zum Lösen einer quadratischen Gleichung</p> |
| | | <label for="argv">Geben Sie die Parameter a, b, c einer quadratischen Gleichung, getrennt von Leerzeichen ein! |
| | | Zum Beispiel <code>1 -3 2</code><br/> |
| | | </label> |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let a = Number(argv[0]), |
| | | b = Number(argv[1]), |
| | | c = Number(argv[2]); |
| | | let delta = b*b - 4*a*c; |
| | | let d = Math.sqrt(delta); |
| | | let x1 = (-b + d) / (2*a), |
| | | x2 = (-b - d) / (2*a); |
| | | window.main = (...argv) => { |
| | | const a = Number(argv[0]), |
| | | b = Number(argv[1]), |
| | | c = Number(argv[2]); |
| | | const delta = b*b - 4*a*c; |
| | | const d = Math.sqrt(delta); |
| | | const x1 = (-b + d) / (2*a), |
| | | x2 = (-b - d) / (2*a); |
| | | |
| | | terminal.printl(`Equation: ${a}x^2 + (${b})x + (${c})`); |
| | | terminal.printl(`first solution: ${x1}`); |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | const x = Number.parseFloat(argv[0]); |
| | | const variant1 = exp1(x); |
| | | const variant2 = exp2(x); |
| | |
| | | |
| | | |
| | | |
| | | function exp1(x) { |
| | | const exp1 = (x) => { |
| | | let sum = 1.0; |
| | | const NUM_OF_TERM = 10; |
| | | //DEBUG: let expression = "1"; |
| | |
| | | return sum; |
| | | } |
| | | |
| | | function exp2(x) { |
| | | const exp2 = (x) => { |
| | | let sum = 1.0; |
| | | const NUM_OF_TERM = 1000; |
| | | for(let n = 1; n <= NUM_OF_TERM; ++n){ |
| | |
| | | return sum; |
| | | } |
| | | |
| | | function exp3(x) { |
| | | const exp3 = (x) => { |
| | | let sum = 0.0, |
| | | term = 1.0; |
| | | for(let n = 1; sum !== sum + term; ++n) { |
| | |
| | | return sum; |
| | | } |
| | | |
| | | function exp4(x) { |
| | | const exp4 = (x) => { |
| | | let sum = 0.0, |
| | | term = 1.0; |
| | | for(let i = 1; sum !== sum+term; ++i) { |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | //const x = Number.parseFloat(argv[0]); |
| | | window.main = (...argv) => { |
| | | //const x = Number(argv[0]); |
| | | //const x_rad = x * Math.PI / 180; |
| | | const alpha = [0, 30, 45, 60, 90]; |
| | | alpha.map(x => x*Math.PI/180).forEach( a => { |
| | |
| | | }; |
| | | |
| | | |
| | | function makeTest(testName, value, impl, ref) { |
| | | const makeTest = (testName, value, impl, ref) => { |
| | | const result = impl(value); |
| | | const expected = ref(value); |
| | | terminal.print(`${testName} result: ${result} expected : ${expected}\n`); |
| | | } |
| | | |
| | | function sin(x) { |
| | | const sin = (x) => { |
| | | let sum = x; |
| | | let term = -(x**3 / 6); |
| | | const xsqr = x*x; |
| | |
| | | return sum; |
| | | } |
| | | |
| | | function cos(x) { |
| | | const cos = (x) => { |
| | | let sum = 1; |
| | | const xsqr = x*x; |
| | | let g = 2; |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | |
| | | <p class="description">Programm zum Ausgeben eines Dreiecks aus <code>*</code></p> |
| | | <p class="description"> |
| | | Geben Sie die Anzahl der Zeile ein (z.B. 6)! |
| | | </p> |
| | | <code>main</code>'s arguments: <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | | <pre id="text-output"></pre> |
| | | <script type="module" src="triangle-star.js"></script> |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | window.main = (...argv) => { |
| | | let n = Number.parseInt(argv[0], 10); |
| | | const character = "*", |
| | | separator = " "; |
| | |
| | | <link rel="stylesheet" href="dfhi.css" /> |
| | | </head> |
| | | <body> |
| | | <p class="description">(Passen Sie die Beschreibung des Programs hier an.)</p> |
| | | <label for="argv"><code>main</code>'s arguments:</label> <input type="text" id="argv" name="argv" /> |
| | | <p class="description"> |
| | | Geben Sie die Anzahl der infizierten Rechner und die Verbreitungsrate ein! |
| | | </p> |
| | | <label for="argv"><code>main</code>'s arguments:</label> |
| | | <input type="text" id="argv" name="argv" /> |
| | | <button name="run" id="run" >Rerun</button> |
| | | |
| | | |
| | |
| | | |
| | | import {terminal} from "./dfhi.js"; |
| | | |
| | | window.main = function(...argv) { |
| | | let n = Number.parseInt(argv[0], 10); |
| | | let k = Number.parseFloat(argv[1]); |
| | | window.main = (...argv) => { |
| | | const n = Number.parseInt(argv[0], 10); |
| | | const k = Number.parseFloat(argv[1]); |
| | | terminal.printl(`n = ${n}`); |
| | | terminal.printl(`k = ${k}`); |
| | | terminal.printl("Min Fälle"); |