I used this code to create a "logic grid puzzle". See this picture 
(https://en.wikipedia.org/wiki/Logic_puzzle#/media/File:Logic_grid.png) for how 
it should appear.

I'm having trouble getting the grid to show up right, I made a thicker grid 
(1pt) to the right of cols 1, 6, 11, and 16, but when rendering the other 
thinner rules, it creates strange problems, with some cell having thick rules 
on the bottom too.
Additionally, I can't figure how to make the stair-step effect by turning off 
the borders of some cells. I can't find any instructions in the manual fro how 
to specify specific cells or a range of cells that won't be getting borders.
Any suggestions how to make it look like the table in the picture?
--Joel

\starttext
\startsetups[logicGrid]
    \setupTABLE[topframe=off, bottomframe=off, leftframe=off, rightframe=off]
  \setupTABLE[r][1][height=1in]
  \setupTABLE[c][1][leftframe=off,rightframe=off,width=1in,align={middle,right}]
  \setupTABLE[c][each][align={middle,center},height=0.25in,width=0.25in]
  \setupTABLE[c][2:16][align={middle,center}]
  \setupTABLE[r][each][align={middle,center}]
  \setupTABLE[c][1,6,11,16][rightframe=on, rulethickness=1pt]
  \setupTABLE[c][2,3,4,5,7,8,9,10,12,13,14,15][rightframe=on, 
rulethickness=.5pt]
  \setupTABLE[r][1,6,11,16][bottomframe=on, rulethickness=1pt]
  \setupTABLE[r][2,3,4,5,7,8,9,10,12,13,14,15][bottomframe=on, 
rulethickness=.5pt]
\stopsetups

\setvalue{topLabel1}{Red}
\setvalue{topLabel2}{Yellow}
\setvalue{topLabel3}{Green}
\setvalue{topLabel4}{Blue}
\setvalue{topLabel5}{12}
\setvalue{topLabel6}{15}
\setvalue{topLabel7}{18}
\setvalue{topLabel8}{21}
\setvalue{topLabel9}{Marmite}
\setvalue{topLabel10}{Honey}
\setvalue{topLabel11}{Jam}
\setvalue{topLabel12}{Marmalade}
\setvalue{topLabel13}{Extra1}
\setvalue{topLabel14}{Extra2}
\setvalue{topLabel15}{Extra3}

\setvalue{sideLabel1}{Peter}
\setvalue{sideLabel2}{Jane}
\setvalue{sideLabel3}{Simon}
\setvalue{sideLabel4}{Alice}
\setvalue{sideLabel5}{Marmite}
\setvalue{sideLabel6}{Honey}
\setvalue{sideLabel7}{Marmalade}
\setvalue{sideLabel8}{Jam}
\setvalue{sideLabel9}{Label9}
\setvalue{sideLabel10}{Label10}
\setvalue{sideLabel11}{Label11}
\setvalue{sideLabel12}{Label12}
\setvalue{sideLabel13}{Label13}
\setvalue{sideLabel14}{Label14}
\setvalue{sideLabel15}{Label15}

\bTABLE[setups=logicGrid]
  % Top labels
  \bTR
    \bTD \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel1}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel2}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel3}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel4}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel5}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel6}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel7}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel8}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel9}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel10}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel11}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel12}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel13}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel14}} \eTD
    \bTD \rotate[rotation=-90]{\getvalue{topLabel15}} \eTD
  \eTR
  % Side labels and grid rows
  \bTR
    \bTD[left] \getvalue{sideLabel1} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel2} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel3} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel4} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel5} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel6} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel7} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel8} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel9} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel10} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel11} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel12} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel13} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel14} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
  \bTR
    \bTD[left] \getvalue{sideLabel15} \eTD
    \dorecurse{15}{\bTD \emptylines[1] \eTD}
  \eTR
\eTABLE

\stoptext


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to