Anyone have an obnoxious "Hello World" program?

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 908 Views - Last Post: 10 October 2013 - 11:34 AM Rate Topic: -----

#1 iTunes Updates  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-April 13

Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 12:58 PM

As a computer programmer I enjoy the site of ridiculous code and or processes for the reason of being obnoxious. After searching on the net for a while I cannot find a hello world program other than those used to teach students basic fundamentals. Though the net is clouded by the thousands of people posting hello world, I figured someone on here would satisfy my search. Would anyone happen to have a ridiculous piece of code that uses some advanced features of java to simply print out "Hello World"?

I'm working on one now that's at a run time of 5 seconds which is a lot taking into account the processing speed of my computer.

Look forward to seeing what you all have!

Is This A Good Question/Topic? 0
  • +

Replies To: Anyone have an obnoxious "Hello World" program?

#2 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7737
  • View blog
  • Posts: 13,068
  • Joined: 19-March 11

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 01:06 PM

I'm not going to go to the trouble of writing it, but use bitwise operators to construct integers 72, 101, etc. Coerce them to char, cram them into an array, and use the array to construct a String.
For added annoyance, figure out some way to print to the console without using System.out.
(hint: check the System source code for ideas there)
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9192
  • View blog
  • Posts: 34,507
  • Joined: 12-June 08

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 01:24 PM

.. moving to the 'java' forum.
Was This Post Helpful? 0
  • +
  • -

#4 iTunes Updates  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-April 13

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 01:27 PM

View Postjon.kiparsky, on 09 October 2013 - 01:06 PM, said:

I'm not going to go to the trouble of writing it, but use bitwise operators to construct integers 72, 101, etc. Coerce them to char, cram them into an array, and use the array to construct a String.
For added annoyance, figure out some way to print to the console without using System.out.
(hint: check the System source code for ideas there)


Love this! Now I have to try printing to the console without System.out
Was This Post Helpful? 0
  • +
  • -

#5 iTunes Updates  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-April 13

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 01:35 PM

I guess you could create a new PrintStreem instance using the System class and out field. No idea on how to get around using a subclass of java.lang...If there is a way I must know!
Was This Post Helpful? 0
  • +
  • -

#6 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2717
  • View blog
  • Posts: 11,428
  • Joined: 20-September 08

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 02:10 PM

*
POPULAR

How about this?

import java.io.*;

import java.math.BigInteger;


public class HW1 {
    public static void main(String[] args) throws IOException {
        BigInteger bi = new BigInteger("f0cg141jkfjutalqkytjp7xkzqmmntk60l7eaxlndlzjivmqemwchrh8uw7691y12cympoztsj0qu9p2eb6q26dsj6kegmiqxcnj39qy4ls0p8f6rsuj5xnevk0cxty7w6f8kwm7nbvnylzp2m3iyh96so3u5uitizijfgk7gs20qshpay1axpb7l85t01crtn7336xbx1fukqr27n53ss596hls3lv477errg3itk4nppxpqsxbfhmuz4vuj339zsng4awsb719tdsqw1p6x8i8b0o78mdm04dtzfnvx9rlfefl4l6ie82t9z22he3ws3jc2380uih9iqg84hsak292r56bib4jt7s891rojjx3f357sm5bcbun1cjy89pls8v84ey4l47le484zu0venp9nqoe1a23s9fdy14rrwsk47ma6pb6a7tcgfhgu84aodhwu5v4cr45hw7px7dxn78402vvdq9wzp9li27f8unup23dyl6r7m7jdenxth4f2dmewtjzvtgzektj25yslyvacd86rz2axzjuosn7agf5p9umzkn2r2ck6pqiwn5qiwq24m2c2coao3dza7hhg8y6d211s7tq11y96rr75c9sb606zx314qz07qhghp0jf2vu1rsc5yybg8al72nkvdhwvgfjyyuda288vtxui94epp7agq7oz37u",
                36);
        new FileOutputStream(FileDescriptor.out).write(bi.toByteArray());
    }
}


Was This Post Helpful? 5
  • +
  • -

#7 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 02:33 PM

If you want it to be obnoxious:
do { System.out.println("Hello, World!"); } while(true);

Was This Post Helpful? 1
  • +
  • -

#8 iTunes Updates  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-April 13

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 02:57 PM

Well I figured out how to get the run time to be crazy long!

import java.io.*;
import java.util.Random;


public class HelloWorld {
    public static void main(String[] args) throws IOException {
    	int n = 0;
    	while (n != 42){
    		double randNumber = Math.random();
    		n = (int) (randNumber * 1000000000);

    		//Type cast double to int
    		int randomInt = (int)n;
    		//System.out.println(n);
        }
    	
    	if (n == 42)
    		System.out.println("Hello world");
    }
}



Was This Post Helpful? 0
  • +
  • -

#9 megabit  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 79
  • Joined: 03-May 13

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 03:04 PM

