TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-04-2008, 07:57 PM   #1 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default The hello world contest

I saw this on another forum a long time ago, it became quite an entertaining thread.

Purpose:
To create an application that prints out "Hello World' in the most inefficient way possible. Any language is acceptable.

Rules:
-1 source file only (as many non-executable files as you want)
-All commands must be relevant to the task, they cannot just take up space and do nothing on consequence.
-Messiness should not rely off of bad style alone, make it hard to read even if properly formatted. But format your code sloppy nonetheless.

I have two entries
PHP
http://justanotherportfolio.com/hello/hello.php

Code:
 <?
class printletter{
public $letter;
function __construct($var){
$this->letter = preg_split('//', $var, -1, PREG_SPLIT_NO_EMPTY);;}}

function display($var){
foreach($var as $output){
if($output == " "){
$output = "space";}

$output = strtolower($output);
echo"<img src=\"$output.jpg\" alt=\" \">";}}

$originalstring = new printletter("Hello World");
display($originalstring->letter);
?>
C++
http://www.justanotherportfolio.com/hello/hello.exe
Code:
#include <iostream>
using namespace std;

int main()
{
char letter = 'a';
int hello[] = {7,-3,7,0,3};
int world[] = {8,-8,3,-6,-8};

letter = letter + hello[0]; cout << letter;
letter = letter + hello[1]; cout << letter;
letter = letter + hello[2]; cout << letter;
letter = letter + hello[3]; cout << letter;
letter = letter + hello[4]; cout << letter;

cout << " ";   

letter = letter + world[0]; cout << letter;
letter = letter + world[1]; cout << letter;
letter = letter + world[2]; cout << letter;
letter = letter + world[3]; cout << letter;
letter = letter + world[4]; cout << letter;
cin >> letter;
}
__________________

Village Idiot is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:25 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design