PDA

View Full Version : Whew, just finished it...


thepokingmaster123
05-04-2005, 07:57 PM
Well, Im kinda into PERL programming language. And, I wanted to make a program in there that actually tells you what types your attacks WONT be super effective against in your moveset.

So, to run this, use Norton commander, and use the four types off attacks as ARGV commands. The program will tell you which types you cant be super effective against. Here it is!!!




%types = ( 'normal', '', 'fire', '', 'water', '', 'ellectric', '', 'grass', '', 'ice', '', 'fighting', '', 'poison', '',
'ground', '', 'flying', '', 'psychic', '', 'bug', '', 'rock', '', 'ghost', '', 'dragon', '', 'dark', '', 'steel', '', );

$a= $ARGV [0];
$b= $ARGV [1];
$c= $ARGV [2];
$d= $ARGV [3];

if (($a eq fire) or ($b eq fire) or ($c eq fire) or ($d eq fire)) {
delete $types{'grass'};
delete $types{'ice'};
delete $types{'bug'};
delete $types{'steel'};};

if (($a eq water) or ($b eq water) or ($c eq water) or ($d eq water)) {
delete $types{'fire'};
delete $types{'ground'};
delete $types{'rock'};};

if (($a eq ellectric) or ($b eq ellectric) or ($c eq ellectric) or ($d eq ellectric)) {
delete $types{'water'};
delete $types{'flying'};};

if (($a eq grass) or ($b eq grass) or ($c eq grass) or ($d eq grass)) {
delete $types{'water'};
delete $types{'ground'};
delete $types{'rock'};};

if (($a eq ice) or ($b eq ice) or ($c eq ice) or ($d eq ice)) {
delete $types{'grass'};
delete $types{'ground'};
delete $types{'flying'};
delete $types{'dragon'};};

if (($a eq fighting) or ($b eq fighting) or ($c eq fighting) or ($d eq fighting)) {
delete $types{'normal'};
delete $types{'ice'};
delete $types{'rock'};
delete $types{'dark'};
delete $types{'steel'};};

if (($a eq poison) or ($b eq poison) or ($c eq poison) or ($d eq poison)) {
delete $types{'grass'};};

if (($a eq ground) or ($b eq ground) or ($c eq ground) or ($d eq ground)) {
delete $types{'fire'};
delete $types{'ellectric'};
delete $types{'steel'};
delete $types{'poison'};
delete $types{'rock'};};

if (($a eq flying) or ($b eq flying) or ($c eq flying) or ($d eq flying)) {
delete $types{'grass'};
delete $types{'fighting'};
delete $types{'bug'};};

if (($a eq psychic) or ($b eq psychic) or ($c eq psychic) or ($d eq psychic)) {
delete $types{'fighting'};
delete $types{'poison'};};

if (($a eq bug) or ($b eq bug) or ($c eq bug) or ($d eq bug)) {
delete $types{'grass'};
delete $types{'psychic'};
delete $types{'dark'};};

if (($a eq rock) or ($b eq rock) or ($c eq rock) or ($d eq rock)) {
delete $types{'fire'};
delete $types{'ice'};
delete $types{'flying'};
delete $types{'bug'};};

if (($a eq ghost) or ($b eq ghost) or ($c eq ghost) or ($d eq ghost)) {
delete $types{'psychic'};
delete $types{'ghost'};};

if (($a eq dragon) or ($b eq dragon) or ($c eq dragon) or ($d eq dragon)) {
delete $types{'dragon'};};

if (($a eq dark) or ($b eq dark) or ($c eq dark) or ($d eq dark)) {
delete $types{'psychic'};
delete $types{'ghost'};};

if (($a eq steel) or ($b eq steel) or ($c eq steel) or ($d eq steel)) {
delete $types{'ice'};
delete $types{'rock'};};
@types = keys %types;
print "@types";



I made it small, so it is easier on the scroll bar, and the eyes. Anyone who can understand how to use PERL, enjoy!!

Neo Emolga
05-04-2005, 07:59 PM
I've never actually heard of PERL before, I'm mostly more into using Java and Visual Basic.

*Moved to Other Computers

thepokingmaster123
05-04-2005, 08:04 PM
thanx, NP, I didnt realize that there's this board.

ANYWAYS, PERL... A useful proframmin language. The onlyt problem is that its horrible with graphix. So, for pix, I use C++ (by "I USE" i mean, "hey dad, can u write this thing for me???). Yea, I suck at C++, and im still learnin PERL. Im now tryin to get REGXES, but they're like martian. CURSE THEM...

ashkelon
05-05-2005, 09:13 PM
I've never actually heard of PERL before, I'm mostly more into using Java and Visual Basic.

*Moved to Other Computers
If you want a sweet scripting language that is seamless with Java, try Python. I like the Jython implementation.

My only problem with Python is when I move back to java I make casting errors. :rolleyes:

While I prefer python, most of the guys here write perl. This is the best tutorial site I know of.

http://www.perlmonks.org/

You can get a fast handle on good perl implementation there.

thepokingmaster123
05-06-2005, 12:54 AM
hmm... well, I never scripted with PERL, but it sounds interesting... how do you do it (i never scripted in my LIFE!!!)

-SERGA-


***Huh, whats this?? Shellgon is evolving!!***

1...2...3........POOF

Congrats, It evolved to salamence!!

ashkelon
05-06-2005, 03:39 PM
I'm just an old dude.... :biggrin: When Perl was started it was a "scripting language", with was what it was used for. To many, if not most, of us in the business, we'll still call it a scripting lang, even if it has other, more general purpose uses now.

http://www.foolabs.com/rantsnat/scriptlang.html

Here's one guy's take on it... Basically, while I CAN write full scale, interactive, web and business applications in Perl or Python, I wouldn't. I'd write 'em in Java, C++ or even assembler, which are scalable, robust and come with loads of tools and IDEs for profiling scalability and performance.

If I'm writing a Q&D (quick and dirty) application that moves files or directories between servers, check to see if jobs have run or are finished, acts as an .ini or "traffic cop" for another application, I'll use Perl or (my preference) python.

There is a really good example of this with TestMaker at pushToTest.com

TestMaker is a web service and site monitoring tool that is written in Java, and can be used to create load (fake users) or traffic and repeat tests as needed. The control files, or scripts, that create and define the load are written in python.

Too much information... :redface: I have that problem... :oops: