Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

Crab Canon Maker In Flex

This crab canon appeared on Hacker News recently, I thought it was really pretty. I started writing my own (I'll post it whenever I finish if I think it's good enough), but noticed that it was fairly hard to do in my head. The amount of context you have to keep track of... Anyway, I took 5-10 minutes or so to write a Canon Maker in Flex that just copies what you wrote and duplicates it to mirror itself.

Source for anyone interested (also below)

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx=""
xmlns:mx="library://" width="100%" height="100%">
<s:VerticalLayout paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10" />
<s:TextArea id="norm" change="alter();" width="100%" height="100%" />
<s:TextArea id="poem" width="100%" height="100%" />
public function alter():void {
poem.text = norm.text + '\n' + norm.text.split('\n').slice(0, -1).reverse().join('\n');

Posted on 2011-06-11 by Jach

Tags: flex


Trackback URL:

Back to the top

Back to the first comment

Comment using the form below

(Only if you want to be notified of further responses, never displayed.)

Your Comment:

LaTeX allowed in comments, use $$\$\$...\$\$$$ to wrap inline and $$[math]...[/math]$$ to wrap blocks.