In rc:
% window 'echo hello world; sleep 5'
It's probably against the spirit, but hey, it fits on a Hollerith
card! Technically.
In C, the quickest thing I came up with using draw is:
#include <u.h>
#include <libc.h>
#include <draw.h>
void
main(void)
{
initdraw(0, 0, "hello");
string(screen, addpt(Pt(40,40), screen->r.min), display->black, ZP,
display->defaultfont, "hello world");
flushimage(display, 1);
sleep(5000);
}
If you throw in libpanel, it's only a little bigger (mostly libpanel
maintenance things) plus you get a button to quit:
#include <u.h>
#include <libc.h>
#include <draw.h>
#include <event.h>
#include <panel.h>
Panel *root;
void
done(Panel *p, int buttons) {
USED(p, buttons);
exits(0);
}
void eresized(int new)
{
Rectangle r;
if(new && getwindow(display, Refnone) == -1) {
fprint(2, "getwindow: %r\n");
exits("getwindow");
}
r = screen->r;
plpack(root, r);
draw(screen, r, display->white, 0, ZP);
pldraw(root, screen);
}
void
main(void)
{
Event e;
initdraw(0, 0, "hello");
einit(Emouse);
plinit(screen->depth);
root=plframe(0, EXPAND);
pllabel(root, PACKN|FILLX, "Hello world!");
plbutton(root, PACKN, "Done", done);
eresized(0);
for (;;) {
switch(event(&e)){
case Emouse:
plmouse(root, e.mouse);
break;
}
}
}
On Tue, Aug 18, 2009 at 10:26 AM, ron minnich<[email protected]> wrote:
> See this: http://www.wxwidgets.org/docs/tutorials/hworld2.txt
>
> Well, they just seem to keep getting longer.
>
> Your goal: hello, world in one line. Language of your choice. Linking
> in a 512 MB library is a violation of the spirit of this contest.
>
> Additional rules:
> - line length is not defined but let's be reasonable
> - if you can fit it in a standard Hollerith card format (72 chars plus
> 8 chars of comment) that's a plus
>
> Redirection of stdout is allowed.
>
> ron
> ron
>
>
--
"Object-oriented design is the roman numerals of computing" -- Rob Pike