Snippets created by Cesar Mendoza

  • Create Disposable

    This pattern is helpful when you want to do something temporarily and then restore some state. This was inspired by the System.Disposable.Disposable() class defined in System.Core.dll distributed by the Reactive Extensions for .NET (Rx) library.

    36 people like this

    Posted: 13 years ago by Cesar Mendoza

  • Combinatorial functions

    Here is my F# take on some combinatorial functions from the book "Introduction to Functional Programming" by Richard Bird and Philip Wadler.

    5 people like this

    Posted: 13 years ago by Cesar Mendoza

  • Ninety-Nine F# Problems - Problems 11 - 20 - List, continued]

    These are F# solutions of Ninety-Nine Haskell Problems which are themselves translations of Ninety-Nine Lisp Problems and Ninety-Nine Prolog Problems. The solutions are hidden so you can try to solve them yourself.

    7 people like this

    Posted: 12 years ago by Cesar Mendoza

  • Ninety-Nine F# Problems - Problems 31 - 41 - Arithmetic]

    These are F# solutions of Ninety-Nine Haskell Problems which are themselves translations of Ninety-Nine Lisp Problems and Ninety-Nine Prolog Problems. The solutions are hidden so you can try to solve them yourself.

    4 people like this

    Posted: 12 years ago by Cesar Mendoza

  • Ninety-Nine F# Problems - Problems 54 - 60 - Binary trees

    These are F# solutions of Ninety-Nine Haskell Problems which are themselves translations of Ninety-Nine Lisp Problems and Ninety-Nine Prolog Problems. The solutions are hidden so you can try to solve them yourself.

    6 people like this

    Posted: 12 years ago by Cesar Mendoza

  • Ninety-Nine F# Problems - Problems 70 - 73 - Multiway Trees

    These are F# solutions of Ninety-Nine Haskell Problems which are themselves translations of Ninety-Nine Lisp Problems and Ninety-Nine Prolog Problems. The solutions are hidden so you can try to solve them yourself.

    5 people like this

    Posted: 12 years ago by Cesar Mendoza

  • Ninety-Nine F# Problems - Problems 90 - 94 - Miscellaneous problems]

    These are F# solutions of Ninety-Nine Haskell Problems which are themselves translations of Ninety-Nine Lisp Problems and Ninety-Nine Prolog Problems. The solutions are hidden so you can try to solve them yourself.

    3 people like this

    Posted: 12 years ago by Cesar Mendoza

  • Coding Kata: Score a Bowling Game

    Score a Bowling game. The game is represented as a list of integers. A game of bowling consists of ten frames. In each frame, the bowler will have two chances to knock down as many pins as possible with his bowling ball. If a bowler is able to knock down all ten pins with the first ball, he is awarded a strike. If the bowler is able to knock down all 10 pins with the two balls of a frame, it is known as a spare. Bonus points are awarded for both of these, depending on what is scored in the next 2 balls (for a strike) or 1 ball (for a spare). If the bowler knocks down all 10 pins in the tenth frame, the bowler is allowed to throw 3 balls for that frame. This allows for a potential of 12 strikes in a single game, and a maximum score of 300 points, a perfect game.

    4 people like this

    Posted: 12 years ago by Cesar Mendoza