Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java

hamsternation
hamsternation
26,540 Points

Help! This code challenge is broken!

My tests passes locally but it always errors out when I try to submit it! Please fix this!! I need to get my badges!! :O

2 Answers

Steven Parker
Steven Parker
215,396 Points

:warning: Be careful about testing a challenge in an external REPL.
If you have misunderstood the challenge, it's also very likely that you will misinterpret the results.

Remember that the challenge isn't just about creating code that runs. It must also serve a specific purpose. When you work externally you may not be testing for purpose with the same stringency that the challenge does.

If you would like help with this specific challenge, please show the code you were submitting.

hamsternation
hamsternation
26,540 Points

Well, the challenge was to download the zipped code, run it in IntelliJ IDE, then run the submit task using Gradle.

My code for the printer task:

  public static void printChipmunksDeclaratively(List<String> chipmunks) {
    // TODO: Print out each of the chipmunks using the forEach method on Iterable
    chipmunks.forEach(s -> System.out.printf("%s! %n", s));
  }

My code for the whisperer task:

  public static void whisperSentencesDeclaratively(List<String> sentences) {
    // TODO: Use a method reference for Main.whisper in the forEach method of sentences
    sentences.forEach(Main::whisper);
  }
Mike Meany
Mike Meany
3,988 Points

Did you ever find a solution to this? It's been plaguing me and many others it seems for months