From d3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 20 Jan 2018 15:41:49 +0100 Subject: rearranged the dir for github - removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes --- projects/11/K/K.txt | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 projects/11/K/K.txt (limited to 'projects/11/K/K.txt') diff --git a/projects/11/K/K.txt b/projects/11/K/K.txt deleted file mode 100644 index dc75c82..0000000 --- a/projects/11/K/K.txt +++ /dev/null @@ -1,25 +0,0 @@ -from a to k - -- a title frame showing game name and instructions. space to continue. -- a main frame showing the game running -- a endofgame frame showing game results: win or lose - -- a Board class with cell being a 4 by 4 two-d array. -- arrange strings according to an orientation: arrange(4 strings, dir)=cells - - dir: 0: align to left, 1: align to right, 2: align to top, 3:align to bottom - - e.g.: arrange({"abc", "bc", "dc", "efeh", 0}) gives the following board: - abc_ - bc__ - dc__ - efeh - - arrange({"abc", "bc", "dc", "efeh", 0}, 3) gives the following - ___e - a__f - bbde - ccch -- a new tile of 'a' or 'b' appears each turn somewhere, using some quasirandomisation e.g. (23 * n^2 + 79) mod 16. - - addtile(char, x, y) -- the board transformation: board.trans(dir) = arrange(dir) . (fmap reduce) . getstring(dir). calls getstrings, then reduce on each row / column -- board.getstrings(dir)= the strings according to direction dir. Inverse of arrange. -- reduce(string)=string: reduce("baac")=="bbc"; reduce("aabb")=="bc"; and reduce("cbb")== "cc" instead of "d". -- when one of the hjkl keys is pressed get the direction dir. -- cgit v1.2.3