On 12/7/2008 4:14:16 PM, Pauli Lindgren wrote:
>I have added some Vedit macro
>language examples in Rosetta
>Code,
>http://www.rosettacode.org/wik
>i/Category:Vedit_macro_languag
>e
>
>Rosetta Code is a Wiki that
>shows different programming
>tasks implemented in different
>languages so that you can
>compare the languages.
>There are a few hundred tasks
>and over a hundred languages
>(but typically each task is
>implemented only in 10 to 20
>languages).
>
>The tasks are generally not
>very suitable for Vedit macro
>language, but some of the
>examples may give hints on how
>to implement some not so
>trivial things in Vedit.
>Some examples:
>
> Perhaps the most nontrivial
>task for Vedit is "Dragon
>curve", a program that draws
>Dragon Curve fractal using
>recursive algorithm.
>It shows an example of how you
>can create and display
>bitmapped graphics with Vedit
>macro language.
>The implementation first
>creates a blank BMP file in an
>edit buffer, then plots the
>fractal in that file, and
>finally calls the application
>associated to BMP files to
>display the results.
>
> "Dragon curve" also shows
>how to implement a recursive
>function in Vedit macro
>language. A simpler example of
>that can be found in
>"Sierpinski triangle" task.
>
> "Pascal's Triangle" task
>shows an example on using
>numeric registers as an array.
>
> "Sieve of Eratosthenes" uses
>an edit buffer as an array.
>
> "Monty Hall simulation"
>contains a routine for
>calculating random numbers.
>
> "Data Munging" seems to be
>more typical task for Vedit
>macro language.
>However, it requires floating
>point calculations. I have
>implemented this by using
>fixed point calculations.
>
> "Life in two dimensions" is
>a simplified version of the
>macro you can find at my
>homepage:
>http://koti.mbnet.fi/pkl/vedit
>/life.htm
>
>
>Pauli
Pauli,
I would like to give you a progress report about my visiting the rosettacode url that you have given us.
Incidentally, you did talk about some examples and when I visited I found 74. They are all very informative, so a big thank you for each them. Also, I was interested in the simplest ones and I have stayed away from the difficult ones.
In short, your PASCAL'S_TRIANGLE.VDM works like a charm !
That is to say, the macro which I got by downloading PASCAL'S_TRIANGLE.HTM and extracting the Vedit Macro Language Code from it.
I learned quite a bit from your comment about the Sierpinski triangle, which says the following:
"Recursive
Translation of: BASIC
Vedit macro language does not have recursive functions , so some pushing and popping is needed to implement recursion."
I would have never guessed that your Vedit code is a translation of the BASIC code. I take this translation is not very strict. The important thing is that BASIC should get the credit, since this all started with BASIC.
I certainly would appreciate your including such comments into some of your macros and uploading them to this forum. (I take it would be time wise impossible to give such explanations for each 74 of them.) Another favorite macro of mine is the FIBONNACI.VDM. Again it is a special case of a recursive definition, which can be implemented in VEDIT in a few lines. (In general, I would like to learn about special cases of spreadsheet functions that can be imported into VEDIT.)
Thanks again,
peter.

