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 Introduction to Functional Programming Meet Streams Collecting 3 NES Scores

hamsternation
hamsternation
26,615 Points

Collecting 3 NES scores Failing

I think there's an issue with all these Gradle based code submission tasks. I'm pretty certain my code itself is correct, but every time I try to submit the code to these challenges, it says:

"Oh no! We encountered an error with your last submission."

My code:

  public static List<Score> getFirstThreeNintendoScoresDeclaratively(List<Score> scores) {
    // TODO: Filter the scores stream to be of platform 'Nintendo Entertainment System'
    // TODO: Limit it to 3 scores
    // TODO: Return a newly collected list using the collect method

    return   scores.stream()
      .filter(score -> score.getPlatform().equals("Nintendo Entertainment System"))
      .limit(3)
      .collect(Collectors.toList());
  }

my output locally in my IDE:

4:12:39 PM: Executing ':Main.main()'...

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:Main.main()
There are 3549 total scores. 

Imperatively - First 3 'Nintendo Entertainment System' Scores
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='168,120', player='David Stuart', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='144,300', player='Patrick Stanley', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='126,900', player='Jason Kelly', platform='Nintendo Entertainment System'}
Declaratively - First 3 'Nintendo Entertainment System' Scores
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='168,120', player='David Stuart', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='144,300', player='Patrick Stanley', platform='Nintendo Entertainment System'}
Score{game='Bump 'n' Jump', measuringUnit='NTSC - Points', amountAsString='126,900', player='Jason Kelly', platform='Nintendo Entertainment System'}

BUILD SUCCESSFUL

Total time: 0.252 secs
4:12:40 PM: Execution finished ':Main.main()'.

This happens to the for each challenge and the using method references, and filtering high scores challenges as well!

1 Answer

Will Dutcher
Will Dutcher
2,055 Points

It seems that the Team Treehouse staff is severely poor at answering questions in regards to these upload questions. Every submission is met with "Oh no! We encountered an error with your last submission." The code you've written, to me, appears to be fine. They just haven't updated their applications to accept newer versions of gradle. It's not 2015/2016 anymore...not sure why they stopped supporting this. I think I'm done with this platform once this month's membership rolls off. Also, if you google Craig Dennis, he left for Twilio in 2019. Might also want to google "Medium what happened team treehouse" if you want an interesting read. A huge shame, because I was really digging their teaching methods and the layout. But there is seemingly no support, orversight, curriculum update, or apparent hope for improvement. Good luck.