Maybe try printing "Hello World" using another language. Like use Chinese or Arabic letters(symbols), instead of English letters.
Was This Post Helpful? 0
  • +
  • -

#10 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 838
  • View blog
  • Posts: 2,574
  • Joined: 29-July 11

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 03:55 PM

View Postg00se, on 09 October 2013 - 09:10 PM, said:

How about this?

import java.io.*;

import java.math.BigInteger;


public class HW1 {
    public static void main(String[] args) throws IOException {
        BigInteger bi = new BigInteger("f0cg141jkfjutalqkytjp7xkzqmmntk60l7eaxlndlzjivmqemwchrh8uw7691y12cympoztsj0qu9p2eb6q26dsj6kegmiqxcnj39qy4ls0p8f6rsuj5xnevk0cxty7w6f8kwm7nbvnylzp2m3iyh96so3u5uitizijfgk7gs20qshpay1axpb7l85t01crtn7336xbx1fukqr27n53ss596hls3lv477errg3itk4nppxpqsxbfhmuz4vuj339zsng4awsb719tdsqw1p6x8i8b0o78mdm04dtzfnvx9rlfefl4l6ie82t9z22he3ws3jc2380uih9iqg84hsak292r56bib4jt7s891rojjx3f357sm5bcbun1cjy89pls8v84ey4l47le484zu0venp9nqoe1a23s9fdy14rrwsk47ma6pb6a7tcgfhgu84aodhwu5v4cr45hw7px7dxn78402vvdq9wzp9li27f8unup23dyl6r7m7jdenxth4f2dmewtjzvtgzektj25yslyvacd86rz2axzjuosn7agf5p9umzkn2r2ck6pqiwn5qiwq24m2c2coao3dza7hhg8y6d211s7tq11y96rr75c9sb606zx314qz07qhghp0jf2vu1rsc5yybg8al72nkvdhwvgfjyyuda288vtxui94epp7agq7oz37u",
                36);
        new FileOutputStream(FileDescriptor.out).write(bi.toByteArray());
    }
}



What sorcery is this?!
Was This Post Helpful? 0
  • +
  • -

#11 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2717
  • View blog
  • Posts: 11,428
  • Joined: 20-September 08

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 04:06 PM

Quote

What sorcery is this?!
That's for you to say ;) I hope it amused you ...
Was This Post Helpful? 0
  • +
  • -

#12 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 526
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 09:47 PM


public enum Letters {
	H ('H'),
	E ('E'),
	L ('L'),
	O ('O'),
	W ('W'),
	R ('R'),
	D ('D'),
	Bang ('!'),
	Space (' ');
	
	private char letter;
	
	public char getLetter() {
		return letter;
	}
	
	private Letters(char letter) {
		this.letter = letter;
	}
}



import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Letter implements ActionListener {

	private char data;
	
	public Letter(char data) {
		this.data = data;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		System.out.print(data);
	}
}



import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

public class Client {

	private List<ActionListener> listeners;
	
	public Client() {
		listeners = new ArrayList<>();
		
		listeners.add(new Letter(Letters.H.getLetter()));
		listeners.add(new Letter(Letters.E.getLetter()));
		listeners.add(new Letter(Letters.L.getLetter()));
		listeners.add(new Letter(Letters.L.getLetter()));
		listeners.add(new Letter(Letters.O.getLetter()));
		listeners.add(new Letter(Letters.Space.getLetter()));
		listeners.add(new Letter(Letters.W.getLetter()));
		listeners.add(new Letter(Letters.O.getLetter()));
		listeners.add(new Letter(Letters.R.getLetter()));
		listeners.add(new Letter(Letters.L.getLetter()));
		listeners.add(new Letter(Letters.D.getLetter()));
		listeners.add(new Letter(Letters.Bang.getLetter()));
		
		fire();
	}
	
	private void fire() {
		for (ActionListener l : listeners) {
			l.actionPerformed(null);
		}
	}
	
	public static void main(String[] args) {
		new Client();
	}
}



output said:

HELLO WORLD!

Was This Post Helpful? 2
  • +
  • -

#13 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 09:52 PM

View Postg00se, on 09 October 2013 - 05:10 PM, said:

How about this?

import java.io.*;

import java.math.BigInteger;


