Page 29 of 30 FirstFirst ... 1927282930 LastLast
Results 281 to 290 of 297

Thread: "Hello Ubuntu" in every programming language

  1. #281
    Join Date
    Jul 2007
    Location
    Austin, TX
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: "Hello Ubuntu" in every programming language

    Go

    Brand new language from Google


    Code:
    package main
    
    import "fmt"
    
    func main() {
      fmt.Printf("Hello, Ubuntu\n");
    
    }

  2. #282
    Join Date
    Feb 2005
    Beans
    151

    Re: "Hello Ubuntu" in every programming language

    Prolog

    PHP Code:
    main :-
        
    write('What is your name: '),
        
    read(Name),
        
    write('Hello '),
        
    write(Name). 

  3. #283
    Join Date
    Apr 2007
    Beans
    513

    Re: "Hello Ubuntu" in every programming language

    Go

    Brand new language from Google

    Edit:
    I improved it and got bufio working!

    PHP Code:
    package main

    import 
    (
        
    "fmt"
        "os"
        "bufio"
    )

    func main() {
            
    fmt.Printf("Hi! What's your name? ")
            
    reader := bufio.NewReader(os.Stdin)
            
    input:= reader.ReadString('\n')
            
    input input[0:len(input)-1]
            
    fmt.Print("Hello, "input"! Welcome to Ubuntu!\n")

    Code:
    package main
    
    import (
    	"fmt"
    	"os"
    	"scanner"
    )
    
    func main() {
    	fmt.Printf("Hi! What's your name? ")
    	var s scanner.Scanner
    	s.Init(os.Stdin)
    	input := s.Scan()
    	scanner.TokenString(input)
    	fmt.Print("Hello, ", s.TokenText(), "! Welcome to Ubuntu!\n")
    }
    As you can see (from the commented lines), I was going to use a bufio reader, but it kept including the newline on the input.(Edit: Since I got it working, I removed the comment lines. Now you can not see my attempt to make it work above) I eventually just went for a scanner (which I just happened to find on the internet). Also, yes, I did steal the header from above.

    Edit: Moving better entry to top.
    Last edited by patrickaupperle; June 11th, 2010 at 04:22 AM.

  4. #284
    Join Date
    Nov 2009
    Location
    /dev/null
    Beans
    74

    Re: "Hello Ubuntu" in every programming language

    I didn't see the code written in C-shell derivatives, so here we go.

    C Shell

    Code:
    #!/bin/csh
    
    echo "Hi What's your name ?"
    set line = $<
    echo "Hello $line. Welcome to Ubuntu"
    Code:
    TPX30:~/tmp> ./x
    Hi What's your name ?
    C-Shell
    Hello C-Shell. Welcome to Ubuntu
    Last edited by lostinxlation; April 3rd, 2010 at 10:46 AM.

  5. #285
    Join Date
    Dec 2008
    Beans
    207

    Re: "Hello Ubuntu" in every programming language


    Linoleum


    Quote Originally Posted by Cryoburner
    "libraries"
    gen/stdfont;

    "directors"
    unit = 32;

    "variables"
    hello string = {Hello_Ubuntu!};

    "workspace"
    display mem = 256 mtp 192;

    "programme"
    [text display origin] = display mem;
    [string] = hello string;
    => stdwrite;

    [display origin] = display mem;
    [display command] = retrace; isocall;
    "wait"
    ? [key escape] = off -> wait;
    end;

  6. #286
    Join Date
    Nov 2009
    Beans
    91

    Re: "Hello Ubuntu" in every programming language

    Python

    Obviously there have been several of these, but here's one in 3.1. It's written in a "pure OOP" style, obviously...

    Code:
    class hello_ubuntu:
        def main():
            name = input("Hi!  What's your name?  \n")
            print("Hello, {0}!  Welcome to Ubuntu!".format(name))
    
    hello_ubuntu.main()


    Windows Vista-- $70
    Professional virus scanner-- $120
    Ditching that expensive malware box for Ubuntu-- priceless!


  7. #287
    Join Date
    Jul 2009
    Location
    UK
    Beans
    222
    Distro
    Ubuntu

    Re: "Hello Ubuntu" in every programming language

    nice post!! hope to see more programs in many languages!!

  8. #288
    Join Date
    Dec 2006
    Location
    Australia
    Beans
    1,097
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: "Hello Ubuntu" in every programming language

    Quote Originally Posted by patrickaupperle View Post
    We should have the list on the front page updated. Is samjh still around? I guess I could try pming him.
    I've done a very quick, at-a-glance update using this page's new posts only.

  9. #289
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: "Hello Ubuntu" in every programming language

    MS-DOS version for A86 assembler
    Code:
         mov ah,9
         mov dx,offset message
         int 21h
         mov ax,4c00h
         int 21h
    message db 'Hello Ubuntu!',0dh,0ah,'$'
    Adding in "segment overrides" and related bloat for other assemblers is left as an exercise for the reader. And yes, I've heard of people using TASM under Wine.
    Last edited by lisati; April 8th, 2010 at 05:07 AM. Reason: It's not a "Hello World" program! :)
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  10. #290
    Join Date
    Jul 2007
    Location
    The Internet
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: "Hello Ubuntu" in every programming language

    Sporkl:

    Code:
    print("Hi! What's your name? ");
    input txt_inp = print_input_field(10,20,"");
    print_input_button("Enter");
    
    load_user_input();
    
    print("Hello, " + get_input_value(txt_inp) + "! Welcome to Ubuntu!\n");

Page 29 of 30 FirstFirst ... 1927282930 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •