Browse Source

Plan 9 from Bell Labs 2005-03-11

David du Colombier 19 years ago
parent
commit
c33c09462e
7 changed files with 549 additions and 60 deletions
  1. 35 28
      dist/replica/_plan9.db
  2. 35 31
      dist/replica/plan9.db
  3. 35 0
      dist/replica/plan9.log
  4. 48 0
      lib/face/48x48x2/p/pjw+9ball.2
  5. 394 0
      sys/src/games/memo.c
  6. 1 0
      sys/src/games/mkfile
  7. 1 1
      sys/src/mkfile

+ 35 - 28
dist/replica/_plan9.db

@@ -1214,55 +1214,56 @@ lib/face/48x48x1/y - 20000000755 sys sys 944941680 0
 lib/face/48x48x1/z - 20000000755 sys sys 944941680 0
 lib/face/48x48x2 - 20000000755 sys sys 944941683 0
 lib/face/48x48x2/.dict - 664 sys sys 1059677865 534
-lib/face/48x48x2/a - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/a - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/a/adb.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/a/andrew.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/b - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/b - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/b/bart.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/b/bwk.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/c - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/c - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/c/ches.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/d - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/d - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/d/dmr.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/d/doug.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/e - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/e - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/e/ehg.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/f - 20000000755 sys sys 944941681 0
-lib/face/48x48x2/g - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/f - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/g - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/g/gerard.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/h - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/h - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/h/hobby.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/h/howard.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/i - 20000000755 sys sys 944941681 0
-lib/face/48x48x2/j - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/i - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/j - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/j/judy.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/k - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/k - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/k/kahrs.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/k/ken.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/l - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/m - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/n - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/o - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/p - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/l - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/m - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/n - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/o - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/p - 20000000775 sys sys 1110466178 0
 lib/face/48x48x2/p/pg.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/p/philw.1 - 644 sys sys 944941682 1776
+lib/face/48x48x2/p/pjw+9ball.2 - 664 sys sys 1110466179 1776
 lib/face/48x48x2/p/pjw.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/p/presotto.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/q - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/r - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/q - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/r - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/r/rob.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/s - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/s - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/s/sean.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/s/seanq.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/t - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/t - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/t/td.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/t/tom.1 - 644 sys sys 944941683 1776
-lib/face/48x48x2/u - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/v - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/w - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/x - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/y - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/z - 20000000755 sys sys 944941683 0
+lib/face/48x48x2/u - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/v - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/w - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/x - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/y - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/z - 20000000775 sys sys 1020895710 0
 lib/face/48x48x4 - 20000000775 sys sys 944941894 0
 lib/face/48x48x4/.dict - 664 sys sys 1103981657 2530
 lib/face/48x48x4/Z - 20000000775 sys sys 944945342 0
@@ -11307,7 +11308,8 @@ sys/src/games/mahjongg/level.c - 644 sys sys 1095792293 2522
 sys/src/games/mahjongg/mahjongg.c - 644 sys sys 1095792293 3452
 sys/src/games/mahjongg/mahjongg.h - 644 sys sys 1095792293 1606
 sys/src/games/mahjongg/mkfile - 644 sys sys 1095792293 230
-sys/src/games/mkfile - 664 sys sys 1108184131 526
+sys/src/games/memo.c - 644 sys sys 1110436470 6837
+sys/src/games/mkfile - 664 sys sys 1110435498 533
 sys/src/games/music - 20000000775 sys sys 1103793915 0
 sys/src/games/music/Readme - 664 sys sys 1103793914 488
 sys/src/games/music/debug.h - 664 sys sys 1103793914 201
@@ -12441,7 +12443,7 @@ sys/src/libventi/session.h - 664 sys sys 1063853749 936
 sys/src/libventi/strdup.c - 664 sys sys 1045502096 203
 sys/src/libventi/venti.txt - 664 sys sys 1045502097 4347
 sys/src/libventi/zero.c - 664 sys sys 1045502097 1509
-sys/src/mkfile - 664 sys sys 1073061130 1006
+sys/src/mkfile - 664 sys sys 1110437421 1005
 sys/src/mkfile.proto - 664 sys sys 1105121349 265
 tmp - 20000000555 sys sys 953999902 0
 usr - 20000000775 sys sys 953406542 0
@@ -12463,3 +12465,8 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/games/catclock - 775 sys sys 1110513961 140798
+386/bin/games/juggle - 775 sys sys 1110513961 125201
+386/bin/games/mahjongg - 775 sys sys 1110513961 163488
+386/bin/games/memo - 775 sys sys 1110513962 156565
+386/bin/games/sokoban - 775 sys sys 1110513962 163480

+ 35 - 31
dist/replica/plan9.db

@@ -244,12 +244,14 @@
 386/bin/fs/zipfs - 775 sys sys 1109650121 109088
 386/bin/ftpfs - 775 sys sys 1109650121 154523
 386/bin/games - 20000000775 sys sys 1096298711 0
-386/bin/games/juggle - 775 sys sys 1096341940 123161
+386/bin/games/catclock - 775 sys sys 1110513961 140798
+386/bin/games/juggle - 775 sys sys 1110513961 125201
 386/bin/games/jukebox - 775 sys sys 1105589128 264821
 386/bin/games/jukefs - 775 sys sys 1105589129 165320
-386/bin/games/mahjongg - 775 sys sys 1096341940 161454
+386/bin/games/mahjongg - 775 sys sys 1110513961 163488
+386/bin/games/memo - 775 sys sys 1110513962 156565
 386/bin/games/playlistfs - 775 sys sys 1105589129 148484
-386/bin/games/sokoban - 775 sys sys 1096341940 157093
+386/bin/games/sokoban - 775 sys sys 1110513962 163480
 386/bin/getmap - 775 sys sys 1104122014 65180
 386/bin/gif - 775 sys sys 1108960006 158063
 386/bin/grap - 775 sys sys 1094040086 280301
@@ -1214,55 +1216,56 @@ lib/face/48x48x1/y - 20000000755 sys sys 944941680 0
 lib/face/48x48x1/z - 20000000755 sys sys 944941680 0
 lib/face/48x48x2 - 20000000755 sys sys 944941683 0
 lib/face/48x48x2/.dict - 664 sys sys 1059677865 534
-lib/face/48x48x2/a - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/a - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/a/adb.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/a/andrew.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/b - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/b - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/b/bart.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/b/bwk.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/c - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/c - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/c/ches.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/d - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/d - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/d/dmr.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/d/doug.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/e - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/e - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/e/ehg.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/f - 20000000755 sys sys 944941681 0
-lib/face/48x48x2/g - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/f - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/g - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/g/gerard.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/h - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/h - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/h/hobby.1 - 644 sys sys 944941681 1776
 lib/face/48x48x2/h/howard.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/i - 20000000755 sys sys 944941681 0
-lib/face/48x48x2/j - 20000000755 sys sys 944941681 0
+lib/face/48x48x2/i - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/j - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/j/judy.1 - 644 sys sys 944941681 1776
-lib/face/48x48x2/k - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/k - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/k/kahrs.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/k/ken.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/l - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/m - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/n - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/o - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/p - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/l - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/m - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/n - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/o - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/p - 20000000775 sys sys 1110466178 0
 lib/face/48x48x2/p/pg.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/p/philw.1 - 644 sys sys 944941682 1776
+lib/face/48x48x2/p/pjw+9ball.2 - 664 sys sys 1110466179 1776
 lib/face/48x48x2/p/pjw.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/p/presotto.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/q - 20000000755 sys sys 944941682 0
-lib/face/48x48x2/r - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/q - 20000000775 sys sys 1020895709 0
+lib/face/48x48x2/r - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/r/rob.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/s - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/s - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/s/sean.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/s/seanq.1 - 644 sys sys 944941682 1776
-lib/face/48x48x2/t - 20000000755 sys sys 944941682 0
+lib/face/48x48x2/t - 20000000775 sys sys 1039727283 0
 lib/face/48x48x2/t/td.1 - 644 sys sys 944941682 1776
 lib/face/48x48x2/t/tom.1 - 644 sys sys 944941683 1776
