Herpicus
Web Developer
GUISE Let's type out complicated ways to make "Hello World!".
Python
JAVA
Ruby
PHP Do people really struggle with this language? l0l
Boredom level has reach an all new high.
Python
PHP:
class HelloWorldPrinter(object):
def __init__(self, *args):
self.args = self.addArgs(args)
self.length = len(args)
global startvar
startvar = -1
def doPrint(self, code):
if code == -1:
# call self
out = self.doPrint(0)
out = [chr(i) for i in out]
print "".join(out)
else:
try:
return [int(self.args, 2)] + self.doPrint(code+1)
except KeyError:
return []
def addArgs(self, args):
di = {}
for i in xrange(len(args)):
di[i] = args[i]
return di
letter_codes = []
for i in "Hello, World!":
letter_codes.append(bin(ord(i)))
string = ""
for i in xrange(len(letter_codes)):
string = string + '"%s",'%letter_codes[i]
helloworldprinter = eval('HelloWorldPrinter(%s)'%string[:-1])
global startvar
helloworldprinter.doPrint(startvar)
JAVA
Code:
ApplicationException g = new ApplicationException(null, null){
public String toString(){
String out = "";
on:for(int x=0;true;x++){
hello:for(;x==0;){
out += "Hello";
continue on;
}space:for(int y=0;x==1;y++){
out += " ";
break space;
}world:for(int y=0;x==2;y++){
out += "World!";
break on;
}}return out;
}};
System.out.print(g);
Ruby
PHP:
print [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 10].map(&:chr).join
PHP Do people really struggle with this language? l0l
PHP:
<?="Hello World!";?>
Boredom level has reach an all new high.
Last edited: