Topic: Vedit macro language in Rosetta Code (1 of 6), Read 43 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Sunday, December 07, 2008 04:14 PM

I have added some Vedit macro language examples in Rosetta Code,
http://www.rosettacode.org/wiki/Category:Vedit_macro_language

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 non-trivial 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

 


Topic: Re: Vedit macro language in Rosetta Code (2 of 6), Read 32 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Monday, December 08, 2008 11:33 PM

At 04:24 PM 12/7/2008, you wrote:
>From: "Pauli Lindgren"
>
>I have added some Vedit macro language examples in Rosetta Code,
>http://www.rosettacode.org/wiki/Category:Vedit_macro_language
>
>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).

Wow. That was very ambitious of you. I was unaware of this Wiki topic.
Thank you for your contributions!

Ted.

 


Topic: Vedit macro language in Rosetta Code (3 of 6), Read 35 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Tuesday, December 23, 2008 01:50 PM

Thanks Pauli,

I just finished teaching the Pascal and the Sierpienski triangles. So, I am looking forward to the next Semester when I can implement it with Vedit.

Incidentally,right now I would like to implement in Vedit the "interval bisection" method. I did find a C++ program implementing it, at

https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6689&lngWId=3

I have a hunch it would be a routine problem for you to import it into Vedit. So, I thought no harm done asking for your reactions, if any.

Thanks again,

-peter.

 


Topic: Vedit macro language in Rosetta Code (4 of 6), Read 25 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Monday, January 19, 2009 12:15 PM

On 12/23/2008 1:50:26 PM, Peter Rejto wrote:
>Thanks Pauli,
>
>Incidentally,right now I would
>like to implement in Vedit the
>"interval bisection" method. I
>did find a C++ program
>implementing it, at
>
>https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6689&lngWId=3
>
>I have a hunch it would be a
>routine problem for you to
>import it into Vedit. So, I
>thought no harm done asking
>for your reactions, if any.

I already answered this long time ago, but my reply seems to have disappeared.

The problem is that Vedit does not support floating point calculations and trigonometric functions etc.
Of course, it would be possible to create a macro that would calculate the roots for simple functions using basic +-*/ operations and integer numbers, but there would be not much use for that.

Incidentally, this kind of mathematical programs were some of the first programs I made when I got my first computer, Sinclair ZX81, back in the year 1981. I made programs to calculate roots, integrals and differential equations. Those were easy to do with ZX81, since the VAL() function of Sinclair Basic could evaluate any expression.

--
Pauli

 


Topic: Vedit macro language in Rosetta Code (5 of 6), Read 10 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Tuesday, June 22, 2010 02:07 AM

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 non-trivial
>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.

 


Topic: Vedit macro language in Rosetta Code (6 of 6), Read 9 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Sunday, June 27, 2010 08:03 AM

On 6/22/2010 2:07:45 AM, peter rejto wrote:
>
>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.

You do not need to download the HTML file.
Just paint the macro code on the browser window with mouse, then copy it to clipboard (Ctrl-C) and paste it into Vedit.

> 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.

Actually, the Fibonacci implementation for Vedit is iterative, not recursive.

--
Pauli