-lib/face/48x48x2/u - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/v - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/w - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/x - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/y - 20000000755 sys sys 944941683 0
-lib/face/48x48x2/z - 20000000755 sys sys 944941683 0
+lib/face/48x48x2/u - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/v - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/w - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/x - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/y - 20000000775 sys sys 1020895710 0
+lib/face/48x48x2/z - 20000000775 sys sys 1020895710 0
 lib/face/48x48x4 - 20000000775 sys sys 944941894 0
 lib/face/48x48x4/.dict - 664 sys sys 1103981657 2530
 lib/face/48x48x4/Z - 20000000775 sys sys 944945342 0
@@ -11307,7 +11310,8 @@ sys/src/games/mahjongg/level.c - 644 sys sys 1095792293 2522
 sys/src/games/mahjongg/mahjongg.c - 644 sys sys 1095792293 3452
 sys/src/games/mahjongg/mahjongg.h - 644 sys sys 1095792293 1606
 sys/src/games/mahjongg/mkfile - 644 sys sys 1095792293 230
-sys/src/games/mkfile - 664 sys sys 1108184131 526
+sys/src/games/memo.c - 644 sys sys 1110436470 6837
+sys/src/games/mkfile - 664 sys sys 1110435498 533
 sys/src/games/music - 20000000775 sys sys 1103793915 0
 sys/src/games/music/Readme - 664 sys sys 1103793914 488
 sys/src/games/music/debug.h - 664 sys sys 1103793914 201
@@ -12441,7 +12445,7 @@ sys/src/libventi/session.h - 664 sys sys 1063853749 936
 sys/src/libventi/strdup.c - 664 sys sys 1045502096 203
 sys/src/libventi/venti.txt - 664 sys sys 1045502097 4347
 sys/src/libventi/zero.c - 664 sys sys 1045502097 1509
-sys/src/mkfile - 664 sys sys 1073061130 1006
+sys/src/mkfile - 664 sys sys 1110437421 1005
 sys/src/mkfile.proto - 664 sys sys 1105121349 265
 tmp - 20000000555 sys sys 953999902 0
 usr - 20000000775 sys sys 953406542 0

+ 35 - 0
dist/replica/plan9.log

@@ -13869,3 +13869,38 @@
 1110290499 0 c sys/src/cmd/unix/README - 664 sys sys 1110289527 746
 1110290499 1 c sys/src/cmd/unix/sam/README - 664 sys sys 1110289373 306
 1110310304 0 c sys/games/lib/fortunes - 664 sys sys 1110309055 253240
+1110436213 0 a sys/src/games/memo.c - 644 sys sys 1110436470 6837
+1110436213 1 c sys/src/games/mkfile - 664 sys sys 1110435498 533
+1110438013 0 c sys/src/mkfile - 664 sys sys 1110437421 1005
+1110466819 0 m lib/face/48x48x2/a - 20000000775 sys sys 1039727283 0
+1110466819 1 m lib/face/48x48x2/b - 20000000775 sys sys 1039727283 0
+1110466819 2 m lib/face/48x48x2/c - 20000000775 sys sys 1039727283 0
+1110466819 3 m lib/face/48x48x2/d - 20000000775 sys sys 1039727283 0
+1110466819 4 m lib/face/48x48x2/e - 20000000775 sys sys 1039727283 0
+1110466819 5 m lib/face/48x48x2/f - 20000000775 sys sys 1020895709 0
+1110466819 6 m lib/face/48x48x2/g - 20000000775 sys sys 1039727283 0
+1110466819 7 m lib/face/48x48x2/h - 20000000775 sys sys 1039727283 0
+1110466819 8 m lib/face/48x48x2/i - 20000000775 sys sys 1020895709 0
+1110466819 9 m lib/face/48x48x2/j - 20000000775 sys sys 1039727283 0
+1110466819 10 m lib/face/48x48x2/k - 20000000775 sys sys 1039727283 0
+1110466819 11 m lib/face/48x48x2/l - 20000000775 sys sys 1020895709 0
+1110466819 12 m lib/face/48x48x2/m - 20000000775 sys sys 1020895709 0
+1110466819 13 m lib/face/48x48x2/n - 20000000775 sys sys 1020895709 0
+1110466819 14 m lib/face/48x48x2/o - 20000000775 sys sys 1020895709 0
+1110466819 15 m lib/face/48x48x2/p - 20000000775 sys sys 1110466178 0
+1110466819 16 a lib/face/48x48x2/p/pjw+9ball.2 - 664 sys sys 1110466179 1776
+1110466819 17 m lib/face/48x48x2/q - 20000000775 sys sys 1020895709 0
+1110466819 18 m lib/face/48x48x2/r - 20000000775 sys sys 1039727283 0
+1110466819 19 m lib/face/48x48x2/s - 20000000775 sys sys 1039727283 0
+1110466819 20 m lib/face/48x48x2/t - 20000000775 sys sys 1039727283 0
+1110466819 21 m lib/face/48x48x2/u - 20000000775 sys sys 1020895710 0
+1110466819 22 m lib/face/48x48x2/v - 20000000775 sys sys 1020895710 0
+1110466819 23 m lib/face/48x48x2/w - 20000000775 sys sys 1020895710 0
+1110466819 24 m lib/face/48x48x2/x - 20000000775 sys sys 1020895710 0
+1110466819 25 m lib/face/48x48x2/y - 20000000775 sys sys 1020895710 0
+1110466819 26 m lib/face/48x48x2/z - 20000000775 sys sys 1020895710 0
+1110515430 0 a 386/bin/games/catclock - 775 sys sys 1110513961 140798
+1110515430 1 c 386/bin/games/juggle - 775 sys sys 1110513961 125201
+1110515430 2 c 386/bin/games/mahjongg - 775 sys sys 1110513961 163488
+1110515430 3 a 386/bin/games/memo - 775 sys sys 1110513962 156565
+1110515430 4 c 386/bin/games/sokoban - 775 sys sys 1110513962 163480

