Quantcast
Channel: Bonsai Code » Haskell
Browsing latest articles
Browse All 18 View Live

Image may be NSFW.
Clik here to view.

Programming Praxis – MindCipher

In today’s Programming Praxis exercise, our goal is to solve two exercises from the MindCipher website (technically three, but the third one can be solved without programming). Let’s get started, shall...

View Article



Image may be NSFW.
Clik here to view.

Programming Praxis – Coin Change, Part 1

In today’s Programming Praxis exercise, our goal is to list all of the ways in which a target amount can be reached given a list of coin denominations. Let’s get started, shall we? import Data.List We...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – The Seven Bridges of Königsberg

In today’s Programming Praxis exercise, our goal is to write a function that determines whether a given graph is a eulerian circuit, path, or neither and if so, to produce that path. Let’s get started,...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – Egyptian Fractions

In today’s Programming Praxis exercise, our goal is to convert a given fraction to a sum of fractions with numerator 1. Let’s get started, shall we? import Data.Ratio The implementation is fairly...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – Sets

In today’s Programming Praxis exercise, our goal is to implement a Set data structure. Let’s get started, shall we? import Data.Hashable import qualified Data.HashTable.IO as H import Data.List (sort)...

View Article


Image may be NSFW.
Clik here to view.

Programming Praxis – Longest Substring Of Two Unique Characters

In today’s Programming Praxis exercise, our goal is to find the longest substring consisting of only two characters in a string. Let’s get started, shall we? import Data.List First, we group identical...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – 3SUM

In today’s Programming Praxis exercise, our goal is to find all groups of three numbers in a given list that sum up to 0, and to do so in O(n2). Let’s get started, shall we? import Data.List import...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – A Programming Puzzle

In today’s Programming Praxis exercise, our goal is to write a function such that f (f n) = -n. Let’s get started, shall we? My first instinct was to define f as a 90 degree rotation using the complex...

View Article


Image may be NSFW.
Clik here to view.

Programming Praxis – J K Rowling

In today’s Programming Praxis exercise, our goal is to write a program to analyse whether two books were written by the same author. Let’s get started, shall we? import Data.Char import Data.List...

View Article


Image may be NSFW.
Clik here to view.

Programming Praxis – Bit Hacks

In today’s Programming Praxis exercise, our goal is to write three functions that use bit twiddling, namely one to determine a numbers sign, one to determine of the signs of two numbers are equal and...

View Article
Browsing latest articles
Browse All 18 View Live




Latest Images