Euler Design Project

Is there a design template that allows you to create a foundation of components to solve Project Euler problems? I solved ~ 30 questions - and I believe that I will need to reuse the functionality that was previously written (for example, authentication). Instead of writing static methods in a utility class, I was thinking about having a calculator interface - implemented by various specific classes that will solve different problems. Then I could use this as I solve increasingly complex problems - maybe? Does anyone have any good suggestions? I solve problems in Java.

+5
source share
2 answers

There are several functions that come in handy many times, for example, for generating prime numbers. You can save a file with useful functions in them. Also, I don't think there is any benefit. Project Euler's problems are more related to mathematics than to complex programming, I expect that if you need to write a lot of code, you are doing it wrong.

+9
source

A classic template for this kind of thing is a template template template, but you can build it by thinking in other design templates, such as Visitor, it depends on your needs and taste. You can find a useful link: Template Method Template

+1
source

All Articles