Files
Landon Curt Noll c0663537cb Add preview of 1984-2019
The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.

One will find HTML commented out with:

    <!-- XXX remove when 2020 is ready
    2020 links here
    XXX remove when 2020 is ready -->

The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks.  Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known.  The following files
have such HTML comment blocks in them.

    ./winners.html
    ./years-spoiler.html
    ./years.html

In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.

The 2020 winner code AND write-ups are NOT part of this set.

p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
2020-12-30 16:57:03 -08:00

60 lines
1.7 KiB
Haskell

-- See M. Douglas McIlroy, "Enumerating the strings of regular languages".
undefined = undefined;
data Bool = True | False;
(==) x y = case x <= y of { True -> y <= x ; False -> x <= y };
ife b t f = case b of { True -> t ; False -> f };
foldr c n xs = case xs of
{ [] -> n
; (:) h t -> c h (foldr c n t)
};
(++) = \xs ys -> foldr (:) ys xs;
unwords xs = case xs of
{ [] -> ""
; (:) x xt -> x ++ foldr (\a s -> ' ':a ++ s) "" xt
};
take n xs = ife (n == 0) [] (case xs of
{ [] -> []
; (:) x xt -> x:take (n-1) xt
});
length xs = case xs of { [] -> 0 ; (:) x xt -> 1 + length xt };
data Ordering = LT | GT | EQ;
intcmp x y = ife (x <= y) (ife (y <= x) EQ LT) GT;
flst xs n c = case xs of { [] -> n ; (:) x xt -> c x xt };
eqstrcmp xs ys = flst xs EQ (\x xt -> flst ys undefined (\y yt -> case intcmp x y of { LT -> LT ; GT -> GT ; EQ -> eqstrcmp xt yt }));
cmp xs ys = case intcmp (length xs) (length ys) of { LT -> LT ; GT -> GT ; EQ -> eqstrcmp xs ys };
alt xs ys = flst xs ys (\x xt -> flst ys xs (\y yt -> case cmp x y of { LT -> x:alt xt ys ; GT -> y:alt xs yt ; EQ -> x:alt xt yt } ));
cat xs ys = flst xs [] (\x xt -> flst ys [] (\y yt -> (x ++ y) : alt (cat [x] yt) (cat xt ys)));
clo xs = flst xs [""] (\x xt -> flst x (clo xt) (\_ _ -> "" : cat xs (clo xs)));
data Re = Nil
| Eps
| Sym Char
| Clo Re
| Cat Re Re
| Alt Re Re
;
enumR expr = case expr of
{ Nil -> []
; Eps -> [""]
; Sym a -> [[a]]
; Clo x -> clo (enumR x)
; Cat x y -> cat (enumR x) (enumR y)
; Alt x y -> alt (enumR x) (enumR y)
};
a = Sym 'a';
b = Sym 'b';
sandwich = Cat a (Cat (Clo b) a);
even_a = Clo (Alt sandwich b);
go stdin = unwords (take 32 (enumR even_a));