Browse Source

test

master
Merthan 3 years ago
parent
commit
f3ecc62f34
  1. 10
      .idea/kotlinc.xml
  2. 19
      .idea/libraries/KotlinJavaRuntime.xml
  3. 6
      .idea/misc.xml
  4. 8
      .idea/modules.xml
  5. 7
      .idea/vcs.xml
  6. 0
      README.txt
  7. 12
      Schrebergaerten.iml
  8. BIN
      lib/kotlin-reflect-sources.jar
  9. BIN
      lib/kotlin-reflect.jar
  10. BIN
      lib/kotlin-stdlib-jdk7-sources.jar
  11. BIN
      lib/kotlin-stdlib-jdk7.jar
  12. BIN
      lib/kotlin-stdlib-jdk8-sources.jar
  13. BIN
      lib/kotlin-stdlib-jdk8.jar
  14. BIN
      lib/kotlin-stdlib-sources.jar
  15. BIN
      lib/kotlin-stdlib.jar
  16. BIN
      lib/kotlin-test-sources.jar
  17. BIN
      lib/kotlin-test.jar
  18. 55
      src/MainClass.kt
  19. 7
      src/Rechteck.kt

10
.idea/kotlinc.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
<component name="KotlinCommonCompilerArguments">
<option name="apiVersion" value="1.2" />
<option name="languageVersion" value="1.2" />
</component>
</project>

19
.idea/libraries/KotlinJavaRuntime.xml

@ -0,0 +1,19 @@
<component name="libraryTable">
<library name="KotlinJavaRuntime">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-reflect.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-test.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib-jdk7.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib-jdk8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-reflect-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-test-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib-jdk7-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-stdlib-jdk8-sources.jar!/" />
</SOURCES>
</library>
</component>

6
.idea/misc.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Schrebergaerten.iml" filepath="$PROJECT_DIR$/Schrebergaerten.iml" />
</modules>
</component>
</project>

7
.idea/vcs.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../../37 bwinf/SchrebergaertenGit" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

0
README.txt

12
Schrebergaerten.iml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>

BIN
lib/kotlin-reflect-sources.jar

BIN
lib/kotlin-reflect.jar

BIN
lib/kotlin-stdlib-jdk7-sources.jar

BIN
lib/kotlin-stdlib-jdk7.jar

BIN
lib/kotlin-stdlib-jdk8-sources.jar

BIN
lib/kotlin-stdlib-jdk8.jar

BIN
lib/kotlin-stdlib-sources.jar

BIN
lib/kotlin-stdlib.jar

BIN
lib/kotlin-test-sources.jar

BIN
lib/kotlin-test.jar

55
src/MainClass.kt

@ -0,0 +1,55 @@
import java.awt.Rectangle
fun main(args: Array<String>){
val size=20
for(i in 1..size){
for (j in 1..size){
print("o ")
}
print("\n")
}
getRectangles().apply {
println(getMaxHeight())
println(getMaxWidth())
println(getSqrt())
println(this)
}
}
fun List<Rechteck>.getSqrt():Double{
var res=0
forEach { r-> res+=r.breite }
forEach { r-> res+=r.hoehe }
return Math.sqrt(res.toDouble())
}
fun List<Rechteck>.getMaxHeight():Int{
var height=0;
forEach { r->height+=r.hoehe}
return height
}
fun List<Rechteck>.getMaxWidth():Int{
var width=0;
forEach { r->width+=r.breite}
return width
}
fun getRectangles()= listOf(
Rechteck(6,3),
Rechteck(2,2),
Rechteck(3,1),
Rechteck(4,4),
Rechteck(4,4))
class MainClass {
}

7
src/Rechteck.kt

@ -0,0 +1,7 @@
data class Rechteck(val hoehe:Int,val breite:Int){
override fun toString(): String {
return "$hoehe x ${breite}"
}
}
Loading…
Cancel
Save