I am thinking that the above question might be formed into a task for the Rosetta Code site?
If I do then I will make sure to announce it here and ask you if you would like to contribute (or allow someone to add your solution with attribution), to the tasks examples.