Predator-Prey Modeling in Clojure

April 28, 2015

Introduction to Predator-Prey Systems

In this edition of the blog, I'll discuss how you can use Clojure to solve a system of nonlinear differential equations. he particular system I'll be solving is the Predator-Prey or Lotka-Volterra Model, which you can read all about right here. The basic concept is that you are modeling a population of predators and prey (e.g. Foxes and Rabbits, which we'll use here). How the two populations change over time can be modeled like so:

Continue reading →

A-maze-ing Mazes with Clojure

April 11, 2015

Introduction

Mazes can be pretty fun. Children love them. Add a dungeon theme (e.g. monsters, loot, and a dragon boss) and most computer programming adults like them, too.

Continue reading →

Using juxt to Compute Signed Angular Distances

March 31, 2015

Juxt is one of those weird Clojure functions that just doesn't make sense until you see it in action. However, once you get it, you love it. This short example shows a great use of the juxt function.

What does juxt do? It creates a function that is the application of a list of functions to a single argument. In simpler terms, a typical function returns one result for one input. In the case of juxt, you create a function that returns n results for one input. The n results are computed from the n functions that you juxtapose.

Continue reading →

Conway's Game of Life

March 30, 2015

The Project

I wanted to create an interesting project in Clojure that had the following features:

Continue reading →