Page 15 of 30 FirstFirst ... 5131415161725 ... LastLast
Results 141 to 150 of 297

Thread: "Hello Ubuntu" in every programming language

  1. #141
    Join Date
    Mar 2007
    Location
    Lyngen, Norway
    Beans
    163
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: "Hello Ubuntu" in every programming language

    Quote Originally Posted by runningwithscissors View Post
    Python

    Code:
    #!/usr/bin/env python
    print "Hello, " + raw_input("Hi! What's your name? ") + "! Welcome to Ubuntu!"
    In Python 3.0:
    Code:
    print("string")
    not print "string"
    Python 3.0 is the new version in python, not released yet.(only alpha)
    IBM Thinkpad R60
    Ubuntu user: # 14440
    Please visit:
    http://www.fablab.no

  2. #142
    Join Date
    Oct 2007
    Beans
    1

    Re: "Hello Ubuntu" in every programming language

    In SPIN

    Code:
    ''Talks to User in Serial Terminal over Prop Programing Link at 38400 bps
    ''crgwbr
    VAR
    long reply
    
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    
    rx = 31
    tx = 30
    ser_mode = %0000
    baud = 38400
    
    Timeout = 2000
    
    OBJ
    
    serial : "Extended_FDSerial"
    
    PUB Main
    
    serial.start(rx, tx, ser_mode, baud)
    
    waitcnt(80_000_000 + cnt)
    
    serial.str(string("Hello, What is your name?"))
    serial.tx(13)
    serial.rxSTRTime(Timeout, @reply)
    serial.str(string("Nice to meet you, "))
    serial.str(reply)
    serial.str(string(".  Welcome to Ubuntu"))
    
    reboot

  3. #143
    Join Date
    Jul 2007
    Location
    Earth... duh.
    Beans
    92
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: "Hello Ubuntu" in every programming language

    ODT just for fun
    Code:
    <office:document-content office:version="1.0">
    <office:scripts/>
    −
        <office:font-face-decls>
    <style:font-face style:name="Helvetica" svg:font-family="Helvetica"/>
    <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
    <style:font-face style:name="Times" svg:font-family="Times"/>
    <style:font-face style:name="AR PL ShanHeiSun Uni" svg:font-family="'AR PL ShanHeiSun Uni'" style:font-family-generic="system" style:font-pitch="variable"/>
    <style:font-face style:name="DejaVuSans" svg:font-family="DejaVuSans" style:font-family-generic="system" style:font-pitch="variable"/>
    <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
    </office:font-face-decls>
    <office:automatic-styles/>
    −
        <office:body>
    −
        <office:text>
    <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
    −
        <text:sequence-decls>
    <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
    </text:sequence-decls>
    <text:p text:style-name="Standard">Hello World</text:p>
    </office:text>
    </office:body>
    </office:document-content>
    My Blog - http://www.cat-blog.org Linux User - Registered Linux User #45641
    Full Circle Magazine Developer


  4. #144
    Join Date
    Sep 2006
    Location
    UK
    Beans
    35
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: "Hello Ubuntu" in every programming language

    In Delphi:

    Code:
    var
        s: string
    begin
        Write('Enter your name:');
        ReadLn(s);
        Write('Hello, ' + s + ' welcome to Ubuntu');
    end.
    Linux Counter Project #432485 | Ubuntu Counter Project #8574
    Intel Pentium 4
    2.8GHz; 2GB DDR400; 160GB HDD; nVidia GeForce 6600; Intrepid 8.10

  5. #145
    Join Date
    Oct 2007
    Beans
    131
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: "Hello Ubuntu" in every programming language

    Ook

    I may have some mistakes, though I don't think so. ^^

    Code:
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook! Ook? 
    
    	Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    	Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    	Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. 
    	Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    	Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! 
    	
    Ook? Ook!
    
    Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. // H
    Ook. Ook? Ook. Ook. Ook! Ook. // e									
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. // l
    Ook! Ook. // l again
    Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.	// o									
    Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. // , comma				
    Ook? Ook. Ook. Ook. Ook. Ook. Ook! Ook. // <space>	
    
    Ook. Ook? Ook. Ook? Ook. Ook!	//Ask for the first character
     
    Ook! Ook?
    	Ook! Ook. Ook. Ook!	//Cycle through until type 0
    Ook? Ook!
    
    Ook? Ook. Ook! Ook. // , comma
    Ook? Ook. Ook! Ook.	// <space>
    
    Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.	// w
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. // e
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. // l
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook! Ook! Ook! Ook! Ook. // c
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.	// o
    Ook! Ook! Ook! Ook! Ook! Ook. // m
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook! Ook. // e
    
    Ook. Ook? Ook! Ook.	 // <space>
    Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook! Ook. // t
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. // o
    
    Ook. Ook? Ook! Ook. // <space>
    
    Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook! Ook.	// U
    Ook. Ook? Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook. // b
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. 
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. // u
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! 
    Ook! Ook. // n
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. // t
    Ook. Ook. Ook! Ook. // u
    
    Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook! Ook. // . dot
    Last edited by karth; October 26th, 2007 at 03:00 PM.
    Restons Infidèles, Absurde Adversité

  6. #146
    Join Date
    Jul 2005
    Location
    Northern CA
    Beans
    657
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: "Hello Ubuntu" in every programming language

    GNU x86-64 ASM (stand alone)
    Code:
    # HelloUbuntu1.s
    # x86-64 using gnu asm, stand alone
    # as -o HelloUbuntu1.o HelloUbuntu1.s
    # ld -o HelloUbuntu1 HelloUbuntu1.o
    
            .data                  # data segment
    hello:
            .string "Hello Ubuntu.\n"
    helloLngth = .-hello
    
            .text                  # text segment
            .globl  _start
    
    _start:
            movq    $1, %rdi            # standard out
            movq    $hello, %rsi        # string address
            movq    $helloLngth, %rdx   # string length
            movq    $1, %rax            # write()
            syscall
    
            movq    $0, %rdi          # everything ok
            movq    $0x3c, %rax       # exit(0)
            syscall
    GNU x86-64 ASM (using C environment)
    Code:
    # HelloUbuntu2.s
    # x86-64 using gnu asm and C runtime environment
    # as -o HelloUbuntu2.o HelloUbuntu2.s
    # gcc -o HelloUbuntu2 HelloUbuntu2.o
    
            .data                  # data segment
    hello:
            .string "Hello Ubuntu.\n"
    helloLngth = .-hello
    
            .text                  # text segment
            .globl  main
    
    main:
            pushq   %rbp           # save caller's base pointer
            movq    %rsp, %rbp     # establish our base pointer
    
            movl    $1, %edi            # standard out
            movl    $helloLngth, %edx   # string length
            movl    $hello, %esi        # string address
            call    write           # write
    
            movl    $0, %eax       # return 0
            movq    %rbp, %rsp     # delete local vars.
            popq    %rbp           # restore caller's base pointer
            ret
    I realize that there are no local variables, so deleting them is not needed. But this is sort of "boilerplate" that is easily forgotten if they are added later. The two instructions
    Code:
            movq    %rbp, %rsp     # delete local vars.
            popq    %rbp           # restore caller's base pointer
    can be replaced by
    Code:
    leave
    Notice that arguments are passed in registers, not on the stack, on the x86-64 when in 64-bit mode.
    Intel i7-920; Nvidia GT 220, 1GB; MSI X58 Pro-E; 6GB DDR; 64-bit mode.

  7. #147
    Join Date
    May 2007
    Location
    UK
    Beans
    25
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: "Hello Ubuntu" in every programming language

    Johan (a prototype language I'm developing)

    Code:
    program console
    require io
    func main()
    {
         var name = std_input("Hello, what is your name?")
         std_output("Hello, " .. name .. ". " .. "Welcome to Ubuntu!")
    }
    end program
    I would do a real language, but all the ones I know have been done.
    Last edited by Samjiman; October 27th, 2007 at 03:20 PM. Reason: Changed my mind on syntax

  8. #148
    Join Date
    Sep 2007
    Location
    Cambodia
    Beans
    88
    Distro
    Lubuntu 12.04 Precise Pangolin

    Re: "Hello Ubuntu" in every programming language

    FreeBASIC Compiler - Version 0.18.3 (10-12-2007) for linux (target:linux)

    Code:
    dim as string username
    line input "Hi! What's your name? ", username
    print "Hello, " + username + "! Welcome to Ubuntu!"
    Desktop: Dell, Intel Core 2 Duo E7500 @ 2.93Ghz, 2GiB RAM, Linux Mint 13 Maya.
    Net-book: SAMSUNG N148-Plus, 2x Intel Atom CPU N450 @1.66Ghz, 1GB RAM, lubuntu 12.04.
    Laptop: Dell, Intel i5 @2.5Ghz, 4GB RAM, Win 7

  9. #149
    Join Date
    Oct 2007
    Beans
    2

    Re: "Hello Ubuntu" in every programming language

    actsl -- http://compilers.iecc.com/comparch/article/07-10-055
    Extremely small compiler with minimal number of syntax rules.
    Code:
    int nul int nul_ int buf
    int SMAX
    
    fun main
    	127 ref SMAX =
    	ref nul_ ref nul =
    	SMAX arg call malloc ref buf =
    	"Hi! What's your name? " arg
    		call printf nul =
    	stdin arg SMAX arg buf arg
    		call fgets nul =
    	0 buf buf arg call strlen 1 - + =
    	buf arg "Hello, %s! Welcome to Ubuntu!\n" arg
    		call printf nul =
    	0 return
    endfun

  10. #150
    Join Date
    Nov 2007
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: "Hello Ubuntu" in every programming language

    Has anybody got this already? (Message a bit modified)

    MS-DOS Batch
    (Yes, don't kill me)

    Code:
    @echo off
    
    echo Hello %1, you should get Ubuntu!!!
    pause
    **Release notes: MS-DOS Batches are not very input friendly (and I'm not very handy with them), so you need to input your name as a parameter; you would run it from the command line as "C:\getubuntu.bat myname"

    Edit: I just noticed, s1ightcrazed already did this better than me, so I'll call mine Ver. -1.0 ^_^
    Last edited by amingv; November 5th, 2007 at 05:19 PM.
    Wish I could prove I love you, but does that mean I have to walk on water?
    When we are older you'll understand it's enough when I say so, and maybe some things are that simple.

Page 15 of 30 FirstFirst ... 5131415161725 ... 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
  •