Re: "Hello Ubuntu" in every programming language
Wish
(tcl/tk)
This script should would with every version of tcl/tk from 8.0
to the current, just released 8.5.0
There is nothing wrong with the earlier Tcl version in this
thread. Just wanted to add a little Tk.
Current practice would be to run with tclsh, and a first line
"package require Tk", however, the script as written will
work with older installations. The script could be simpler still,
and utilize only one toplevel widget, but, I kinda like it this way ;)
Code:
#! /usr/bin/wish
wm withdraw .
wm title . "Welcome!"
toplevel .t
wm withdraw .t
wm title .t "Sign in Please!"
label .t.l -text "Please enter your name: "
entry .t.e -textvariable name
grid .t.l .t.e
wm deiconify .t
bind .t.e <Return> myproc
proc myproc { } {
wm deiconify .
}
label .l -text "Welcome to Ubuntu"
label .l2 -textvariable name
button .b -text "Exit" -command {exit}
grid .l .l2
grid .b -columnspan 2
Hope someone finds it interesting.
Steve
Re: "Hello Ubuntu" in every programming language
Quote:
Originally Posted by
mike_g
Blitz Basic
Code:
s$=Input("Hi! Whats your name? ")
Print "Hello "+s$+"! Welcome to Ubuntu!"
WaitKey
That's the stuff:guitar:
Re: "Hello Ubuntu" in every programming language
VIM
Code:
:r! echo $USERNAME
:s/^/Hello,/
:s/$/. Welcome to Ubuntu!/
:write
:quit
Save this in a file called file.vim and run it like this :
Code:
vim -es output < file.vim
Then, have a look at the output file !
Also :
Code:
map ,M <Esc>aHello,<Esc>:r! whoami<cr>A. Welcome to ubuntu!<Esc>kJ
Re: "Hello Ubuntu" in every programming language
Another 64 bit assembly written for yasm:
Code:
section .data
string1 db "Hello World!",10,0
section .text
global _start
_start:
mov rdi, dword string1
mov rcx, dword -1
xor al,al
cld
repnz scasb
mov rdx, dword -2
sub rdx, rcx
mov rsi, dword string1
push 0x1
pop rax
mov rdi,rax
syscall
xor rdi,rdi
push 0x3c
pop rax
syscall
Re: "Hello Ubuntu" in every programming language
Quote:
Originally Posted by
happysmileman
I'm poretty sure that should be longer, I think it didn't send properly but I tried a few times, maybe Opera is at fault?
Hey, don't knock my darling! :) I've used Opera since 1999 and never had any such trouble. Up until Opera 9.2 there were still 1 or 2 banking/secure pages that wouldn't work, but now I only use Firefox for the webdesign plugins. Opera is soo fast and sexy... :)
Far more likely a server/php/isp hiccup. Maybe the editor doesn't like huge chunks of digits with no spaces.
Back on topic: Is there a Boo vs Python comparison somewhere? Python reminds me a bit of Lingo, especially the variable handling.
Also, not that I think x86 mnemonics even remotely appeal to my tastes, I would think it only in order to make a proper OS API, libraries and one or two macros to call those functions. Then asm would be like any other language, only running at each machine's true potential, and the choice would be truly free.
Or maybe there is such an option in Linux - could someone show in this thread how that would look?
Re: "Hello Ubuntu" in every programming language
Moderators: please remove this. Accidental double post. Sorry about that.
Re: "Hello Ubuntu" in every programming language
Scheme
Been about 2 years since I wrote scheme, so I relearned the basics to write this programs. Improvements welcome.
Quote:
(define message "Welcome to Ubuntu, ")
(begin
(display "What is your name?: ")
(let ((name (read)))
(display
(string-append message (symbol->string name))
)
)
)
Always seemed like a weird yet strangely cool language. I have almost totally forgotten it....
*Edit: the tabs got all messed up in posting. Have fun sorting out all those parens without indentation....
Re: "Hello Ubuntu" in every programming language
Excel / OpenOffice Spreadsheet Formula:
Quote:
="Hello " & A1 & ", welcome to Ubuntu!"
(Where A1 is the cell with the name in it)
Quick JavaScript:
Quote:
alert('Hello ' + prompt('Please enter your name', '') + ', welcome to Ubuntu!');
Perl style Regular Expression:
Quote:
s/Name:\s+([a-zA-Z0-9 -]+)/Hello $1, welcome to Ubuntu!/
Format accepted is 'Name:' followed by one or more spaces, followed by your name.
Re: "Hello Ubuntu" in every programming language
Shellcode is still missing :lolflag:
Re: "Hello Ubuntu" in every programming language
Code:
#!/bin/bash
echo Hello World
then