[challenge] The Hello World Challenge


#1

This challenge is to print to console "Hello World" in several different ways in any programming language. If someone has already posted a way to say "Hello World", you cannot use it again.

For example,
JavaScript: console.log("Hello World");

Good luck! Let's see how many different types of code we can create to say Hello World! :slightly_smiling:

EDIT: Thanks to @albionsrefuge for showing this cool site to give more ideas for languages and test them: https://repl.it/languages

2nd EDIT: Check out @g4be's new awesome challenge here!


Impressing Colleges
#2
                                                ^

Javascript: console.log("Hallo Wereld")

In Afrikaanns


#3

Forgot to fix, I meant to say programming language. Not a speaking language haha :stuck_out_tongue:


#4

python3:

print("Hello world")

python2:

print "Hello world"

c:

printf("Hello world\n");

ruby:

puts "Hello world"

#5

Ruby:

puts "Hello, World!"

#6

Looks like someone beat you to ruby haha :slightly_smiling:


#7

Uhm.. i think i need to rewrite my C program:

#include <stdio.h>

int main(void){
  printf("hello, world\n");
}

#8

Gotta give Java some love:
Java: System.out.println("Hello World!");


#9

@jaaakee Woops, I didn't see @stetim94's post :slight_smile:

Am I remembering wrong, or does Ruby have print, like Python?
Ruby:

print "Hello, World!"

#10

Unix scripts: echo "Hello World"

#11

Yup! Python does have the same print "type" as Ruby (I think).


#12

I think my reply was just a few seconds before you. Yes, ruby also has a print

How could i forgot unix script? :frowning: for someone who uses linux on a daily basis, that is quit a shame


#13

Lua

print("Hello World")

D

import std.stdio;

void main()
{
  writeln("Hello, World!");
}

#14

Nice! :slightly_smiling:


#15

If I'm not wrong, this code in Assembly is correct.

.data
msg:   .asciiz "Hello World"
.text
.globl main
main:   
li $v0, 4       
la $a0, msg     
syscall         
jr $ra

Edit: Yep, is correct. Wrote this back in 2015/January :heart_eyes:


#16

"Hello World" in Scheme, a dialect of Lisp ...

(print "Hello World")

#17

R:

hello <- function( name ) {
    sprintf( "Hello, %s", name );
}

#18

Java:

public class HelloWorld{
	public static void main(String[] args) {
		System.out.printf("HelloWorld");
	}
}

PHP:

<?php
    echo "Hello World";
?>

Verilog:

module HelloWorld;

initial
    begin
        $display("Hello, world!");
        #5    
    end 
endmodule

Go

import "fmt"
func main() {
  fmt.Println("Hello World");
}

#19

There is a language i don't know, i do know it exist, it is called brainfuck, this is hello world in brainfuck:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

Oh, and we are still missing c++/c#, but i don't know those languages.


#20

With the very little I know in Haskell hello world would be printed like this

putStrLn "Hello World"