Newbie help wih project/class

R

Rog

Hi All
Need your expertise please.

I have completed Project Euler problems 1 to 50 using Python.
I have now completed 1 to 7 using c# but I don't think my project
structure is correct.
I created one project for each problem but have the feeling I should
have just the one Euler project with seperate files/classes.

I also need a 'utility' class/project for isprime, iseven, prime
generator etc.

I have the books 'Beginning Visual c# 2005 Express Edition' and
'Beginning C# 3.0', any other recommendations welcome.

Rog
 
A

Arne Vajhøj

I have completed Project Euler problems 1 to 50 using Python.
I have now completed 1 to 7 using c# but I don't think my project
structure is correct.
I created one project for each problem but have the feeling I should
have just the one Euler project with seperate files/classes.

All problems being solved in single exe => one project.

One exe per problem => one project per problem.
I also need a 'utility' class/project for isprime, iseven, prime
generator etc.

Make that a class library project.

Arne
 
B

bradbury9

El martes, 2 de octubre de 2012 00:54:47 UTC+2, Arne Vajhøj escribió:
All problems being solved in single exe => one project.



One exe per problem => one project per problem.







Make that a class library project.



Arne


Maybe you want to check also extension methods, perhaps creating a extension class in the class library proyect.


public static class myExtensions{

public static bool isPrime(this int intValue){
return true;
}
}



int myVariable = 3;

bool varIsPrime = myVariable.isPrime(); // true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top