Another Haskell question

Which pattern is more efficient? Pattern a: circleSumA :: [Int] -> Int circleSumA (i1 : is) = aux i1 is where aux i [] = i + i1 aux i is = i + aux (head is) (tail is) Pattern b: circleSumB :: [Int] -> Int circleSumB is = sum (is ++ [head is]) Is… Continue reading Another Haskell question

Published
Categorized as Haskell

Haskell problem followup

Having read a bit of the next chapter and discovered the zipWith function, I now have a higher-order non-recursive solution to the makeChange problem, viz. makeChange1 :: Int -> [Int] -> [Int] makeChange1 amt vs = zipWith div modvs vs where modvs = scanl mod amt vs

Published
Categorized as Haskell

Haskell problem

Define a function makeChange that, given a nonnegative integer amount and a list of coin denominations, returns a list of the number of coins of each denomination required to make up the amount. For example: makeChange 99 [5,1] => [19,4] i.e. 19 nickels and 4 pennies equals 99 cents. To make life easier, you may… Continue reading Haskell problem

Published
Categorized as Haskell

Building a MAME cabinet 7

Just come back from a trip to Home Depot. I used the truck hire, which was easy. Now I also have 3 sheets of 4’x8′ 3/4″ oak ply in my basement, and I picked up a few 2″x3″x8′ studs too for cutting supports.

Published
Categorized as MAME

More wikihowery

Especially for . How to Find Headers and Libraries for C/C++ Pograms Using pkg-config.

Building a MAME cabinet 6

Today I was given some dedicated time by Mrs Elbeno to start the project. It being 2pm on a Saturday, I didn’t fancy my chances at getting a Home Depot truck hire (my local HD has 2 trucks and it’s first come, first served). Anyway, I headed down there and picked up: 2x 8′ 2x4s… Continue reading Building a MAME cabinet 6

Published
Categorized as MAME