Skip to content

Commit

Permalink
Random files lol
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman committed Jun 18, 2016
1 parent b3984d4 commit de6bb9e
Show file tree
Hide file tree
Showing 86 changed files with 1,458 additions and 867 deletions.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
18 changes: 15 additions & 3 deletions recfun/src/main/scala/recfun/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,22 @@ object Main {
/**
* Exercise 2
*/
def balance(chars: List[Char]): Boolean = ???

def balance(chars: List[Char]): Boolean = {
def balanced(chars: List[Char], open: Int): Boolean = {
if (chars.isEmpty) open == 0 //return if the expression is balance if at end of list
else if (chars.head == '(') balanced(chars.tail,open+1) //opening bracket found
else if (chars.head == ')') open>0 && balanced(chars.tail,open-1) //closing bracket found(if negative fails)
else balanced(chars.tail,open)//move forward
}
balanced(chars,0)
}
/**
* Exercise 3
*/
def countChange(money: Int, coins: List[Int]): Int = ???
def countChange(money: Int, coins: List[Int]): Int = {//credit to stack overflow :)
if(money == 0)1
else if(money > 0 && !coins.isEmpty)
countChange(money - coins.head, coins) + countChange(money, coins.tail)
else 0
}
}
1 change: 1 addition & 0 deletions recfun/target/.history
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
submit [email protected] Ur4Dpmm6KKDyheWf
Binary file modified recfun/target/scala-2.11/classes/recfun/Main$.class
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions recfun/target/streams/$global/$global/$global/streams/out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@
[debug] Default repositories:
[debug] Other repositories:
[debug] Default repositories:
[info] 'compiler-interface' not yet compiled for Scala 2.11.7. Compiling...
[info]  Compilation completed in 14.307 s
[debug] Other repositories:
[debug] Default repositories:
[debug] Other repositories:
[debug] Default repositories:
[debug] Other repositories:
[debug] Default repositories:
[debug] Other repositories:
[debug] Default repositories:
12 changes: 12 additions & 0 deletions recfun/target/streams/$global/submit/$global/streams/out
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[info] Attempting to submit "recfun" assignment in "progfun1" course
[info] Using:
[info] - email: [email protected]
[info] - submit token: Ur4Dpmm6KKDyheWf
[info] Connecting to Coursera...
[info] Successfully connected to Coursera. (Status 201)
[info] 
[info] Assignment submitted successfully!
[info] 
[info] You can see how you scored by going to:
[info] https://www.coursera.org/learn/progfun1/programming/Ey6Jf/
[info] and clicking on "My Submission".
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scalac -deprecation -classpath /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/target/scala-2.11/classes:/home/kuzan/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.4.jar:/home/kuzan/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar -bootclasspath /usr/lib/jvm/java-8-jdk/jre/lib/resources.jar:/usr/lib/jvm/java-8-jdk/jre/lib/rt.jar:/usr/lib/jvm/java-8-jdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jsse.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jce.jar:/usr/lib/jvm/java-8-jdk/jre/lib/charsets.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jfr.jar:/usr/lib/jvm/java-8-jdk/jre/classes:/home/kuzan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala
scalac -deprecation -classpath /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/target/scala-2.11/classes:/home/kuzan/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.4.jar:/home/kuzan/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar -bootclasspath /usr/lib/jvm/java-8-jdk/jre/lib/resources.jar:/usr/lib/jvm/java-8-jdk/jre/lib/rt.jar:/usr/lib/jvm/java-8-jdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jsse.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jce.jar:/usr/lib/jvm/java-8-jdk/jre/lib/charsets.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jfr.jar:/usr/lib/jvm/java-8-jdk/jre/classes:/home/kuzan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
[debug] 
[debug] Initial source changes: 
[debug]  removed:Set()
[debug]  added: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala, /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala)
[debug]  added: Set()
[debug]  modified: Set()
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala, /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala)
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]  product: Set()
[debug]  binary dep: Set()
[debug]  external source: Set()
[debug] All initially invalidated sources: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala, /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala)
[debug] Recompiling all 2 sources: invalidated sources (2) exceeded 50.0% of all sources
[info] Compiling 2 Scala sources to /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/target/scala-2.11/classes...
[debug] Getting compiler-interface from component compiler for Scala 2.11.7
[debug] Plain interface to Scala compiler 2.11.7 with arguments: 
[debug]  -nowarn
[debug]  -d
[debug]  /tmp/sbt_67d0f2a3
[debug]  -bootclasspath
[debug]  /usr/lib/jvm/java-8-jdk/jre/lib/resources.jar:/usr/lib/jvm/java-8-jdk/jre/lib/rt.jar:/usr/lib/jvm/java-8-jdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jsse.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jce.jar:/usr/lib/jvm/java-8-jdk/jre/lib/charsets.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jfr.jar:/usr/lib/jvm/java-8-jdk/jre/classes:/home/kuzan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar
[debug]  -classpath
[debug]  /home/kuzan/.sbt/boot/scala-2.10.5/org.scala-sbt/sbt/0.13.9/xsbti/interface-0.13.9.jar:/home/kuzan/.sbt/boot/scala-2.10.5/org.scala-sbt/sbt/0.13.9/compiler-interface-src/compiler-interface-src-0.13.9.jar:/home/kuzan/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/home/kuzan/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/home/kuzan/.ivy2/cache/jline/jline/jars/jline-2.12.1.jar
[debug]  /tmp/sbt_254d0030/xsbt/API.scala
[debug]  /tmp/sbt_254d0030/xsbt/Analyzer.scala
[debug]  /tmp/sbt_254d0030/xsbt/Command.scala
[debug]  /tmp/sbt_254d0030/xsbt/Compat.scala
[debug]  /tmp/sbt_254d0030/xsbt/CompilerInterface.scala
[debug]  /tmp/sbt_254d0030/xsbt/ConsoleInterface.scala
[debug]  /tmp/sbt_254d0030/xsbt/DelegatingReporter.scala
[debug]  /tmp/sbt_254d0030/xsbt/Dependency.scala
[debug]  /tmp/sbt_254d0030/xsbt/ExtractAPI.scala
[debug]  /tmp/sbt_254d0030/xsbt/ExtractUsedNames.scala
[debug]  /tmp/sbt_254d0030/xsbt/LocateClassFile.scala
[debug]  /tmp/sbt_254d0030/xsbt/Log.scala
[debug]  /tmp/sbt_254d0030/xsbt/Message.scala
[debug]  /tmp/sbt_254d0030/xsbt/ScaladocInterface.scala
[debug] Getting compiler-interface from component compiler for Scala 2.11.7
[debug] Running cached compiler 2452fb5c, interfacing (CompilerInterface) with Scala compiler version 2.11.7
[debug] Calling Scala compiler with arguments (CompilerInterface):
[debug]  -deprecation
[debug]  -bootclasspath
[debug]  /usr/lib/jvm/java-8-jdk/jre/lib/resources.jar:/usr/lib/jvm/java-8-jdk/jre/lib/rt.jar:/usr/lib/jvm/java-8-jdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jsse.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jce.jar:/usr/lib/jvm/java-8-jdk/jre/lib/charsets.jar:/usr/lib/jvm/java-8-jdk/jre/lib/jfr.jar:/usr/lib/jvm/java-8-jdk/jre/classes:/home/kuzan/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar
[debug]  -classpath
[debug]  /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/target/scala-2.11/classes:/home/kuzan/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.4.jar:/home/kuzan/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar:/home/kuzan/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar
[debug] Scala compilation took 15.744373211 s
[debug] Invalidating /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala...
[debug] Invalidating (transitively) by inheritance from /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala...
[debug] Initial set of included nodes: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala)
[debug] Invalidated by transitive inheritance dependency: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala)
[debug] The /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/recfun/Main.scala source file has the following regular definitions changed:
[debug]  notify, wait, $asInstanceOf, equals, asInstanceOf, synchronized, $isInstanceOf, pascal, balance, main, notifyAll, isInstanceOf, ==, clone, Main, toString, !=, getClass, countChange, ne, eq, ##, finalize, hashCode.
[debug] All member reference dependencies will be considered within this context.
[debug] Invalidating /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala...
[debug] Invalidating (transitively) by inheritance from /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala...
[debug] Initial set of included nodes: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala)
[debug] Invalidated by transitive inheritance dependency: Set(/home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala)
[debug] The /home/kuzan/Cousera/Scala/sesion2016/Assignments/recfun/src/main/scala/common/package.scala source file has the following regular definitions changed:
[debug]  notify, package, wait, $asInstanceOf, equals, asInstanceOf, synchronized, $isInstanceOf, resourceAsStreamFromSrc, notifyAll, isInstanceOf, ???, ==, clone, subFile, toString, !=, getClass, ne, eq, ##, finalize, hashCode, ***.
[debug] All member reference dependencies will be considered within this context.
[debug] New invalidations:
[debug]  Set()
[debug] Initial set of included nodes: Set()
[debug] Previously invalidated, but (transitively) depend on new invalidations:
[debug]  Set()
[debug] All newly invalidated sources after taking into account (previously) recompiled sources:Set()
[debug] All initially invalidated sources: Set()
Loading

0 comments on commit de6bb9e

Please sign in to comment.