Page 21 of 30 FirstFirst ... 111920212223 ... LastLast
Results 201 to 210 of 297

Thread: "Hello Ubuntu" in every programming language

  1. #201
    Join Date
    Nov 2007
    Location
    Urjala, Finland
    Beans
    17
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: "Hello Ubuntu" in every programming language

    OPL

    Code:
    PROC HelloUbuntu:
      LOCAL Name$(64)
      PRINT "Hi! What's your name?"
      INPUT Name$
      PRINT "Hello+Name$+". Welcome to Ubuntu!"
      GET
    ENDP
    Last edited by Sera88; August 22nd, 2008 at 05:54 PM.

  2. #202
    Join Date
    Apr 2008
    Beans
    54

    Re: "Hello Ubuntu" in every programming language

    FLEX

    Code:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:HBox>
      	<mx:Label text="Enter Your Name"/>
        <mx:TextInput id="textBox"/>    	
      </mx:HBox>  
      <mx:Button click="mx.controls.Alert.show('Hello, ' + textBox.text, 'Alert Box')" label="Say Hello!"/>
    </mx:Application>

  3. #203
    Join Date
    Mar 2007
    Location
    Florida
    Beans
    Hidden!

    Re: "Hello Ubuntu" in every programming language

    BeFunge
    Code:
                     v
    >v"Hello Ubuntu"0<
    ,:
    ^_25*,@

  4. #204
    Join Date
    Jun 2008
    Beans
    3
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: "Hello Ubuntu" in every programming language

    Ruby

    Code:
    #!/usr/bin/ruby
    print 'Hi. What\'s your name? '
    name = readline
    name.chomp!
    puts 'Hello, ' + name + '. Welcome to Ubuntu.'

  5. #205
    Join Date
    Jul 2007
    Beans
    84
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    QtRuby Qt 4

    QtRuby Qt 4

    Code:
    #!/usr/bin/env ruby
    require 'Qt4'
    
    include Qt
    class Ubuntu < Qt::Widget
      slots 'mesg()'
      def initialize(parent = nil)
        super()
        @text = Qt::LineEdit.new(tr('Hi. What\'s your name'), self)
        connect(@text, SIGNAL('returnPressed()'), self, SLOT('mesg()'))
        layout = Qt::VBoxLayout.new()
        layout.addWidget(@text)
        setLayout(layout)
      end
      def mesg()
        name = @text.text()
        ret = MessageBox::warning(self, tr("Hi"),
        tr("Hi, "+name+". Welcome to Ubuntu!"),
        MessageBox::Ok | MessageBox::Cancel,
        MessageBox::Ok)
        $qApp::quit()
      end
    end
    
    app = Qt::Application.new(ARGV)
    
    widget = Ubuntu.new()
    widget.setWindowTitle("Hello Ubuntu")
    widget.show()
    
    app.exec()

  6. #206
    Join Date
    May 2008
    Beans
    Hidden!

    Re: "Hello Ubuntu" in every programming language

    I can't believe nobody has written one in INTERCAL yet! What better language is there? For, say, curing us of our sanity?

    I'll leave this honor to somebody of more courage. Or more patience for long, difficult manuals that discuss error messages like 'PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON' (if that's not where they started).

    A "hello, world" program will suffice until somebody with enough nerve figures out how to do it a better way.

    Code:
    DO ,1 <- #13
    PLEASE DO ,1SUB#1 <- #234
    DO ,1SUB#2 <- #112
    DO ,1SUB#3 <- #112
    DO ,1SUB#4 <- #0
    DO ,1SUB#5 <- #64
    DO ,1SUB#6 <- #194
    DO ,1SUB#7 <- #48
    PLEASE DO ,1SUB#8 <- #22
    DO ,1SUB#9 <- #248
    DO ,1SUB#10 <- #168
    DO ,1SUB#11 <- #24
    DO ,1SUB#12 <- #16
    DO ,1SUB#13 <- #214
    PLEASE READ OUT ,1
    PLEASE GIVE UP
    I think this might technically violate the rule that the submitted programs be readable.

  7. #207
    Join Date
    May 2008
    Location
    Southern California
    Beans
    7

    Re: "Hello Ubuntu" in every programming language

    MATLAB

    Quote Originally Posted by aJayRoo View Post
    When you enter your name you have to enclose it in single quotes or Matlab will assume it is a variable name.
    Not anymore.

    Code:
    % helloubuntu.m
    
    name = input('What is your name? : ','s');
    greeting = sprintf('Hello, %s! Welcome to Ubuntu!', name);
    disp(greeting);

  8. #208
    Join Date
    Jun 2008
    Location
    Narnia
    Beans
    784
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: "Hello Ubuntu" in every programming language

    Quote Originally Posted by haldean View Post
    TI-BASIC
    Code:
    Input "WHAT'S YOUR     NAME? ",Str1
    Disp Str1
    can't be run on a computer, but I felt it was a glaring omission.
    (btw: tons of spaces so 'name?' doesn't get cut across lines )
    Disagreement.
    Code:
    ClrHome
    InpSt "Hi! What's your name?", A
    Disp "Hello,"
    Output(8, 2, A)
    Output(1, 3, "Welcome to Ubuntu!"
    Note: Use of ClrHome is so that Output cooperates, and use of Output is so that the string can be on the same line. The second Output is because using Disp might've led to double-text/other-problems. Sloppy version:
    [CODE]
    InpSt "Hi! What's your name?", A
    Disp "Hello,",A,"Welcome to Ubuntu!"
    Last edited by fiddler616; August 30th, 2008 at 09:42 PM. Reason: More info...

  9. #209
    Join Date
    Sep 2008
    Beans
    148

    Re: "Hello Ubuntu" in every programming language

    AutoIt
    Code:
    $name = inputbox("Welcome", "Please enter your name :)")
    msgbox(0,"Hello","Welcome "&$name&" to Ubuntu");
    JustBasic
    Code:
    input "Please enter your name"; nme$
    print "Hello";nme$;"Welcome to ubuntu"
    Both windows languages but compilers work well under WINE
    Last edited by ratmandall; September 6th, 2008 at 09:56 AM.

  10. #210
    Join Date
    Dec 2006
    Location
    Riga, Latvia
    Beans
    74
    Distro
    Ubuntu Karmic Koala (testing)

    Re: "Hello Ubuntu" in every programming language

    ABAP

    Code:
    REPORT ZHB00001.
    WRITE: 'Hello world'.

Page 21 of 30 FirstFirst ... 111920212223 ... 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
  •