liquidengineer | Server spplit? |
dmwit | *burp* It was the most delicious server split I've had in ages, you must send me the recipe! |
liquidengineer | Mind if I run some functions by ya'll? I'm having some difficulties |
dmwit | ?hpaste |
lambdabot | Haskell pastebin: http://hpaste.org/new |
liquidengineer | they're really short |
dmwit | Or here is fine if they're very short. =) |
hpaste | (anonymous) pasted "Determine if an input is ((multiple of 4) plus 1)" at http://hpaste.org/1436 |
liquidengineer | that was me....sorry That should work, shouldn't it? |
dmwit | liquidengineer: if p then True else False === p |
sorear | jcreigh: -O implies -fvia-C iff your ghc is 6.6 or older in HEAD, the options are independant dmwit, jcreigh: I've looked at the asm, -fvia-C has a bit test, -fasm has a IDIV |
dmwit | sorear: Ah, neat, thanks! liquidengineer: It works, yes. |
liquidengineer | dmwit? ah |
hpaste | dmwit annotated "Determine if an input is ((multiple of 4) plus 1)" with "a possible simplification" at http://hpaste.org/1436#a1 |
sorear | liquidengineer: you did all this!? huh? what did I do? |
hpaste | liquidengineer annotated "Determine if an input is ((multiple of 4) plus 1)" with "Now with pickMove" at http://hpaste.org/1436#a2 |
liquidengineer | Now, this is where I'm having problems pickMove should return a 1, 2, or 3 as explained in the comments It does not. |
dmwit | liquidengineer: Imagine what happens if you pass that function 0. Err... to be more specific: Imagine if numToTake == pieces. |
liquidengineer | You'd zero out pieces? |
dmwit | liquidengineer: You don't really want a recursive function here. |
liquidengineer | I don't? a case statement, maybe? |
dmwit | There's some simple modular arithmetic that will give the number you're looking for. |
liquidengineer | Oh? |
dmwit | Suppose there are 37 pieces. |
liquidengineer | Yes. |
dmwit | (I assume you can take up to three at a time, yes?) |
liquidengineer | Yes |