September 20, 2013For Versus RepeatI have been teaching my 5-year-old to draw pictures with turtlebits, and I have concluded that the For example, he wrote this: play 'abcdefg' And he came to me saying "Dad, help me make it repeat 10 times." I told him to try to figure out a for p in [1..10] play 'abcdefg' But after we typed that, he clearly didn't understand what We can eliminate the p and reduce it to three pieces of punctuation if we define a 'repeat' function: repeat 10, -> play 'abcdefg' However, in the ideal world, repeat 10 play 'abcdefg' I am thinking that maybe a a couple of these types of pedagogical insights should be accumulated into a fork of Iced Coffeescript. Anybody interested in helping me build a Coffeescript variant? Posted by David at September 20, 2013 08:32 AMComments
You can envision having the repeat syntax: (Iced)CoffeeScript supports this index-less variant of the for-loop: for [1..10] then play 'abcdefg' Posted by: Marc at November 29, 2013 04:16 AMWhoa, thanks for pointing that out Marc! That's a bit easier. Posted by: David at November 29, 2013 10:02 AMPost a comment
|
Copyright 2013 © David Bau. All Rights Reserved. |