Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
Binary file not shown.
@@ -0,0 +1,165 @@
|
||||
#define G(n) int n(int t, int q, int d)
|
||||
#define X(p,t,s) (p>=t&&p<(t+s)&&(p-(t)&1023)<(s&1023))
|
||||
#define U(m) *((signed char *)(m))
|
||||
#define F if(!--q){
|
||||
#define I(s) (int)main-(int)s
|
||||
#define P(s,c,k) for(h=0; h>>14==0; h+=129)Y(16*c+h/1024+Y(V+36))&128>>(h&7)?U(s+(h&15367))=k:k
|
||||
|
||||
G (B)
|
||||
{
|
||||
Z;
|
||||
F D = E (Y (V), C = E (Y (V), Y (t + 4) + 3, 4, 0), 2, 0);
|
||||
Y (t + 12) = Y (t + 20) = i;
|
||||
Y (t + 24) = 1;
|
||||
Y (t + 28) = t;
|
||||
Y (t + 16) = 442890;
|
||||
Y (t + 28) = d = E (Y (V), s = D * 8 + 1664, 1, 0);
|
||||
for (p = 0; j < s; j++, p++)
|
||||
U (d + j) = i == D | j < p ? p--, 0 : (n = U (C + 512 + i++)) < ' ' ? p |=
|
||||
n * 56 - 497, 0 : n;
|
||||
}
|
||||
|
||||
n = Y (Y (t + 4)) & 1;
|
||||
F
|
||||
U (Y (t + 28) + 1536) |=
|
||||
62 & -n;
|
||||
M
|
||||
U (d + D) =
|
||||
X (D, Y (t + 12) + 26628, 412162) ? X (D, Y (t + 12) + 27653,
|
||||
410112) ? 31 : 0 : U (d + D);
|
||||
for (; j < 12800; j += 8)
|
||||
P (d + 27653 + Y (t + 12) + ' ' * (j & ~511) + j % 512,
|
||||
U (Y (t + 28) + j / 8 + 64 * Y (t + 20)), 0);
|
||||
}
|
||||
|
||||
F if (n)
|
||||
{
|
||||
D = Y (t + 28);
|
||||
if (d - 10)
|
||||
U (++Y (t + 24) + D + 1535) = d;
|
||||
else
|
||||
{
|
||||
for (i = D; i < D + 1600; i++)
|
||||
U (i) = U (i + 64);
|
||||
Y (t + 24) = 1;
|
||||
E (Y (V), i - 127, 3, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
Y (t + 20) += ((d >> 4) ^ (d >> 5)) - 3;
|
||||
}
|
||||
}
|
||||
|
||||
G (_);
|
||||
G (o);
|
||||
G (main)
|
||||
{
|
||||
Z, k = K;
|
||||
if (!t)
|
||||
{
|
||||
Y (V) = V + 208 - (I (_));
|
||||
L (209, 223) L (168, 0) L (212, 244) _((int) &s, 3, 0);
|
||||
for (; 1;)
|
||||
R n = Y (V - 12);
|
||||
if (C & ' ')
|
||||
{
|
||||
k++;
|
||||
k %= 3;
|
||||
if (k < 2)
|
||||
{
|
||||
Y (j) -= p;
|
||||
Y (j) += p += U (&D) * (1 - k * 1025);
|
||||
if (k)
|
||||
goto y;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (C = V - 20;
|
||||
!i && D & 1 && n
|
||||
&& (X (p, Y (n + 12), Y (n + 16)) ? j = n + 12, Y (C + 8) =
|
||||
Y (n + 8), Y (n + 8) = Y (V - 12), Y (V - 12) =
|
||||
n, 0 : n); C = n, n = Y (n + 8));
|
||||
i = D & 1;
|
||||
j &= -i;
|
||||
}
|
||||
}
|
||||
else if (128 & ~D)
|
||||
{
|
||||
E (Y (n), n, 3, U (V + D % 64 + 131) ^ 32);
|
||||
n = Y (V - 12);
|
||||
y:C = 1 << 24;
|
||||
M U (C + D) = 125;
|
||||
o (n, 0, C);
|
||||
P (C + p - 8196, 88, 0);
|
||||
M U (Y (0x11028) + D) = U (C + D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (D = 720; D > -3888; D--)
|
||||
putchar (D >
|
||||
0 ?
|
||||
" )!\320\234\360\256\370\256 0\230F .,mnbvcxz ;lkjhgfdsa \n][poiuytrewq =-0987654321 \357\262 \337\337 \357\272 \337\337 ( )\"\343\312F\320!/ !\230 26!/\16 K>!/\16\332 \4\16\251\0160\355&\2271\20\2300\355`x{0\355\347\2560 \237qpa%\231o!\230 \337\337\337 , )\"K\240 \343\316qrpxzy\0 sRDh\16\313\212u\343\314qrzy !0( "
|
||||
[D] ^ 32 : Y (I (D)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
G (o)
|
||||
{
|
||||
Z;
|
||||
if (t)
|
||||
{
|
||||
C = Y (t + 12);
|
||||
j = Y (t + 16);
|
||||
o (Y (t + 8), 0, d);
|
||||
M U (d + D) =
|
||||
X (D, C, j) ? X (D, C + 1025, j - 2050) ? X (D, C + 2050,
|
||||
j - 3075) ? X (D,
|
||||
C + 2050,
|
||||
j -
|
||||
4100) ?
|
||||
X (D, C + 4100,
|
||||
((j & 1023) + 18424)) ? 176 : 24 : 20 : 28 : 0 : U (d + D);
|
||||
for (n = Y (t + 4); U (i + n); i++)
|
||||
P (d + Y (t + 12) + 5126 + i * 8, U (n + i), 31);
|
||||
E (Y (t), t, 2, d);
|
||||
}
|
||||
}
|
||||
|
||||
G (_)
|
||||
{
|
||||
Z = Y (V + 24);
|
||||
F Y (V - 16) += t;
|
||||
D = Y (V - 16) - t;
|
||||
}
|
||||
|
||||
F for (i = 124; i < 135; i++)
|
||||
D = D << 3 | Y (t + i) & 7;
|
||||
}
|
||||
|
||||
if (q > 0)
|
||||
{
|
||||
for (; n = U (D + i); i++)
|
||||
if (n - U (t + i))
|
||||
{
|
||||
D += _(D, 2, 0) + 1023 & ~511;
|
||||
i = ~0;
|
||||
}
|
||||
F if (Y (D))
|
||||
{
|
||||
n = _(164, 1, 0);
|
||||
Y (n + 8) = Y (V - 12);
|
||||
Y (V - 12) = n;
|
||||
Y (n + 4) = i = n + 64;
|
||||
for (; j < 96; j++)
|
||||
Y (i + j) = Y (t + j);
|
||||
i = D + 512;
|
||||
j = i + Y (i + 32);
|
||||
for (; Y (j + 12) != Y (i + 24); j += 40);
|
||||
E (Y (n) = Y (j + 16) + i, n, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return D;
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
Best of Show:
|
||||
|
||||
Gavin Barraclough
|
||||
Flat 20, 83 Newton Street,
|
||||
Manchester,
|
||||
M1 1EP,
|
||||
U.K.
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build and run (on any platform, without root privileges):
|
||||
|
||||
make gavin
|
||||
|
||||
To enjoy the results (on a Linux/x86 machine):
|
||||
|
||||
su
|
||||
|
||||
# Make a floppy with an ext2 filesystem (mke2fs /dev/fd0),
|
||||
# mount it under /mnt/floppy
|
||||
|
||||
cp kernel fs.tar lilo.conf boot.b /mnt/floppy
|
||||
|
||||
# If the version of your lilo is not 21.4, use the appropriate boot.b
|
||||
# If your floppy drive is not /dev/fd0, edit lilo.conf appropriately
|
||||
|
||||
lilo -C /mnt/floppy/lilo.conf
|
||||
|
||||
# Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse
|
||||
# Move the window away from the corner
|
||||
|
||||
vi gavin.c
|
||||
|
||||
# Scroll the file with up-arrow and down-arrow
|
||||
|
||||
sh
|
||||
|
||||
# Can have several shell windows
|
||||
|
||||
vi gavin.hint
|
||||
prim
|
||||
|
||||
# Press and hold any key
|
||||
|
||||
Over the years, we've seen a program that dumps core
|
||||
if executed on a "wrong" architecture immediately (1984/mullender),
|
||||
or after a while (2001/bellard). This entry will happily compile and
|
||||
execute on any architecture - the trick is that the result, to be useful,
|
||||
must be produced (and can only be enjoyed) on a particular architecture.
|
||||
We have not decided yet whether to disallow this for future contests.
|
||||
|
||||
If you do not want to mess with a floppy and you use GRUB, see below
|
||||
in the author's notes.
|
||||
You can put additional text files in fs.tar for browsing with vi.
|
||||
If you do not want to bother rebooting your computer at all,
|
||||
see http://bellard.org/ for QEMU (Fabrice Bellard is an IOCCC 2001 winner),
|
||||
but your experience will be limited (replace -DK=0 with -DK=1 in the Makefile,
|
||||
and you will have to move the mouse to trigger the initial screen update).
|
||||
|
||||
The judges were able to write a few more programs to run on this OS
|
||||
What are the limitations for such programs?
|
||||
What you can do and what you cannot do in such programs?
|
||||
|
||||
The program called "prim", written by the judges,
|
||||
computes and prints prime numbers.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This is a 32-bit multitasking operating system for x86 computers,
|
||||
with GUI and filesystem, support for loading and executing user
|
||||
applications in elf binary format, with ps2 mouse and keyboard drivers,
|
||||
and vesa graphics. And a command shell. And an application -
|
||||
a simple text-file viewer.
|
||||
|
||||
The OS has ended up as a traditional monolith with one entry point
|
||||
for syscalls, with apps treated as cooperative-multitasking tasks
|
||||
that can be sent different messages (e.g. 'initialize', 'key hit',
|
||||
'render to buffer') through their main entry point, and which will
|
||||
return control to the OS having performed the necessary work.
|
||||
Applications are are passed a pointer to their task structure,
|
||||
which is partially defined by the OS, and partially for
|
||||
the application's own use.
|
||||
|
||||
The program compiles into a tool to build a kernel image,
|
||||
so having built the program, the makefile will run it,
|
||||
piping the output into a file called 'kernel'.
|
||||
The makefile will then proceed to build a root filesystem image.
|
||||
This involves rebuilding the program with different compiler flags,
|
||||
then building a tar file containing the resulting programs
|
||||
(the filesystem format supported by the OS is the tar-file format).
|
||||
|
||||
For further usage information see 'gavin_install.txt'.
|
||||
|
||||
The filenames 'vi' and 'sh' are significant, and should not be changed.
|
||||
|
||||
Known 'features'.
|
||||
|
||||
Known issues are really too plentiful to list.
|
||||
|
||||
If the mouse pointer goes off the left hand side of the screen
|
||||
it will reappear on the right, and vice-versa.
|
||||
If it goes off the top or bottom, it will go and corrupt some memory.
|
||||
|
||||
The file system is kinda optimistic about matching names, so,
|
||||
for example if you type the command 'shell' into a command-line
|
||||
it will execute the program 'sh' - close enough a match for it.
|
||||
|
||||
The elf binaries are not loaded at the correct address,
|
||||
and their entry point must be the start address of the text segment.
|
||||
|
||||
The keyboard driver can cope with the basic alpha-numeric keys,
|
||||
but gets confused by fancy things like 'shift' or 'backspace'.
|
||||
|
||||
In the text-file viewer, 'vi', the up/down and pgup/pgdn keys
|
||||
scroll up or down by one line. There is nothing to stop you
|
||||
[from] scrolling above the top of the file, and pressing any
|
||||
other keys may have an undefined effect.
|
||||
|
||||
The x86 is bootstrapped into 32bit mode in 6 instructions,
|
||||
with 4 more to set up data/stack segments and a stack-pointer
|
||||
to allow C code to be run. On top of this there are also about
|
||||
a dozen instructions to switch the video card into graphics mode.
|
||||
All in all, a relatively tiny number of instructions next to
|
||||
the size of the C program. Also, the string is mostly composed
|
||||
of data - a Linux-esque kernel header for the bootloader,
|
||||
protected mode descriptor tables, keyboard maps, etc.
|
||||
(I should also mention that it contains mini functions
|
||||
to perform an x86 'in' and 'out' instruction - to allow
|
||||
the keyboard & mouse to be driven from C code).
|
||||
|
||||
Porting to another architecture should be relatively easy* -
|
||||
the string simply needs be replaced with one containing
|
||||
data & code suitable for the new target platform.
|
||||
Accesses to data in the string are made relative to the define 'V',
|
||||
so these may need updating as appropriate (0x90200 is the address
|
||||
at which a Linux bootloader loads an x86 kernel image).
|
||||
|
||||
* ;-)
|
||||
@@ -0,0 +1,16 @@
|
||||
1) First, build the kernel and filesystem (just 'make'). In short, you need to build this on an x86 Linux machine. If you wish to try to compile on an OS other than Linux you may need modify the makefile to compile 'sh' using a cross-compiler that produces elf binaries - i.e. a cross-compiler targeting x86 Linux. In short, you need to build this on an x86 Linux machine.
|
||||
|
||||
2) Next, find a suitable machine to run the OS on. It should be perfectly safe, and since it does not directly attempt to access any hard disk drives (only a ramdisk loaded by the bootloader) it should do no damage to your existing setup, BUT I ACCEPT NO LIABILITY FOR ANY DAMAGE DONE BY THIS PROGRAM. Run it at your own risk. The OS has been tested on half a dozen machines or so, and worked on all but one. The failure came in the form of the machine rebooting itself midway through loading the OS, with no nasty side-effects.
|
||||
|
||||
Hardware requirements - i386 or better processor, but the GUI is surprisingly power-hungry, so I would recommend a fast p3 or p4 processor (has been tested on p3/p4/athlon machines). Minimum RAM is something like 32MB. PS2 mouse & keyboard required - no USB I'm afraid, and the keyboard map is for a UK keyboard. Uses Vesa VBE 3.0, so should work on any modern graphics card (has been tested on Nvidia, Matrox, and SiS cards).
|
||||
|
||||
3) Now you need to setup a bootloader to load the OS. If you have a system using a lilo bootloader you can simply add the OS to your boot menu. Just add appropriate "image=" and "initrd=" lines to your /etc/lilo.conf, pointing at 'kernel' and 'fs.tar' respectively (as built by make earlier), then run lilo. If you do not wish modify your lilo setup, one easy option is to get yourself a grub bootdisk image, and follow the instructions for grub below - debian users can simple "apt-get install grub-disk" to get themselves a grub bootdisk.
|
||||
|
||||
If you run grub, then at the boot menu simply hit 'c' to get a console, then type "kernel=(hd0,0)/<PATH>/kernel" (substituting appropriate harddrive/partition numbers & path, or using "(fd0)" to load a kernel on the floppy), then "initrd=(hd0,0)/<PATH>/fs.tar", and finally "boot".
|
||||
|
||||
4) Assuming the OS has booted, what can you do now? Well, start by trying "sh", to open another shell. Then, try "vi prog.c" (although this file may have been re-named...), to open up the OS source in a text file viewer (up/down or pgup/pgdown to scroll). [Note that the provided applications, 'sh' and 'vi' both have windows of the same size, and that open in the top left corner of the screen, so you may need drag the windows around a bit to tell them apart.]
|
||||
|
||||
5) To shut down - just hit the power button. :-)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
boot=/dev/fd0
|
||||
map=/mnt/floppy/map
|
||||
install=/mnt/floppy/boot.b
|
||||
default=ioccc
|
||||
|
||||
image=/mnt/floppy/kernel
|
||||
label=ioccc
|
||||
read-only
|
||||
initrd=/mnt/floppy/fs.tar
|
||||
Binary file not shown.
Reference in new issue
Block a user