[q-lang-cvs] qcalc/examples calendar.qcalc,1.6,1.7
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-23 23:47:05
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30904/examples Modified Files: calendar.qcalc Log Message: bugfixes Index: calendar.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/calendar.qcalc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** calendar.qcalc 17 Nov 2007 18:24:57 -0000 1.6 --- calendar.qcalc 23 Nov 2007 23:47:02 -0000 1.7 *************** *** 1,3 **** ! // qcalc 1.0, created Sat Nov 17 19:24:44 2007 -*-Q-*- -*- coding: UTF-8 -*- // [((1,0),"Enter year:"),((2,0),"= spinbox (0,9999,1,today!2)"),((3,0),"= calendar 'A5 A3")] // [] --- 1,3 ---- ! // qcalc 1.0, created Sat Nov 24 00:47:36 2007 -*-Q-*- -*- coding: UTF-8 -*- // [((1,0),"Enter year:"),((2,0),"= spinbox (0,9999,1,today!2)"),((3,0),"= calendar 'A5 A3")] // [] *************** *** 16,20 **** mycal Y = cat $ map (quarter CAL) [0..3] ! where CAL = map (map (fill 7).cal Y) [1..12]; quarter CAL I = zipwith (++) M1 $ zipwith (++) M2 M3 --- 16,20 ---- mycal Y = cat $ map (quarter CAL) [0..3] ! where CAL = map (vfill 9 . map (hfill 7) . cal Y) [1..12]; quarter CAL I = zipwith (++) M1 $ zipwith (++) M2 M3 *************** *** 24,26 **** = [[""|R1],[M|R2]|map (cons "") R]; ! fill N Xs = Xs++map (cst "") [#Xs..N-1]; --- 24,29 ---- = [[""|R1],[M|R2]|map (cons "") R]; ! hfill N Xs = Xs++map (cst "") [#Xs..N-1]; ! ! vfill N Xs = Xs++map (hfill M . cst []) [#Xs..N-1] where M:Int = #hd Xs; ! = Xs otherwise; \ No newline at end of file |