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
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
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
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é
GNU x86-64 ASM (stand alone)
GNU x86-64 ASM (using C environment)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
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 instructionsCode:# 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
can be replaced byCode:movq %rbp, %rsp # delete local vars. popq %rbp # restore caller's base pointer
Notice that arguments are passed in registers, not on the stack, on the x86-64 when in 64-bit mode.Code:leave
Intel i7-920; Nvidia GT 220, 1GB; MSI X58 Pro-E; 6GB DDR; 64-bit mode.
Johan (a prototype language I'm developing)
I would do a real language, but all the ones I know have been done.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
Last edited by Samjiman; October 27th, 2007 at 03:20 PM. Reason: Changed my mind on syntax
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
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
Has anybody got this already? (Message a bit modified)
MS-DOS Batch
(Yes, don't kill me)
**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"Code:@echo off echo Hello %1, you should get Ubuntu!!! pause
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.
Bookmarks