whitespace (another version)
I used the tr command to convert the blanks, tabs and newlines to -, t and n, respectively. The actual version is attached (with .txt added to allow it to be attached).Code:---t--t---ntn-----tt-t--tntn-----t----tntn-----t-----ntn-----t-t-tttntn-----tt-t---ntn-----tt----tntn-----ttt-t--ntn-----t--tttntn-----ttt--ttntn-----t-----ntn-----tttt--tntn-----tt-ttttntn-----ttt-t-tntn-----ttt--t-ntn-----t-----ntn-----tt-ttt-ntn-----tt----tntn-----tt-tt-tntn-----tt--t-tntn-----ttttttntn-----t-----ntn-----nn---tt--t--n-n-tnt--n-ttt---t-t-nt--tnt--tt--t---n---tnt---n-n-tt--t--nn---tt--t---n---t--t---ntn-----tt--t-tntn-----tt-tt--ntn-----tt-tt--ntn-----tt-ttttntn-----t-tt--ntn-----t-----ntn-----nn---t--t-tt--n-n-ttt-n----t-t-nt--tnt--tt--t----ntn-----tnt---n-n-t--t-tt--nn---tt--t----n-nn---t----tntn-----t-----ntn-----t-t-tttntn-----tt--t-tntn-----tt-tt--ntn-----tt---ttntn-----tt-ttttntn-----tt-tt-tntn-----tt--t-tntn-----t-----ntn-----ttt-t--ntn-----tt-ttttntn-----t-----ntn-----t-t-t-tntn-----tt---t-ntn-----ttt-t-tntn-----tt-ttt-ntn-----ttt-t--ntn-----ttt-t-tntn-----t----tntn-----t-t-ntn--nnn
Here it is in action (using the perl implementation of whitespace 0.2):
Code:$ perl whitespace.pl helloubuntu.ws Hi! What's your name? WW Hello, WW! Welcome to Ubuntu! $
It used to be possible to do this in Wordstar/Mailmerge, although the input would have to come from a file. Can anyone remember how to do it? It's just so long ago, and i'm getting old...
I haven't seen a FORTH version in this thread, so here's one:
I ran this using gforth from the ubuntu repositories.Code:( Welcome to Ubuntu in FORTH ) : input pad 1+ 127 accept pad c! pad ; : getname ." Hi, what is your name? " input ; : welcome cr getname cr ." Hello " count type ." ! Welcome to Ubuntu!" ;
COBOL !
This Makes good bedtime readingCode:$ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. HelloWelcomeToUbuntu AUTHOR. Mike Hibbert. DATA DIVISION. WORKING-STORAGE SECTION. 01 UserDetails. 02 Name PIC X(20) PROCEDURE DIVISION. Begin. DISPLAY "Enter Your Name". ACCEPT UserDetails. DISPLAY "Hello " Name. DISPLAY "Welcome to Ubuntu". STOP RUN.
Mike
Last edited by Mickeysofine1972; May 26th, 2008 at 04:49 PM.
PIET
The small image is the actual program, i attached a big one to enjoy
edit2: imageshack converted the .bmp to .png I added the original picture as attachment
Piet
I used Hipi (Hipi Is a Piet Interpreter) to make the program
edit: I needed to do it in Windows, Hipi didnt run good even with wine 1.0rc.
Its like assembler, just worse. I couldnt just modify the "hello world" program but had to code "Hello, Ubuntu!" myself.
Its my first Piet program, so excuse my bad programming style
Last edited by conehead77; May 24th, 2008 at 07:23 PM.
NEVER use a command given to you before asking and knowing exactly what it does. Make sure you know what it is that you're telling your system to do before doing it; some commands can be very harmful to your system or leave you vulnerable to attack.
Small mistake: you usedfor the string to print, but that is incorrect, as it takes the adress-of the string array, not the array itself. So it needs to read:Code:&name
(or alternatively: &name[0])Code:#include <stdio.h> int main() { char name[64]; printf("Hi! What's your name? "); scanf("%s", name); printf("Hello, %s! Welcome to Ubuntu (GNU)/Linux!\n", name); return 0; }
Last edited by robheus; May 25th, 2008 at 08:40 AM.
How about LOLCODE?
I'm sure it'd be something likeCode:HAI CAN HAS STDIO MAEK NAME VISIBLE "Hello, What's your name? " GET NAME VISIBLE "Oh Hai! " NAME " Welcome to Ubuntu GNU/Linux!1" KTHXBYE
Bookmarks