Difference between revisions of "Template:Sudoku"
From Organic Design wiki
m |
(doh wikipedia already have a sudoku template) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <table border | + | <!-- Sudoku grid display |
− | + | Usage: | |
− | + | {{templateName| | |
− | + | align=side table alignment. left & right flow text. Defa:right | |
− | + | title=title Text table title, Defa: Sudoku 9x9 | |
− | + | tstyle=title style title style body, for style="tstyle", Defa: blank | |
− | + | bgcolor=color| main background color, defa: fcfcc8 | |
− | + | bc=BoxBorderColor| major table grid and outer border | |
− | + | bx=BoxBorderWidth| defa: 1.5pt, displays as 2xWidth | |
− | + | b1c=color|b2c...| background color for boxes 1..9, defa=bgcolor | |
− | + | gc=GridColor| minor box grid, defa: silver | |
− | + | gx=GridWidth| defa: 1.5pt | |
− | < | + | cellsize=size| cell size, defa: 30pt, the min. for square cells |
+ | s1..s81| 81 cell square values, defa: blank | ||
+ | c1..81...| cell background color, defa: bNc or bgcolor | ||
+ | }} | ||
+ | |||
+ | Does: Displays a Sudoku Grid, with supplied values. | ||
+ | |||
+ | Args: None required, all have default values. | ||
+ | |||
+ | Template Call Tree does and calls next | ||
+ | Sudoku 9x9 grid top wrapper, set defa values | ||
+ | Sudoku 9x9 table table with 9 boxes, 81 cells, major grids, outer border | ||
+ | Sudoku 3x3 box 3x3 box 9 cells | ||
+ | Sudoku 3x3 table 3x3 table with 9 cells, int. grids only, no outer border | ||
+ | |||
+ | Implementation Notes: (yes I am a compulsive newbie..} | ||
+ | |tparm={{{parm}}}| parameter assignments must have a default value | ||
+ | otherwise the target tparm gets the literal text "{{{parm}}}" | ||
+ | when parm is undefined. I.e. | ||
+ | There is no way to pass on a param and have it be undefined | ||
+ | in the called template. | ||
+ | {{{parm|}}} is sufficient and creates an empty param, | ||
+ | which is not detected by subsequent {{{parm|}}} test as undef. | ||
+ | It's not possible to pass (in) an undefined numbered arg. | ||
+ | || passes a defined, but empty value, which cannot be detected and | ||
+ | translated to a blank value. | ||
+ | The cell values cannot be empty, else the cell grid borders don't show. | ||
+ | Use as default. | ||
+ | |||
+ | See [[Template:Sudoku 9x9 table]] and | ||
+ | [[Template:Sudoku 3x3 table]] for table trivia | ||
+ | Modeled after [[Template:4x4 type square]] | ||
+ | Orig: LarryLACa 11/4/05 | ||
+ | |||
+ | This comment must cuddle next template call to avoid introducing nl whitespace in output, | ||
+ | -->{{Sudoku 9x9 table|= | ||
+ | |{{{s1| }}}|{{{s2| }}}|{{{s3| }}}|{{{s4| }}}|{{{s5| }}}|= | ||
+ | |{{{s6| }}}|{{{s7| }}}|{{{s8| }}}|{{{s9| }}}|= | ||
+ | |{{{s10| }}}|{{{s11| }}}|{{{s12| }}}|{{{s13| }}}|{{{s14| }}}|= | ||
+ | |{{{s15| }}}|{{{s16| }}}|{{{s17| }}}|{{{s18| }}}|= | ||
+ | |{{{s19| }}}|{{{s20| }}}|{{{s21| }}}|{{{s22| }}}|{{{s23| }}}|= | ||
+ | |{{{s24| }}}|{{{s25| }}}|{{{s26| }}}|{{{s27| }}}|= | ||
+ | |{{{s28| }}}|{{{s29| }}}|{{{s30| }}}|{{{s31| }}}|{{{s32| }}}|= | ||
+ | |{{{s33| }}}|{{{s34| }}}|{{{s35| }}}|{{{s36| }}}|= | ||
+ | |{{{s37| }}}|{{{s38| }}}|{{{s39| }}}|{{{s40| }}}|{{{s41| }}}|= | ||
+ | |{{{s42| }}}|{{{s43| }}}|{{{s44| }}}|{{{s45| }}}|= | ||
+ | |{{{s46| }}}|{{{s47| }}}|{{{s48| }}}|{{{s49| }}}|{{{s50| }}}|= | ||
+ | |{{{s51| }}}|{{{s52| }}}|{{{s53| }}}|{{{s54| }}}|= | ||
+ | |{{{s55| }}}|{{{s56| }}}|{{{s57| }}}|{{{s58| }}}|{{{s59| }}}|= | ||
+ | |{{{s60| }}}|{{{s61| }}}|{{{s62| }}}|{{{s63| }}}|= | ||
+ | |{{{s64| }}}|{{{s65| }}}|{{{s66| }}}|{{{s67| }}}|{{{s68| }}}|= | ||
+ | |{{{s69| }}}|{{{s70| }}}|{{{s71| }}}|{{{s72| }}}|= | ||
+ | |{{{s73| }}}|{{{s74| }}}|{{{s75| }}}|{{{s76| }}}|{{{s77| }}}|= | ||
+ | |{{{s78| }}}|{{{s79| }}}|{{{s80| }}}|{{{s81| }}}|= | ||
+ | |c1={{{c1|}}}|c2={{{c2|}}}|c3={{{c3|}}}|c4={{{c4|}}}|c5={{{c5|}}}|c6={{{c6|}}}|c7={{{c7|}}}|c8={{{c8|}}}|c9={{{c9|}}}|= | ||
+ | |c10={{{c10|}}}|c11={{{c11|}}}|c12={{{c12|}}}|c13={{{c13|}}}|c14={{{c14|}}}|c15={{{c15|}}}|c16={{{c16|}}}|c17={{{c17|}}}|c18={{{c18|}}}|= | ||
+ | |c19={{{c19|}}}|c20={{{c20|}}}|c21={{{c21|}}}|c22={{{c22|}}}|c23={{{c23|}}}|c24={{{c24|}}}|c25={{{c25|}}}|c26={{{c26|}}}|c27={{{c27|}}}|= | ||
+ | |c28={{{c28|}}}|c29={{{c29|}}}|c30={{{c30|}}}|c31={{{c31|}}}|c32={{{c32|}}}|c33={{{c33|}}}|c34={{{c34|}}}|c35={{{c35|}}}|c36={{{c36|}}}|= | ||
+ | |c37={{{c37|}}}|c38={{{c38|}}}|c39={{{c39|}}}|c40={{{c40|}}}|c41={{{c41|}}}|c42={{{c42|}}}|c43={{{c43|}}}|c44={{{c44|}}}|c45={{{c45|}}}|= | ||
+ | |c46={{{c46|}}}|c47={{{c47|}}}|c48={{{c48|}}}|c49={{{c49|}}}|c50={{{c50|}}}|c51={{{c51|}}}|c52={{{c52|}}}|c53={{{c53|}}}|c54={{{c54|}}}|= | ||
+ | |c55={{{c55|}}}|c56={{{c56|}}}|c57={{{c57|}}}|c58={{{c58|}}}|c59={{{c59|}}}|c60={{{c60|}}}|c61={{{c61|}}}|c62={{{c62|}}}|c63={{{c63|}}}|= | ||
+ | |c64={{{c64|}}}|c65={{{c65|}}}|c66={{{c66|}}}|c67={{{c67|}}}|c68={{{c68|}}}|c69={{{c69|}}}|c70={{{c70|}}}|c71={{{c71|}}}|c72={{{c72|}}}|= | ||
+ | |c73={{{c73|}}}|c74={{{c74|}}}|c75={{{c75|}}}|c76={{{c76|}}}|c77={{{c77|}}}|c78={{{c78|}}}|c79={{{c79|}}}|c80={{{c80|}}}|c81={{{c81|}}}|= | ||
+ | |bc={{{bc|black}}}|bx={{{bx|1.5pt}}}|gc={{{gc|silver}}}|gx={{{gx|1.5pt}}}|= | ||
+ | |bgcolor={{{bgcolor|fcfcc8}}}|cellsize={{{cellsize|12pt}}}|= | ||
+ | |align={{{align|right}}}|title={{{title|Sudoku 9x9}}}|tstyle={{{tstyle|}}}|= | ||
+ | |b1c={{{b1c|}}}|b2c={{{b2c|}}}|b3c={{{b3c|}}}|b4c={{{b4c|}}}|b5c={{{b5c|}}}|= | ||
+ | |b6c={{{b6c|}}}|b7c={{{b7c|}}}|b8c={{{b8c|}}}|b9c={{{b9c|}}}|= | ||
+ | }}<noinclude>[[id:Template:Sudoku 9x9 grid]]</noinclude> |
Latest revision as of 07:10, 13 August 2007
|
|
| |||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||
|
|
|