+ 48 - 0
lib/face/48x48x2/p/pjw+9ball.2

@@ -0,0 +1,48 @@
+0x00000000, 0x06ea6640, 0x00000000, 
+0x00000000, 0x2fbaeea8, 0x00000000, 
+0x00000000, 0xebeaabee, 0x90000000, 
+0x00000002, 0xaebaabab, 0xa9000000, 
+0x00000006, 0xa6aeeafa, 0xba400000, 
+0x0000000a, 0x9016beee, 0xae901000, 
+0x00000009, 0x00005aba, 0xbbfa9000, 
+0x00000024, 0x000006ef, 0xaeef9000, 
+0x00000090, 0x000001ae, 0xfaeea900, 
+0x00000240, 0x000000aa, 0xefbef900, 
+0x00000a40, 0x000000ae, 0xbbbaaa50, 
+0x00003a00, 0x0000007a, 0xefbbea90, 
+0x0000a900, 0x0000001f, 0xffffaea0, 
+0x0001a800, 0x0000001b, 0xefbffaa4, 
+0x0002f900, 0x01aaa907, 0xbffbeea4, 
+0x000be800, 0x6eebbbf9, 0xfbffffe4, 
+0x001ee402, 0xaaaaaeef, 0xaffffea0, 
+0x003fe41e, 0xeaaeebbb, 0xfbfffba0, 
+0x00beeaba, 0xaaeabaef, 0xbfffefe0, 
+0x00fbaeda, 0xaaabaeee, 0xffffffa0, 
+0x02ffba00, 0xabaebbbb, 0xfffffee0, 
+0x02fbf800, 0x1daaeaef, 0xffffffe0, 
+0x03bfe010, 0x05aeafbe, 0xfffffee4, 
+0x03bfd014, 0x006bbaef, 0xffffff90, 
+0x02be8108, 0x01aeefbe, 0xffffffc0, 
+0x02bf8414, 0x03bbbafb, 0xffffee80, 
+0x009e4518, 0x07aeefef, 0xffffbf40, 
+0x009b4664, 0x06eeeeff, 0xffffe500, 
+0x00024020, 0x07bbbfef, 0xffffa400, 
+0x00018460, 0x0eeffbbf, 0xffffa400, 
+0x00009090, 0x1fbeefff, 0xffff4000, 
+0x0006d541, 0x7efbffff, 0xfffe4000, 
+0x000be555, 0xbbefffff, 0xfffe5000, 
+0x0007f956, 0xefbfffff, 0xfffea400, 
+0x0001ffbf, 0xffffffff, 0xfffbf400, 
+0x0002bfff, 0xffffffff, 0xffffe000, 
+0x0001ffff, 0xffffffff, 0xffffd000, 
+0x00007bff, 0xffffffff, 0xffbf8000, 
+0x00001aff, 0xffffffff, 0xff6e4000, 
+0x000004ff, 0xffffffff, 0xfd540000, 
+0x0000006f, 0xffffffff, 0xfad00000, 
+0x0000001b, 0xffffffff, 0xea800000, 
+0x00000001, 0xbffffffe, 0xa5400000, 
+0x00000015, 0x06bffb9a, 0xa8400000, 
+0x00000005, 0x1000566a, 0xb5000000, 
+0x00000005, 0x5566aaba, 0xe4000000, 
+0x00000005, 0x96abaeea, 0xe8400000, 
+0x00000002, 0x5aaaaaab, 0xa8000000, 

