• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Type out complicated ways to make "Hello World!"

Herpicus

Web Developer
Joined
Jun 21, 2008
Messages
1,644
Reaction score
94
Location
British Columbia
GUISE Let's type out complicated ways to make "Hello World!".

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:
[cpp]#include <stdio.h>

int main(void) {
char *s = "hello world\0";

while (*s) {
if (*s == ' ') {
s++;
continue;
}
putchar(*s++);
putchar(' ');
}

putchar('\n');
return 0;
}
[/cpp]

not the creative type xd
 
Code:
Router con0 is now available

Press RETURN to get started.

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int se0/0/0
Router(config-if)#ip add 10.0.0.1 255.255.255.252
Router(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#encapsulation PPP
Router(config-if)#clock rate 64000
Router(config-if)#description WAN Interface
Router(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
Router(config)#enable secret test
Router(config)#line con 0
Router(config-line)#pass noob
Router(config-line)#login
Router(config-line)#logging synchronous 
Router(config-line)#line vty 0 4
Router(config-line)#pass nab
Router(config-line)#login
Router(config-line)#exit
Router(config)#service password-encryption
Router(config)#router rip
Router(config-router)#v 2
Router(config-router)#net 192.168.1.0
Router(config-router)#net 10.0.0.0
Router(config-router)#no aut
Router(config-router)#exit
Router(config)#banner login #Hello World#
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#
 
Last edited:
Code:
Router con0 is now available






Press RETURN to get started.













Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int se0/0/0
Router(config-if)#ip add 10.0.0.1 255.255.255.252
Router(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#encapsulation PPP
Router(config-if)#clock rate 64000
Router(config-if)#description WAN Interface
Router(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
Router(config)#enable secret test
Router(config)#line con 0
Router(config-line)#pass noob
Router(config-line)#login
Router(config-line)#logging synchronous 
Router(config-line)#line vty 0 4
Router(config-line)#pass nab
Router(config-line)#login
Router(config-line)#exit
Router(config)#service password-encryption
Router(config)#router rip
Router(config-router)#v 2
Router(config-router)#net 192.168.1.0
Router(config-router)#net 10.0.0.0
Router(config-router)#no aut
Router(config-router)#exit
Router(config)#banner login #Hello World#
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#
wat Too much white space in beginning can't read on mobile
 
Last edited:
All i know is my schools c++ XD

Code:
#include <iostream>
using namespace std;
int main()
{ cout<<"Helloooo"<<endl;
system("pause");
return 0;
}
 
Code:
#include <iostream>

char h = 'h';
char e = 'e';
char l = 'l';
char o = 'o';
char w = 'w';
char r = 'r';
char d = 'd';
char sign = '!';

int main()
{

std::cout << h << e << l <<  l << o <<  " " <<  w <<  o << r <<  l <<  d <<  sign << std::endl; 

system("pause");

return 0;


}
 
Pretty much the same as the Ruby one @OP, but with more 1101001's, etc.

[cpp]
#include <stdio.h>
#include <stdlib.h>

int main()
{
char d[12];

//H
d[0] = 0;
d[0] <<= 1;
d[0] |= 1;
d[0] <<= 3;
d[0] |= 1;
d[0] <<= 3;

//e
d[1] = 0;
d[1] <<= 1;
d[1] |= 3;
d[1] <<= 3;
d[1] |= 1;
d[1] <<= 2;
d[1] |= 1;

//l
d[2] = 0;
d[2] <<= 1;
d[2] |= 3;
d[2] <<= 3;
d[2] |= 3;
d[2] <<= 2;

//l
d[3] = 0;
d[3] <<= 1;
d[3] |= 3;
d[3] <<= 3;
d[3] |= 3;
d[3] <<= 2;

//o
d[4] = 0;
d[4] <<= 1;
d[4] |= 3;
d[4] <<= 5;
d[4] |= 15;

//<space>
d[5] = 0;
d[5] <<= 2;
d[5] |= 1;
d[5] <<= 5;

//W
d[6] = 0;
d[6] <<= 1;
d[6] |= 1;
d[6] <<= 2;
d[6] |= 1;
d[6] <<= 4;
d[6] |= 7;

//o
d[7] = 0;
d[7] <<= 1;
d[7] |= 3;
d[7] <<= 5;
d[7] |= 15;

//r
d[8] = 0;
d[8] <<= 1;
d[8] |= 7;
d[8] <<= 3;
d[8] |= 1;
d[8] <<= 1;

//l
d[9] = 0;
d[9] <<= 1;
d[9] |= 3;
d[9] <<= 3;
d[9] |= 3;
d[9] <<= 2;

//d
d[10] = 0;
d[10] <<= 1;
d[10] |= 3;
d[10] <<= 3;
d[10] |= 1;
d[10] <<= 2;

//!
d[11] = 0;
d[11] <<= 2;
d[11] |= 1;
d[11] <<= 5;
d[11] |= 1;

printf(d);

return 0;
}
[/cpp]
Worksonmycomputer.jpg
 
Lua:
local t = {
	x = {},
	y = {
		'h',
		'e',
		'l',
		'l',
		' ',
		'w',
		'o',
		'r',
		'l',
		'd',
		'!'
	},
	z = 1
}
function onPrintHelloWorld()
repeat
	table.insert(t.x, t.y[t.z])
	t.z=t.z+1
until t.z == 12
return print(t.x[1],t.x[2],t.x[3],t.x[4],t.x[5],t.x[6],t.x[7],t.x[8],t.x[9],t.x[10],t.x[11])
end
 
Come at me.

Code:
#include <cstdio>

class cA { int a; virtual void u() = 0; };
class cB { int b; virtual void v() = 0; };
class cC : public cA, public cB { };
class cD : public cA { };

typedef void *V;
typedef cC *C;
typedef cB *B;

void print(void *p) {
  putchar((size_t)p >> 3);
}

int
main(void) {
  void *p = (void*)624;
  
  print((V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)p);
  print((V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)p);
  print((V)(C)(B)(V)(C)(B)p);
  print((V)(C)(B)(V)(C)(B)p);
  print((V)(B)(C)p);
  print((V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)p);
  print((V)(B)(C)p);
  print((V)(B)(C)(V)(B)(C)(V)(B)(C)(V)(B)(C)p);
  print((V)(C)(B)(V)(C)(B)p);
  print((V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)(V)(C)(B)p);

  return 0;
}
 
Back
Top