diff --git a/Eobard.jar b/Eobard.jar new file mode 100644 index 0000000..f912dd6 Binary files /dev/null and b/Eobard.jar differ diff --git a/Eobard/.classpath b/Eobard/.classpath new file mode 100644 index 0000000..51a8bba --- /dev/null +++ b/Eobard/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/Eobard/.project b/Eobard/.project new file mode 100644 index 0000000..0f4bb8c --- /dev/null +++ b/Eobard/.project @@ -0,0 +1,17 @@ + + + Eobard + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Eobard/.settings/org.eclipse.jdt.core.prefs b/Eobard/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..3a21537 --- /dev/null +++ b/Eobard/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Eobard/bin/eobard/Eobard.class b/Eobard/bin/eobard/Eobard.class new file mode 100644 index 0000000..e76ee42 Binary files /dev/null and b/Eobard/bin/eobard/Eobard.class differ diff --git a/Eobard/src/eobard/Eobard.java b/Eobard/src/eobard/Eobard.java new file mode 100644 index 0000000..db27dc7 --- /dev/null +++ b/Eobard/src/eobard/Eobard.java @@ -0,0 +1,36 @@ +package eobard; + +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JOptionPane; + +public class Eobard { + + public static void main(String[] args) { + + String stringToReverse = JOptionPane.showInputDialog(null, "String To Reverse:"); + + String result = stringReverser(stringToReverse).toString(); + + JOptionPane.showMessageDialog(null, result); + + } + + public static String stringReverser(String stringMessenger) { + + List stringReverserList = new ArrayList<>(); + + for(int i = stringMessenger.length() - 1; i > -1; i--) { + stringReverserList.add(stringMessenger.charAt(i)); + } + for(int i = 0; i < stringReverserList.size(); i++) { + stringMessenger += stringReverserList.get(i); + } + stringMessenger = stringMessenger.substring((stringMessenger.length() / 2), stringMessenger.length()); + + return stringMessenger; + + } + +} \ No newline at end of file diff --git a/README.md b/README.md index 2f83b60..6dd5d59 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ # Eobard Java application that reverses any given text. Built for practice. + +This task can be done in half the lines and much less complexity by using the "StringBuilder" calss, but I wanted to build it on my own to get un-rusty from basic Java, so the only thing I allowed myself to use was basic programmatic operations and ArrayList. + +Screenshots: + +i.imgur.com/aGiGjwJ.png + +i.imgur.com/aG123cc.png + +To run: + +1. Download .jar +2. Open shell +3. cd to download directory +4. Type "java -jar Eobard.jar" +5. Profit? + + +Below is a much simpler way to do this. Enjoy: + +================================================ + +import javax.swing.JOptionPane; + +public class TestingGrounds { + + public static void main(String[] args) { + + String stringToReverse = JOptionPane.showInputDialog(null, "String To Reverse:"); + + JOptionPane.showMessageDialog(null, new StringBuilder(stringToReverse).reverse().toString()); + + } + +} diff --git a/LICENSE b/UNLICENSE similarity index 100% rename from LICENSE rename to UNLICENSE