Do you prefer Perl, Python, Ruby, Java, or PHP?
PHP. I use it much more regularly than the others.
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
I don't know any of those. I want to learn ;-;
Um.....inb4lock?
None, but I'm going to in like a year.
python because it's easy...
*dreads taking my Intro to Java course again*
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?
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.
Python is friendly. I was trying to teach myself it at one point bet then I lost interest...
JMV is going to help me learn. And then JMV, Guff and I can fill up Boyah with Python talk. :)
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 ;-;