Back to School Edition: The Hour(s) of Code
- While many of us were enjoying our last weekend of freedom, having fun with our kids or shopping for school supplies, others like Mark were heads down and knee deep in code. It takes a special person and a lot of passion for coding to participate in the annual ICFP Programming contest. Mark’s just that kind of guy and why we are so fortunate to have him at Banyan.
Get on the ‘right side’ of the problem
This year’s ICFP challenge was based on origami. The art of origami transforms paper using an intricate series of folds into beautiful, two-dimensional objects. Right-brained people see the end result and don’t think much about the math required to do this at scale. But for the left-brained among us like Mark, this can be deconstructed and re-engineered using math and programming.
The clock is ticking, time to code
Friday morning, around 7:00 a.m Mark got to work. While we all grew up making paper airplanes, and maybe even some origami birds, this challenge was anything but a five-minute folding exercise. This required Mark’s skills in two-dimensional mapping, geometry, and some math that he, along with many of us, haven’t used in many years. He had to write a program to map a square shape into a special silhouette of what the resulting origami would look like.
Here’s a sample skeleton represented graphically:
Mark used the Haskell programming language and tried rendering it with Postscript. While that worked for the first few, once the coordinates became more complex, the routines broke down; still, he continued to work at it. Even with a simple skeleton there are many possibilities (number of line segments permuted, plus additional segments formed by the unfolding process), so the number of combinations gets very high, very fast. Solving each problem he encountered, until finally breaking Friday night, but motivated to stick with it through the weekend.
Day two: Some light reading before heavy coding
After he returned from his Shakespeare reading on Saturday, he continued to work the problem until he was able to generate a successful solution. That breakthrough fueled Mark through Saturday night. He continued to do all of his coding in Haskell and that worked well: rather than decimals, the shapes were specified with rational numbers like 1/2, and to an extreme, intentionally large numbers like -1792728671193156318471947026432/8656059743299229793415925725865. Since Haskell can do rationals with arbitrarily large numbers it was a fortunate choice, as processing wasn’t a problem. Mark raced the clock, had fun, and stayed up for as long as he could before submitting his solutions for all the problems his program could solve.
Mark inspires us all to do something extraordinary, take on a challenge, and feel the rewards of hard work. Well done Mark!
A real-world application solved by the origami challenge
If you’re wondering how this origami challenge might apply to some real-world problem solving, look no further than geolocation and wayfinding solutions. Two-dimensional planer designs and mapping coordinates allow for a multitude of routes to a destination. Seeing patterns where points repeatedly cross multiple routes can help retailers manage store traffic or strategically place promotions in high traffic areas.