<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>batch files, graph plotting and</title>
		<link>http://www.allegro.cc/forums/view/607312</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 29 May 2011 02:51:13 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Hi Allegators,</p><p> couple of things you might be able to help me with :</p><p>1) (dull) - is there an equivalent to a windows batch file for use with MSYS ?</p><p>2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ?</p><p>Help would be appreciated.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Fri, 13 May 2011 18:34:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1) Shell scripts. There&#39;s Linux tutorials on this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MiquelFire)</author>
		<pubDate>Fri, 13 May 2011 20:18:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/607312/917371#target">William Labbett</a> said:</div><div class="quote"><p>
1) (dull) - is there an equivalent to a windows batch file for use with MSYS ?
</p></div></div><p>
Not really. Batch files are horrid. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> AFAIK, MSYS has a proper Bash shell implementation so you can use bash scripts, for example. Alternatively, there is probably a version of perl in MSYS that you could use too (or you could just install Strawberry Perl, a native implementation for Windows).
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/607312/917371#target">William Labbett</a> said:</div><div class="quote"><p>
2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ?
</p></div></div><p>
If this question is related to the first, there are probably some useful Perl modules on <a href="http://cpan.org/">CPAN</a> to do graph plotting. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 13 May 2011 20:35:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>that&#39;s fab guys. thanks. I&#39;ll look into it all in due course.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Fri, 13 May 2011 21:15:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just thought of something, depending on what you use the batch files for, you might be able to use Bash&#39;s alias command. Basically, within bash, you can have something like <tt>la</tt> be the same as typing <tt>ls -a</tt>. Just something to keep in mind.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MiquelFire)</author>
		<pubDate>Fri, 13 May 2011 21:31:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That seemed kind of random. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 13 May 2011 21:32:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yea, I&#39;m a bit random at times (like running the nyan.cat site in the background while I play TF2)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MiquelFire)</author>
		<pubDate>Fri, 13 May 2011 21:45:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/607312/917371#target">William Labbett</a> said:</div><div class="quote"><p>
2) Has anyone written a good graph plotter which uses allegro and I could use to plot some graphs ?
</p></div></div><p>
I just finished some classes that parse written function strings into evaluatable equations. The next step is to graph them upon request. I may have something you could use here in a few days if I&#39;m productive.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 20 May 2011 12:05:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>@Edgar: Isn&#39;t a viable solution for this to calculate what the delta X for every pixel is( (maxX-minX)/GraphWidth with GraphWidth in pixels), step trough from the minimum X to the max X in steps of delta X and calculate the Y value for each pixel? (And, of course, only draw it when it is visible on the graph <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (J-Gamer)</author>
		<pubDate>Fri, 20 May 2011 20:15:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s the basic idea, yes.</p><p><b>Update</b><br />William - you still looking for a graphing program?</p><p>I&#39;ve got basic plotting done along with function and expression evaluation on the command line. Type help inside the program to see available commands. When you use the plot command press ESC to go back to the console or CTRL S to save the plot as a png file.</p><p><s><a href="http://www.allegro.cc/files/attachment/604172">FunctionEval.zip</a></s> - static win32 exe<br /><a href="http://www.allegro.cc/files/attachment/604173">FunctionEval2.zip</a> - updated version with LMB drag and scroll wheel zoom<br /><b>Append</b><br /><a href="http://www.allegro.cc/files/attachment/604183">libpng-3.dll</a> (forgot to upload this, you need it to run the program)</p><p>Some screenshots :</p><p>5*sin(x) + x<br /><span class="remote-thumbnail"><span class="json">{"name":"604169","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/dfd6242b30b30b7c3b1bc0448e757056.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/dfd6242b30b30b7c3b1bc0448e757056"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/d/f/dfd6242b30b30b7c3b1bc0448e757056-240.jpg" alt="604169" width="240" height="180" /></span></p><p>x^2 - 5<br /><span class="remote-thumbnail"><span class="json">{"name":"604170","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/2\/42f86ad701a5b442b9a57d2fb0ee175e.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/2\/42f86ad701a5b442b9a57d2fb0ee175e"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/4/2/42f86ad701a5b442b9a57d2fb0ee175e-240.jpg" alt="604170" width="240" height="180" /></span></p><p>5*log(x)<br /><span class="remote-thumbnail"><span class="json">{"name":"604171","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/f\/7fd2ffac77746eded374b07ba323e323.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/f\/7fd2ffac77746eded374b07ba323e323"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/7/f/7fd2ffac77746eded374b07ba323e323-240.jpg" alt="604171" width="240" height="180" /></span></p><p>I know the colors aren&#39;t the best, but I&#39;ll adjust that in the future. Other features planned include LMB dragging the view around, mouse wheel zooming, full graphs with guides and evaluation info, simplifying equations, derivatives and possibly integrals as well.</p><p>You might have to click back and forth between the windows to get the program to continue. Maybe some day I&#39;ll figure out a portable way to automatically change the window focus.</p><p>If you need any help with the commands let me know.</p><p>Basic operation :
</p><pre>
&gt;change res(1024,768)
&gt;set range(-100,100,-100,100)
&gt;f(x) = sin(x^3)
&gt;plot f
&gt;exit
</pre><p>

<b>Update 2</b><br />I updated the executable to include LMB dragging of the view, and added mouse wheel zooming.</p><p><b>Append</b><br />Uploaded libpng-3.dll in case you don&#39;t have it. I thought everything was statically linked but I was wrong.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 28 May 2011 07:53:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Cool Edgar. As you know I&#39;ve downloaded it.</p><p>I need to do a function :-</p><p>4(p + q) - pq = 0</p><p>will your program be able to do this in future.</p><p>I think such functions are called implicit functions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (William Labbett)</author>
		<pubDate>Sat, 28 May 2011 18:36:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That OR needs a parameter OR you can work it out to an explicit one yourself. With this example it isn&#39;t hard.<br />4p + 4q - pq = 0<br />p(4-q) = -4q<br />p = -4q/(4-q)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (J-Gamer)</author>
		<pubDate>Sat, 28 May 2011 18:52:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>At this point I hadn&#39;t planned on trying to solve equations, rather just evaluate expressions and plot functions. It is not a simple thing to teach a program how to solve for variables.</p><p>However, after doing what J-Gamer did by solving the equation himself you could then enter the equation and evaluate it for any p or plot p as x and the result as y :
</p><pre>
f(q) = -4*q/(4 - q)
f(0)
f(1)
plot f
</pre><p>

I may update the program sometime later today, as I fixed a bug where negative numbers were being displayed as positive, fixed a couple small parsing bugs, and I am making some progress on simplifying equations.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 29 May 2011 02:51:13 +0000</pubDate>
	</item>
</rss>
