Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Efficiency etc...

Name: Anonymous 2008-12-18 16:29

So, I find myself solving the Project Euler problems and I come across http://projecteuler.net/index.php?section=problems&id=220
I've got a working solution, but I was wondering how I could make it more efficient...

Name: Anonymous 2008-12-19 15:39

>>17
It's an operator, defined as

(x, y, a) <+> (dx, dy, da) =
  case a of
    0 -> (x + dx, y + dy, a')
    1 -> (x - dy, y + dx, a')
    2 -> (x - dx, y - dy, a')
    3 -> (x + dy, y - dx, a')
  where a' = (a + da) `mod` 4


Are you blind, stupid or trolling?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List