public class HW1 {
    public static void main(String[] args) throws IOException {
        BigInteger bi = new BigInteger("f0cg141jkfjutalqkytjp7xkzqmmntk60l7eaxlndlzjivmqemwchrh8uw7691y12cympoztsj0qu9p2eb6q26dsj6kegmiqxcnj39qy4ls0p8f6rsuj5xnevk0cxty7w6f8kwm7nbvnylzp2m3iyh96so3u5uitizijfgk7gs20qshpay1axpb7l85t01crtn7336xbx1fukqr27n53ss596hls3lv477errg3itk4nppxpqsxbfhmuz4vuj339zsng4awsb719tdsqw1p6x8i8b0o78mdm04dtzfnvx9rlfefl4l6ie82t9z22he3ws3jc2380uih9iqg84hsak292r56bib4jt7s891rojjx3f357sm5bcbun1cjy89pls8v84ey4l47le484zu0venp9nqoe1a23s9fdy14rrwsk47ma6pb6a7tcgfhgu84aodhwu5v4cr45hw7px7dxn78402vvdq9wzp9li27f8unup23dyl6r7m7jdenxth4f2dmewtjzvtgzektj25yslyvacd86rz2axzjuosn7agf5p9umzkn2r2ck6pqiwn5qiwq24m2c2coao3dza7hhg8y6d211s7tq11y96rr75c9sb606zx314qz07qhghp0jf2vu1rsc5yybg8al72nkvdhwvgfjyyuda288vtxui94epp7agq7oz37u",
                36);
        new FileOutputStream(FileDescriptor.out).write(bi.toByteArray());
    }
}



lol)))) :^:
Was This Post Helpful? 0
  • +
  • -

#14 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7737
  • View blog
  • Posts: 13,068
  • Joined: 19-March 11

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 10:00 PM

View Postg00se, on 09 October 2013 - 04:10 PM, said:

How about this?

import java.io.*;

import java.math.BigInteger;


public class HW1 {
    public static void main(String[] args) throws IOException {
        BigInteger bi = new BigInteger("f0cg141jkfjutalqkytjp7xkzqmmntk60l7eaxlndlzjivmqemwchrh8uw7691y12cympoztsj0qu9p2eb6q26dsj6kegmiqxcnj39qy4ls0p8f6rsuj5xnevk0cxty7w6f8kwm7nbvnylzp2m3iyh96so3u5uitizijfgk7gs20qshpay1axpb7l85t01crtn7336xbx1fukqr27n53ss596hls3lv477errg3itk4nppxpqsxbfhmuz4vuj339zsng4awsb719tdsqw1p6x8i8b0o78mdm04dtzfnvx9rlfefl4l6ie82t9z22he3ws3jc2380uih9iqg84hsak292r56bib4jt7s891rojjx3f357sm5bcbun1cjy89pls8v84ey4l47le484zu0venp9nqoe1a23s9fdy14rrwsk47ma6pb6a7tcgfhgu84aodhwu5v4cr45hw7px7dxn78402vvdq9wzp9li27f8unup23dyl6r7m7jdenxth4f2dmewtjzvtgzektj25yslyvacd86rz2axzjuosn7agf5p9umzkn2r2ck6pqiwn5qiwq24m2c2coao3dza7hhg8y6d211s7tq11y96rr75c9sb606zx314qz07qhghp0jf2vu1rsc5yybg8al72nkvdhwvgfjyyuda288vtxui94epp7agq7oz37u",
                36);
        new FileOutputStream(FileDescriptor.out).write(bi.toByteArray());
    }
}



We are so not worthy of this.
Was This Post Helpful? 0
  • +
  • -

#15 Flukeshot  Icon User is offline

  • A little too OCD
  • member icon

Reputation: 416
  • View blog
  • Posts: 1,030
  • Joined: 14-November 12

Re: Anyone have an obnoxious "Hello World" program?

Posted 09 October 2013 - 11:41 PM

View Postg00se, on 09 October 2013 - 10:10 PM, said:

How about this?

import java.io.*;

import java.math.BigInteger;


public class HW1 {
    public static void main(String[] args) throws IOException {
        BigInteger bi = new BigInteger("f0cg141jkfjutalqkytjp7xkzqmmntk60l7eaxlndlzjivmqemwchrh8uw7691y12cympoztsj0qu9p2eb6q26dsj6kegmiqxcnj39qy4ls0p8f6rsuj5xnevk0cxty7w6f8kwm7nbvnylzp2m3iyh96so3u5uitizijfgk7gs20qshpay1axpb7l85t01crtn7336xbx1fukqr27n53ss596hls3lv477errg3itk4nppxpqsxbfhmuz4vuj339zsng4awsb719tdsqw1p6x8i8b0o78mdm04dtzfnvx9rlfefl4l6ie82t9z22he3ws3jc2380uih9iqg84hsak292r56bib4jt7s891rojjx3f357sm5bcbun1cjy89pls8v84ey4l47le484zu0venp9nqoe1a23s9fdy14rrwsk47ma6pb6a7tcgfhgu84aodhwu5v4cr45hw7px7dxn78402vvdq9wzp9li27f8unup23dyl6r7m7jdenxth4f2dmewtjzvtgzektj25yslyvacd86rz2axzjuosn7agf5p9umzkn2r2ck6pqiwn5qiwq24m2c2coao3dza7hhg8y6d211s7tq11y96rr75c9sb606zx314qz07qhghp0jf2vu1rsc5yybg8al72nkvdhwvgfjyyuda288vtxui94epp7agq7oz37u",
                36);
        new FileOutputStream(FileDescriptor.out).write(bi.toByteArray());
    }
}



Holy crap that's amazing!
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2