+ 394 - 0
sys/src/games/memo.c

@@ -0,0 +1,394 @@
+/* Federico Benavento <benavento@gmail.com> */
+#include <u.h>
+#include <libc.h>
+#include <draw.h>
+#include <event.h>
+
+void eresized(int);
+void resize(int i);
+void afaces(void);
+void allocblocks(void);
+Image *openface(char *path);
+
+Image *face[18];
+Rectangle brect[36];
+char buf[100];
+ushort winflag, level;
+
+typedef enum{
+	ninit,
+	hide,
+	disc
+}bflag;
+
+struct Block
+{
+	ushort nr;
+	ushort nc;
+	bflag flag;
+} block[36];
+
+char *buttons[] =
+{
+	"restart",
+	"easy",
+	"hard",
+	"exit",
+	0
+};
+
+Menu menu =
+{
+	buttons
+};
+
+void
+main(int argc, char *argv[])
+{
+	Mouse m;
+	int i, j;
+	ushort ran, score, attempt, prev, br[2], c[2];
+	char *fmt;
+
+	level=16;
+	fmt = "you win in %d attempts!";
+	ARGBEGIN{
+	default:
+		goto Usage;
+	case 'h':
+		level=36;
+		break;
+	}ARGEND
+	if(argc){
+	Usage:
+		fprint(2, "usage: %s [-h]\n", argv0);
+		exits("usage");
+	}
+	if(initdraw(0,0,"memo") < 0)
+		sysfatal("initdraw failed: %r");
+	srand(time(0));
+	einit(Emouse);
+
+    Start:
+	afaces();
+	winflag=0;
+	prev=level+1;
+	score=attempt=0;
+	for(i=0;i!=level;i++){
+		block[i].nr=i;
+		block[i].nc=20;
+		block[i].flag=ninit;
+	}
+	for(i=0;i!=level/2;i++){
+		for(j=0;j!=2;){
+			ran=rand()%level;
+			if(block[ran].nc==20){
+				block[ran].nc=i;
+				j++;
+			}
+		}
+	}
+	eresized(0);
+	for(;;){
+		m=emouse();
+		if(m.buttons)
+			break;
+	}
+	for(i=0;i!=level;i++)
+		block[i].flag=hide;
+	eresized(0);
+	j=0;
+	for(;; m=emouse()){
+		switch(m.buttons){
+		case 1:
+			while(m.buttons){
+				for(i=0;i!=level;i++){
+					if(i!=prev && ptinrect(m.xy,brect[i])){
+						if(block[i].flag == hide  && j<2){
+							draw(	screen,
+								brect[i],
+								face[block[i].nc],
+								nil,
+								ZP);
+							c[j]=block[i].nc;
+							br[j]=i;
+							j++;
+							prev=i;
+						}
+						break;
+					}
+				}
+				m=emouse();
+			}
+			break;
+		case 4:
+			switch(emenuhit(3, &m, &menu)) {
+				case 0:	/* restart */
+					goto Start;
+					break;
+				case 1:
+					level=16;
+					goto Start;
+					break;
+				case 2:
+					level=36;
+					goto Start;
+					break;
+				case 3:
+					exits(0);
+					break;
+			}
+		}
+		if(j==2){
+			attempt++;
+			prev=level+1;
+			j=0;
+			if(c[0]==c[1]){
+				score++;
+				block[br[0]].flag=disc;
+				block[br[1]].flag=disc;
+				draw(	screen,
+					brect[br[0]],
+					allocimagemix(display,DPalebluegreen,DWhite),
+					nil,
+					ZP);
+				draw(	screen,
+					brect[br[1]],
+					allocimagemix(display,DPalebluegreen,DWhite),
+					nil,
+					ZP);
+			}else{
+				draw(	screen,
+					brect[br[0]],
+					allocimagemix(display, 0x00DDDDFF, 0x00DDDDFF),
+					nil,
+					ZP);
+				draw(	screen,
+					brect[br[1]],
+					allocimagemix(display, 0x00DDDDFF, 0x00DDDDFF),
+					nil,
+					ZP);
+			}
+		}
+		if(score==level/2){
+			winflag=1;
+			sprint(buf, fmt, attempt);
+			eresized(0);
+			for(;;){
+				m=emouse();
+				if((m.buttons & 1) || (m.buttons & 4))
+				break;
+			}
+			goto Start;
+		}
+	}
+}
+
+void
+eresized(int new)
+{
+	ushort i, nx, ny;
+	Point p;
+	Rectangle wr;
+
+	if(new && getwindow(display, Refnone) < 0){
+		fprint(2, "can't reattach to window");
+		exits("resized");
+	}
+
+	allocblocks();
+	draw(screen, screen->r, allocimagemix(display, DPalebluegreen,DWhite), nil, ZP);
+	if(winflag == 1){
+		nx=screen->r.max.x/8;
+		ny=screen->r.max.y/4;
+		wr=Rect(screen->r.min.x+nx,
+			screen->r.min.y+ny,
+			screen->r.max.x-nx,
+			screen->r.max.y-ny);
+		draw(screen, wr, allocimagemix(display, 0x00DDDDFF, 0x00DDDDFF), nil, ZP);
+		p=addpt(wr.min, Pt(5,5));
+		draw(screen,
+		     Rpt(p, addpt(p, stringsize(font,buf))),
+		     allocimagemix(display,0x00DDDDFF,0x00DDDDFFF),
+		     nil,p);
+		string(screen,p,display->black,ZP,font,buf);
+	}else{
+		for(i=0;i!=level;i++){
+			switch(block[i].flag){
+			case ninit:
+				draw(screen,brect[i],face[block[i].nc],nil,ZP);
+				break;
+			case disc:
+				draw(	screen,
+					brect[i],
+					allocimagemix(display,DPalebluegreen,DWhite),
+					nil,
+					ZP);
+				break;
+			case hide:
+				draw(	screen,
+					brect[i],
+					allocimagemix(display, 0x00DDDDFF, 0x00DDDDFF),
+					nil,
+				    	ZP);
+				break;
+			default:
+				fprint(2, "something went wrong!");
+				exits("wrong");
+				break;
+			}
+		}
+	}
+}
+
+char *facepaths[] = {
+	/* logos */
+	"/lib/face/48x48x4/g/glenda.1",
+	"/lib/face/48x48x2/p/pjw+9ball.2",
+	
+	/* /sys/doc/9.ms authors */
+	"/lib/face/48x48x2/k/ken.1",
+	"/lib/face/48x48x4/b/bobf.1",
+	"/lib/face/48x48x4/p/philw.1",
+	"/lib/face/48x48x4/p/presotto.1",
+	"/lib/face/48x48x4/r/rob.1",
+	"/lib/face/48x48x4/s/sean.1",
+	
+	/* additional authors and luminaries for harder levels */
+	"/lib/face/48x48x4/b/bwk.1",
+	"/lib/face/48x48x4/c/cyoung.1",
+	"/lib/face/48x48x4/d/dmr.1",
+	"/lib/face/48x48x4/d/doug.1",
+	"/lib/face/48x48x4/h/howard.1",
+	"/lib/face/48x48x4/j/jmk.1",
+	"/lib/face/48x48x4/s/sape.1",
+	"/lib/face/48x48x4/s/seanq.1",
+	"/lib/face/48x48x4/t/td.1",
+	"/lib/face/48x48x8/l/lucent.1",
+};
+
+void
+afaces(void)
+{
+	int i;
+	
+	for(i=0; i<18; i++)
+		face[i] = openface(facepaths[i]);
+}
+
+void
+allocblocks(void)
+{
+	Rectangle r, b;
+	ushort i, x, y, sq;
+
+	sq=sqrt(level);
+	resize(48*sq+sq*4+17);
+	r=insetrect(screen->r, 5);
+	r=Rect(r.min.x, r.min.y, r.min.x+48*sq+sq*4-1, r.min.y+48*sq+sq*4-1);
+	b.max.y=r.min.y;
+	for(i=level-1, y=0; y!=sq; y++){
+		b.min.y=b.max.y;
+		b.max.y=r.min.y+(r.max.y-r.min.y)*(y+1)/sq;
+		b.max.x=r.min.x;
+		for(x=0; x!=sq; x++, i--){
+			b.min.x=b.max.x;
+			b.max.x=r.min.x+(r.max.x-r.min.x)*(x+1)/sq;
+			brect[i]=insetrect(b, 2 );
+		}
+	}
+}
+
+void
+resize(int i)
+{
+	int fd;
+
+	fd=open("/dev/wctl", OWRITE);
+	if(fd >= 0){
+		fprint(fd, "resize -dx %d -dy %d", i, i);
+		close(fd);
+	}
+}
+
+Image *
+openimage(char *path)
+{
+	Image *i;
+	int fd;
+
+	fd=open(path, OREAD);
+	if(fd < 0)
+		sysfatal("open %s: %r", path);
+	i=readimage(display, fd, 0);
+	if(i == nil)
+		sysfatal("readimage %s: %r", path);
+	close(fd);
+	return i;
+}
+
+enum { Facesize = 48 };
+
+Image*
+readbit(int fd, ulong chan, char *path)
+{
+	char buf[4096], hx[4], *p;
+	uchar data[Facesize*Facesize];	/* more than enough */
+	int nhx, i, n, ndata, nbit;
+	Image *img;
+
+	n = readn(fd, buf, sizeof buf);
+	if(n <= 0)
+		return nil;
+	if(n >= sizeof buf)
+		n = sizeof(buf)-1;
+	buf[n] = '\0';
+
+	n = 0;
+	nhx = 0;
+	nbit = chantodepth(chan);
+	ndata = (Facesize*Facesize*nbit)/8;
+	p = buf;
+	while(n < ndata) {
+		p = strpbrk(p+1, "0123456789abcdefABCDEF");
+		if(p == nil)
+			break;
+		if(p[0] == '0' && p[1] == 'x')
+			continue;
+
+		hx[nhx] = *p;
+		if(++nhx == 2) {
+			hx[nhx] = 0;
+			i = strtoul(hx, 0, 16);
+			data[n++] = ~i;
+			nhx = 0;
+		}
+	}
+	if(n < ndata)
+		sysfatal("short face %s", path);
+
+	img = allocimage(display, Rect(0,0,Facesize,Facesize), chan, 0, 0);
+	if(img == nil)
+		return nil;
+	loadimage(img, img->r, data, ndata);
+	return img;
+}
+
+Image*
+openface(char *path)
+{
+	char *p;
+	int fd, n;
+	
+	p = strstr(path, "48x48x");
+	if(p == nil)
+		return openimage(path);
+	n = atoi(p+6);
+	if(n < 4){
+		if((fd = open(path, OREAD)) < 0)
+			sysfatal("open %s: %r", path);
+		return readbit(fd, n==1 ? GREY1 : GREY2, path);
+	}
+	return openimage(path);
+}
+

+ 1 - 0
sys/src/games/mkfile

@@ -2,6 +2,7 @@
 
 TARG=catclock\
 	juggle\
+	memo\
 
 OFILES=
 HFILES=

+ 1 - 1
sys/src/mkfile

@@ -35,7 +35,7 @@ LIBS=\
 
 
 CMDS=cmd\
-#	games\
+	games\
 
 SUBSYS=ape\
 	/acme\