diff options
author | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:45:44 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:45:44 +0200 |
commit | bd5b3c31576fe043ab250fd6c9d684aabe954232 (patch) | |
tree | 3dfbfb8761ef433731d44593d22a54ca396b07c8 |
-rwxr-xr-x | .classpath | 6 | ||||
-rw-r--r-- | .gitignore | 171 | ||||
-rwxr-xr-x | .project | 17 | ||||
-rwxr-xr-x | src/Main.java | 51 |
4 files changed, 245 insertions, 0 deletions
diff --git a/.classpath b/.classpath new file mode 100755 index 0000000..d171cd4 --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d02df8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,171 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/eclipse,java,windows,linux,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=eclipse,java,windows,linux,macos + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/eclipse,java,windows,linux,macos diff --git a/.project b/.project new file mode 100755 index 0000000..c66975b --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Rekursionen</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/src/Main.java b/src/Main.java new file mode 100755 index 0000000..fce6be3 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,51 @@ +
+public class Main {
+
+ public static void main(String[] args) {
+ System.out.println(mult(6, 5));
+ }
+
+ private static long fakultaet(long z) {
+ if(z != 0) return z*fakultaet(z-1);
+ return 1;
+ }
+
+ private static int fibonacci(int i) {
+ if(i == 0) return 0;
+ if(i == 1) return 1;
+ return fibonacci(i-1) + fibonacci(i-2);
+ }
+
+ private static int nachfolger(int z) {
+ return z+1;
+ }
+
+ private static int sum(int n, int m) {
+ if(m == 0) return n;
+ return sum(nachfolger(n), m-1);
+ }
+
+ private static int mult(int n, int m) {
+ if(m == 0) return n;
+ return sum(mult(n, m-1), n);
+ }
+
+ private static int acker(int x, int y) {
+ if(x == 0) return y+1;
+ if(y == 0) return acker(x-1, y);
+ return acker(x-1, acker(x, y-1));
+ }
+
+ private static int ulam(int x) {
+ if(x == 1) return 1;
+ if(x > 1) {
+ if(x%2 == 0) {
+ return ulam(x/2);
+ } else {
+ return ulam((3*x)+1);
+ }
+ }
+ return -1;
+ }
+
+}
|