From 76e8286fd9572bb47b43c0a4b182bc01b4c9e9d0 Mon Sep 17 00:00:00 2001 From: Domenic Gosein <87760323+goseind@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:56:17 +0000 Subject: [PATCH 1/2] align screens and lint code --- kryptolearn/App.js | 1 - kryptolearn/algorithms.js | 5 ++++- kryptolearn/screens/crt.js | 28 +++++++++++++++-------- kryptolearn/screens/euclid.js | 29 ++++++++++++++++++++---- kryptolearn/screens/extendedEuclid.js | 32 +++++++++++++++++++++------ 5 files changed, 73 insertions(+), 22 deletions(-) diff --git a/kryptolearn/App.js b/kryptolearn/App.js index 85d5da4..a4fdfc9 100644 --- a/kryptolearn/App.js +++ b/kryptolearn/App.js @@ -1,4 +1,3 @@ -import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; diff --git a/kryptolearn/algorithms.js b/kryptolearn/algorithms.js index acb8b18..4c1d66c 100644 --- a/kryptolearn/algorithms.js +++ b/kryptolearn/algorithms.js @@ -20,6 +20,8 @@ export function extendedEuclid(a, b) { let xs = [1, 0]; let ys = [0, 1]; let sign = 1; // relevant for minus 1 + let x; + let y; while (b != 0) { const q = Math.floor(a / b); @@ -47,7 +49,8 @@ export function precrt(m) { let bigM = []; bigM[0] = 1; let y = []; - + let ee; + for (let i = 0; i < m.length; i++) { bigM[0] = bigM[0] * m[i]; console.log(`BigM ${bigM}`); diff --git a/kryptolearn/screens/crt.js b/kryptolearn/screens/crt.js index 085cb5b..9011b7f 100644 --- a/kryptolearn/screens/crt.js +++ b/kryptolearn/screens/crt.js @@ -3,10 +3,8 @@ import { SafeAreaView, StyleSheet, TextInput, - Button, Text, ScrollView, - StatusBar, } from 'react-native'; import { crt } from '../algorithms'; @@ -27,7 +25,6 @@ const ChineseRemainderTheorem = () => { return ( - Chinesischer Restsatz als Lösungsverfahren bei gleichzeitiger Kongruenz. Gib mehrere durch Komma getrennte Module und die @@ -45,9 +42,11 @@ const ChineseRemainderTheorem = () => { placeholder="Nenne die Reste a1, a2, .., an (kommagetrennt)" keyboardType="numeric" /> - -