Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Um, how do I resolve it? It's not letting me edit my comment because you replied, I am assuming.
Works in JS. This was fun. Good idea. :)
Hey, can anyone check if the java version is broken? I can play with the js version, but pretty sure the Java one is broken.
Blind4Basics, it is still not working for me. Is there anything else I need to do? I placed the import line in the second box (sample tests), and I am still getting the errors. I don't normally edit test cases but I would assume it takes effect right away.
It does this even when I click reset and just have the default code.
Sorry but is the Java version broken? My code runs in Netbeans perfectly, but on codewars I get this:
Error: Command failed: javac -verbose -cp /home/codewarrior -d /home/codewarrior -sourcepath /home/codewarrior -cp /usr/local/groovy/lib/junit-4.12.jar:/usr/local/groovy/lib/hamcrest-core-1.3.jar /home/codewarrior/Dinglemouse.java /home/codewarrior/ExampleTests.java ./frameworks/java/CwRunListener.java
[parsing started RegularFileObject[/home/codewarrior/Dinglemouse.java]]
[parsing completed 46ms]
[parsing started RegularFileObject[/home/codewarrior/ExampleTests.java]]
[parsing completed 5ms]
[parsing started RegularFileObject[./frameworks/java/CwRunListener.java]]
[parsing completed 2ms]
[search path for source files: /home/codewarrior]
[search path for class files: /usr/lib/jvm/java-8-oracle/jre/lib/resources.jar,/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar,/usr/lib/jvm/java-8-oracle/jre/lib/sunrsasign.jar,/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar,/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar,/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar,/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar,/usr/lib/jvm/java-8-oracle/jre/classes,/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar,/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar,/usr/local/groovy/lib/junit-4.12.jar,/usr/local/groovy/lib/hamcrest-core-1.3.jar]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]]
[loading ZipFileIndexFileObject[/usr/local/groovy/lib/junit-4.12.jar(org/junit/Test.class)]]
[loading ZipFileIndexFileObject[/usr/local/groovy/lib/junit-4.12.jar(org/junit/Assert.class)]]
[loading ZipFileIndexFileObject[/usr/local/groovy/lib/junit-4.12.jar(org/junit/runner/notification/Failure.class)]]
[loading ZipFileIndexFileObject[/usr/local/groovy/lib/junit-4.12.jar(org/junit/runner/notification/RunListener.class)]]
[loading ZipFileIndexFileObject[/usr/local/groovy/lib/junit-4.12.jar(org/junit/runner/Description.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/StringWriter.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/PrintWriter.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Throwable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/String.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Retention.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/annotation/RetentionPolicy.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Target.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/annotation/ElementType.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Annotation.class)]]
[checking Dinglemouse]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/Serializable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/System.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/PrintStream.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Appendable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/Closeable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/FilterOutputStream.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/OutputStream.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/Flushable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Byte.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Character.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Short.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Long.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Float.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Integer.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Double.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Boolean.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Void.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Comparable.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/CharSequence.class)]]
[wrote RegularFileObject[/home/codewarrior/Dinglemouse.class]]
[checking ExampleTests]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/StringBuilder.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/StringBuffer.class)]]
/home/codewarrior/ExampleTests.java:23: error: cannot find symbol
assertEquals("Nope", 5, Dinglemouse.howManyBees(_show(hive)));
^
symbol: method howManyBees(char[][])
location: class Dinglemouse
/home/codewarrior/ExampleTests.java:33: error: cannot find symbol
assertEquals("Nope", 7, Dinglemouse.howManyBees(_show(hive)));
^
symbol: method howManyBees(char[][])
location: class Dinglemouse
[checking CwRunListener]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/util/Locale.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/Writer.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/io/File.class)]]
[loading ZipFileIndexFileObject[/usr/lib/jvm/java-8-oracle/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Throwable$PrintStreamOrWriter.class)]]
[total 691ms]
2 errors
I need help. I think I did this correct, and my math by hand, as well as by my software, has a disrepency from what the author says I should get.
Alright. Going by the chart, I see week zero is really just getting a sum of numbers, 1-6. Week one is a range of 2-6, week two is 3-8. The math formula for a range starting at 1 is N * (N+1) /2. Since the number does not always begin at one, I am finding the range of 1-rangeEnd (Saturday) and subtracting from 1-rangeStart (Monday) (edit: sorry, rangeStart-1 because I counted Monday in the first step, and I don't want to count it twice.). Week 0 has a saving of 21, week 1 has a saving of 27, week 3 has a saving of 33.... week 5 is a saving of 51. Adding it all together, by hand, gives me 216, which is also what my software is printing.
I'm a little confused, because according to the author, after week 5 I should only have 105 saved. What am I misunderstanding?
This comment is hidden because it contains spoiler information about the solution