Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Project Euler coding problems (Questions and Solutions)  (Read 1177 times)

professorlamp

  • Bay Watcher
    • View Profile
    • joereynoldsaudio
Project Euler coding problems (Questions and Solutions)
« on: March 29, 2013, 10:28:53 pm »

Evenin,

I thought I'd just post up the questions and answers (as I work my way through) to some of the project euler problems. Feel free to hand in your own answers and hopefully we can have a single source for all the answers. Right now all of the answers are just scattered across the internet and are in various languages.

Note: All of the solutions I give are written in Python 3.2, I am also a n00b (hence why I'm doing this) so it might take me a while to post some solutions unless someone else gets their first.
Note: Project Eulers site  http://projecteuler.net/

CODERS COME FORTH
Spoiler: Question 1 (click to show/hide)
Spoiler: Solution 1 (click to show/hide)
Spoiler: Question2 (click to show/hide)
Spoiler: Solution2 (click to show/hide)

Spoiler: Question3 (click to show/hide)
Spoiler: Solution3 (click to show/hide)
Spoiler: Question4 (click to show/hide)
Spoiler: Solution4 (click to show/hide)
Spoiler: Question5 (click to show/hide)
Spoiler: Solution5 (click to show/hide)
Spoiler: Solution5(JAVA) (click to show/hide)
Spoiler: Question6 (click to show/hide)
Spoiler: Solution6 (click to show/hide)
Spoiler: Question7 (click to show/hide)
Spoiler: Question8 (click to show/hide)
Spoiler: Question9 (click to show/hide)
Spoiler: Question10 (click to show/hide)
« Last Edit: March 31, 2013, 02:34:28 pm by professorlamp »
Logged
I write music for video games!
www.joereynoldsaudio.com

da dwarf lord

  • Bay Watcher
    • View Profile
Re: Project Euler coding problems (Questions and Solutions)
« Reply #1 on: March 30, 2013, 01:07:43 am »

Here's my solution for problem 2

Spoiler (click to show/hide)

Didn't know this existed till is saw this thread, thanks  :D

EDIT:

Spoiler: Question 3 (click to show/hide)

Spoiler: Question 4 (click to show/hide)
« Last Edit: March 30, 2013, 04:19:05 am by da dwarf lord »
Logged

Killjoy

  • Bay Watcher
    • View Profile
Re: Project Euler coding problems (Questions and Solutions)
« Reply #2 on: March 30, 2013, 07:37:33 am »

Oh I remember I had a lot of fun solving the first 50 or so questions back when I was starting computer science. Then I kind of got bored of it. They are not really programming challenges, besides question 18, 67 (As far as I know) where you can feel a little bit of CS.

I solved them all having a python console open, but I see people solving these using pen, paper and their brain filled with smarts I will never hope to have.

Either way, have fun.
Logged
Merchants Quest me programming a trading game with roguelike elements.

P(ony)SI

  • Bay Watcher
    • View Profile
Re: Project Euler coding problems (Questions and Solutions)
« Reply #3 on: March 30, 2013, 11:38:28 am »

Spoiler: Question 5 (click to show/hide)

Spoiler: Question 6 (click to show/hide)
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: Project Euler coding problems (Questions and Solutions)
« Reply #4 on: March 31, 2013, 02:27:50 pm »

Spoiler: Question 5 (click to show/hide)
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.