Skip to main content
stravinsky7's user avatar
stravinsky7's user avatar
stravinsky7's user avatar
stravinsky7
  • Member for 10 years, 11 months
  • Last seen more than 9 years ago
awarded
comment
Project Euler #18 - Max path in a triangle
What is a flexible solution then? I can make the explanation consist of Strings, and println them, but I'm wondering if there's a convention for doing it. The same for the output.. Is there a more advanced technique you would recommend, such as putting them all in a file and reading lines from it or somesuch? Really to make the code flexible, I need to know more i/o because otherwise I don't know what I'm leaving flexibility for :| (where or how to leave it). Makes me want to learn some swing or javafx.
comment
Project Euler #18 - Max path in a triangle
I didn't like the int[] triangle[] code either (will rewrite with int[][]triangle), but as far as i could find, the double brackets are required to declare it as a two dimensional array? (otherwise it's an array that just holds ints, not arrays of them?)
accepted
comment
Project Euler #18 - Max path in a triangle
Also, both of you mentioned using a more general output to be handled by an output interface. I will look into that.
comment
Project Euler #18 - Max path in a triangle
Thanks, bro. Read this like 5 times, will consider how to incorporate 1. a private Triangle class (reuse for all three triangles?) 2. a use default option as an interface which chooses between 2 constructors, one with default Euler settings, and one with user supplied settings. 3. taking the solving/printing of the problem out of the constructor and into a solve function called from main just so it's not so odd =P
asked
Loading…
awarded
awarded
comment
Solving Project Euler challenge
Supposed to avoid thanks, but this is my first post so... I'll just revel in the interwebs. Yeah, it's overkill but student practicing for rl here. The thing that pulls these disparate problems together is the desire for accessibility.
accepted
awarded
asked
Loading…