commit 2455fa869f54bdcc7a8ec3f60d49c2002e4c847b Author: pawel Date: Wed May 15 10:27:15 2024 +0200 dodanie plikow diff --git a/css.css b/css.css new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..98e9f38 --- /dev/null +++ b/index.html @@ -0,0 +1,22 @@ + + + + + + Sortowanie Sufiksów + + +

Sortowanie Sufiksów

+ + +

Nieposortowane Sufiksy

+

+    

Posortowane Sufiksy

+

+    
+
+
+
+
\ No newline at end of file
diff --git a/js.js b/js.js
new file mode 100644
index 0000000..6f31706
--- /dev/null
+++ b/js.js
@@ -0,0 +1,13 @@
+function sortujSufiksy() {
+    const slowo = document.getElementById('slowo').value;
+    const sufiksy = [];
+    for (let i = 0; i < slowo.length; i++) {
+        sufiksy.push(slowo.slice(i));
+    }
+    document.getElementById('nieposortowane').textContent = formatSufiksy(sufiksy);
+    sufiksy.sort();
+    document.getElementById('posortowane').textContent = formatSufiksy(sufiksy);
+}
+function formatSufiksy(sufiksy) {
+    return sufiksy.map((sufiks, index) => `${index + 1} ${sufiks}`).join('\n');
+}
diff --git a/text.txt b/text.txt
new file mode 100644
index 0000000..8a3a552
--- /dev/null
+++ b/text.txt
@@ -0,0 +1,3 @@
+
+2247cb473670da4439f474d40c3120657b59f077
+