During my 0-hour class at school, I opened Windows Media Player and repeatedly hit the eject-cd shortcut (CTRL+E), and so every 10 seconds or so the CD drive would open and then close... and so I was wondering how I could make it do that in Perl.
The only search result on Google that had what I was looking for had code like this:
Another search result took me to a CPAN module page... and since I was at CPAN, I decided to do a search on this "Inline C" module, and found Inline::CPP.
The synopsis code was this:
Code:
use Inline CPP;<br /><br /> print "9 + 16 = ", add(9, 16), "\n";<br /> print "9 - 16 = ", subtract(9, 16), "\n";<br /><br /> __END__<br /> __CPP__<br /><br /> int add(int x, int *lazy*) { <br /> return x + *lazy*;<br /> }<br /><br /> int subtract(int x, int *lazy*) {<br /> return x - *lazy*;<br /> }
Anyways, so the idea I got from this, is that you can use Perl as a wrapper for a C++ bot, and then you won't need to compile a C++ bot every time you want to go and test it (maybe save the compiling process for when the bot is complete and without errors?).
I'll test this when I get home (converting a C++ bot to Perl by using Inline::CPP). If it works, we can start programming C++ bots, in Perl!
(there's also Inline::C and Inline::Java, by the way ). _________________ Current Site (2008) http://www.cuvou.com/
Joined: 06 Jan 2004 Posts: 562 Location: Netherlands
Posted: Fri Apr 08, 2005 8:24 pm Post subject:
Quote:
I'll test this when I get home (converting a C++ bot to Perl by using Inline::CPP). If it works, we can start programming C++ bots, in Perl! biggrin.gif
Err, really, Cer? To me that would still be C++, otherwise C++ just got a magic makeover and was instantly transformed into Perl.
Plus, a good developer environment (VS, Borland, whatever floats your boat) is so much better at compiling C than Perl, I reckon. Not to mention I dont think Perl's Inline CPP will benefit speed.
Why use Perl if you can already compile it? Just for "testing purposes"? Sure it's cool, but I dont see the benifit of using it for BOTs, at all.