#haskell - Wed 18 Apr 2007 between 00:03 and 00:14

NY Lost Funds



liquidengineerServer spplit?
dmwit*burp*
It was the most delicious server split I've had in ages, you must send me the recipe!
liquidengineerMind if I run some functions by ya'll?
I'm having some difficulties
dmwit?hpaste
lambdabotHaskell pastebin: http://hpaste.org/new
liquidengineerthey're really short
dmwitOr 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
liquidengineerthat was me....sorry
That should work, shouldn't it?
dmwitliquidengineer: if p then True else False === p
sorearjcreigh: -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
dmwitsorear: Ah, neat, thanks!
liquidengineer: It works, yes.
liquidengineerdmwit?
ah
hpastedmwit annotated "Determine if an input is ((multiple of 4) plus 1)" with "a possible simplification" at http://hpaste.org/1436#a1
sorearliquidengineer: you did all this!?
huh? what did I do?
hpasteliquidengineer annotated "Determine if an input is ((multiple of 4) plus 1)" with "Now with pickMove" at http://hpaste.org/1436#a2
liquidengineerNow, this is where I'm having problems
pickMove should return a 1, 2, or 3 as explained in the comments
It does not.
dmwitliquidengineer: Imagine what happens if you pass that function 0.
Err... to be more specific:
Imagine if numToTake == pieces.
liquidengineerYou'd zero out pieces?
dmwitliquidengineer: You don't really want a recursive function here.
liquidengineerI don't?
a case statement, maybe?
dmwitThere's some simple modular arithmetic that will give the number you're looking for.
liquidengineerOh?
dmwitSuppose there are 37 pieces.
liquidengineerYes.
dmwit(I assume you can take up to three at a time, yes?)
liquidengineerYes

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 114 121 128 

IrcArchive

NY Lost Funds