Main Menu

This thread will be locked

Started by JMV, June 25, 2009, 05:32:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JMV

Do you prefer Perl, Python, Ruby, Java, or PHP?
Boyah Forums | Join Boyah

Macawmoses

PHP. I use it much more regularly than the others.

JMV

#2
Quote from: Macbeth on June 25, 2009, 05:33:08 PM
PHP. I use it much more regularly than the others.
I wrote a Rot13 thing in Perl and Python today. I like the Perl solution a lot more. I need to look at Python's regex module though because I don't think it has tr and using a bunch of if statements inside of a loop isn't very nice.

#!/usr/bin/perl
print "Enter message to be encoded or decoded: ";
$message = <STDIN>;
chop($message);
$message =~ tr/A-Za-z/N-ZA-Mn-za-m/;
print "Your message is: \n \n";
print "$message\n";

#!/usr/bin/python
rot13 = input("Enter the message to be encoded or decoded: ")
rot13b = ''
for let in rot13:
   if ord(let) < 65:
       rot13b += let
   elif ord(let)<=77:
       rot13b += chr(ord(let)+13)
   elif ord(let)<=90:
       rot13b += chr(ord(let)-13)
   elif ord(let)<=109:
       rot13b += chr(ord(let)+13)
   elif ord(let)<=122:
       rot13b += chr(ord(let)-13)
   else:
       rot13b+= let           
print("Your encoded message is:\n\n %s"%rot13b)


p.s. the css on this theme makes the code tag fugly
Boyah Forums | Join Boyah

Lotos

I don't know any of those.  I want to learn ;-;

jnfs2014

#4
Um.....inb4lock?

None, but I'm going to in like a year.


Nayrman

python because it's easy...
*dreads taking my Intro to Java course again*

bluaki

Quote from: Macbeth on June 25, 2009, 05:33:08 PM
PHP. I use it much more regularly than the others.
Same answer for the same reason.
I've never used any of the others yet, actually.
Quote from: JMV on June 25, 2009, 05:35:59 PM
p.s. the css on this theme makes the code tag fugly
What theme?

#7
I'm starting to doubt the validity of the topic creator and his thread title.

And I don't use any of those so I don't have a preference.
...̅̅̅

L10

Python is friendly. I was trying to teach myself it at one point bet then I lost interest...
0o!f

Rae

JMV is going to help me learn. And then JMV, Guff and I can fill up Boyah with Python talk. :)

Make JMV admin again. Put this in your sig to show support and/or a heron will make a mess of your pots and pans.

Lotos

Quote from: Rae on June 26, 2009, 04:13:44 PM
JMV is going to help me learn. And then JMV, Guff and I can fill up Boyah with Python talk. :)

JMV help me too ;-;