Welcome
Welcome to dinksoftware

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Community hack >> Hello, world!

Programming tutorials, tips, questions and help etc...

Community hack >> Hello, world!

Postby Holiverh » Thu Jul 16, 2009 1:34 pm

Okay, nothing has happened in over a day! So i thought a little forum game was in order. All you have to do is post a simple "Hello world, this is foo" in a language or mark-up of your choice.

Rules:
  • 'Hello, world!' must be exactly the same to this example.
  • 'This is foo.' must match this one and contain proper grammar. This line must also be on a new line.
  • All code must be between the '[ code ]' tags.
  • Which language it is must be stored in a varible and outputed. If the language doesn't support variables it must be clearly stated some other way.
  • The code must be complete. No snippits, the entire code requiered for it to work must be included.
  • No using the same language twice!

I'll start, obviously. :P
Code: Select all
#include <iostream>
#include <string>
int main()
    {
    std::string language("C++");
    std::cout << "Hello, world!" << endl << "This is foo." << endl;
    std::cout << language << endl;
    }
User avatar
Holiverh
 
Posts: 243
Joined: Sun Jul 12, 2009 10:37 am
Location: East Anglia, UK

 

Re: Community hack >> Hello, world!

Postby Dink » Thu Jul 16, 2009 6:42 pm

Code: Select all
<html>
Hello, Word! This is foo.
</html>


:lol:
User avatar
Dink
 
Posts: 531
Joined: Sat Jul 11, 2009 9:59 am
Location: Australia

Re: Community hack >> Hello, world!

Postby Holiverh » Fri Jul 17, 2009 12:20 am

Dink wrote:
Code: Select all
<html>
Hello, Word! This is foo.
</html>


:lol:


Phail much? :P
Ammedment:
Code: Select all
<html>
<body>
<p> Hello, world!<br> This is foo.</p>
</body>
</html>

The BODY tag's are requiered to pass the criteria of the rules. And you musn't enter text directly onto the document's body. The W3 would kill you. :P Your also lacking the language in a varible and outputted or, in this language's case, cleary ouputted some other way. IE. As a document title, or a common META tag.

Here's mine: :P
Code: Select all
<?php
$language = "Php5";
echo "Hello, world!<br>This is foo.<br>Language of choice: ".$language;
?>
User avatar
Holiverh
 
Posts: 243
Joined: Sun Jul 12, 2009 10:37 am
Location: East Anglia, UK

Re: Community hack >> Hello, world!

Postby Dink » Fri Jul 17, 2009 2:03 am

Well the example I posted does indeed work. It may not validate although it would output the Hello World etc. Sorry, I forgot the language variable criteria. :(

Code: Select all
language$ = "BASIC"
print "Hello World! This is Foo."
print "Language used: "; language$
User avatar
Dink
 
Posts: 531
Joined: Sat Jul 11, 2009 9:59 am
Location: Australia

Re: Community hack >> Hello, world!

Postby Holiverh » Fri Jul 17, 2009 2:27 am

That looked fine to me, but i thnk there should have been a closing " on the second line.
Code: Select all
lang="Python 2"
print """Hello, world!
\n
This is foo. \n
Language: """+lang
#Just shaking things up abit lol. Multi line strings FTW, not 100 per cent if new line escape code
works in Python though. :lol:
User avatar
Holiverh
 
Posts: 243
Joined: Sun Jul 12, 2009 10:37 am
Location: East Anglia, UK

Re: Community hack >> Hello, world!

Postby Dink » Fri Jul 17, 2009 2:49 am

Code: Select all
language = "Microsoft Small Basic"
TextWindow.WriteLine("Hello, World! This is Foo.")
TextWindow.WriteLine("Language used: " + language)
User avatar
Dink
 
Posts: 531
Joined: Sat Jul 11, 2009 9:59 am
Location: Australia

Re: Community hack >> Hello, world!

Postby Holiverh » Fri Jul 17, 2009 3:16 am

Code: Select all
<html>
<head>
<script type="text/javascript">
function displayHello(){
document.alert('Hello, world!');}
function displayFoo(){
document.write('This is foo.');}
function displayLanguage(){
var lang='JavaScript';
document.confirm('The language used was: '+lang);}
}
</script>
</head>
<body>
<a href="#" onClick="displayHello()">Hello!</a><br><a href="#" onClick="displayFoo()">Foo</a>
<span onLoad="displayLanguage()">...</span>
</body>
<html>


Beat that! :P
User avatar
Holiverh
 
Posts: 243
Joined: Sun Jul 12, 2009 10:37 am
Location: East Anglia, UK

Re: Community hack >> Hello, world!

Postby Unknown98 » Fri Jul 17, 2009 4:44 am

Code: Select all
<?php
$language = "Php";
echo "Hello, world!<br>This is foo.<br><br>";
Language: echo "$language";
?>
http://www.salesmangame.com
We have an IRC channel! #Salesman on coldfront
User avatar
Unknown98
 
Posts: 97
Joined: Sun Jul 12, 2009 11:30 am
Location: Houston

Re: Community hack >> Hello, world!

Postby Holiverh » Fri Jul 17, 2009 5:49 am

Unknown98 wrote:
Code: Select all
<?php
$language = "Php";
echo "Hello, world!<br>This is foo.<br><br>";
Language: echo "$language";
?>


Hmm maybe i should have added a rule that said no using the same language twice. Maybe you didn't notice, i've done Php. :P

Code: Select all
<thisisxml>
<yoyo>Hello, world!</yoyo>
<yaya>This is foo.</yaya>
</thisisxml>

Hehe, i cheated and used XML. :P
User avatar
Holiverh
 
Posts: 243
Joined: Sun Jul 12, 2009 10:37 am
Location: East Anglia, UK

Re: Community hack >> Hello, world!

Postby Unknown98 » Fri Jul 17, 2009 5:56 am

Well that's all I know, so I'm out :lol:

I wonder if it's possible to do this with CSS... hmm.
http://www.salesmangame.com
We have an IRC channel! #Salesman on coldfront
User avatar
Unknown98
 
Posts: 97
Joined: Sun Jul 12, 2009 11:30 am
Location: Houston

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred