有哪些适合非国际象棋且更接近黑白棋的棋盘游戏的软件包?

有哪些适合非国际象棋且更接近黑白棋的棋盘游戏的软件包?

我想排版一款(从视觉上来说)更接近奥赛罗的棋盘游戏 --- 因为它使用圆形棋子。包黑白棋盘几乎完美。我主要担心的是我需要一块不同的板。我需要的板不包含角,举一个不同点,这几乎是唯一的不同点:只需移除角即可。但还有一个不同点:第一行和最后一行以及文件应该与 6x6 内板稍微分离一点。(这不如移除角重要。)

所以我正在寻找一个包,让我可以选择哪些方块属于棋盘,同时也让我将等级和行按小距离分开,以创建这种视觉分离。

我认为对我来说最理想的做法是改变黑白棋盘包装,以便我可以重新设计电路板,并对“内 6x6 电路板”的“外环”应用分离。因为对于我需要的其他一切,黑白棋盘看起来很完美。

有没有一个包可以完美满足这个要求,或者我真的应该使用 othelloboard 并更改其源代码来满足我的需求?谢谢。

答案1

下面的 MWE 显示了对othelloboard封装的修改,即删除角字段并用粗线将外部行和列与内部 6x6 板分开。

我选择不改变外面行和列的实际位置,因为那将需要完全重写包中与在特定坐标处绘图有关的所有内容(这将导致大量的更改)。

othelloboard除了网格绘制之外,还需要更改两个环境othelloboardnorefs,因为原始定义在板的周围绘制了一个框架(这实际上是不必要的,因为外线也是在网格中绘制的)。

梅威瑟:

\documentclass{article}
\usepackage{othelloboard}

% redefinition to remove frame around board
\renewenvironment{othelloboard}[1]%
{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid \gridrefs}
{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(208,208)(-16,0) \usebox{\fmboard} \end{picture}}}

\renewenvironment{othelloboardnorefs}[1]%
{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid}
{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(192,192)(0,0) \usebox{\fmboard} \end{picture}}}

% redefinition of grid
\renewcommand{\othellogrid}{%
% outside lines, shorter to cut off corners
\begingroup % start of \linethickness scope
\linethickness{0.8mm}
\put(0,24){\line(0,1){144}}   % bottom left to top left
\put(192,24){\line(0,1){144}} % top right to bottom right
\put(24,0){\line(1,0){144}}   % bottom left to bottom right
\put(24,192){\line(1,0){144}} % top left to top right
% inside lines
% lines around the 6x6 inner board
\put(24,0){\line(0,1){192}}
\put(168,0){\line(0,1){192}}
\put(0,24){\line(1,0){192}}
\put(0,168){\line(1,0){192}}
\endgroup % end of \linethickness scope
% other inner lines
\put(48,0){\line(0,1){192}}
\put(72,0){\line(0,1){192}}
\put(96,0){\line(0,1){192}}
\put(120,0){\line(0,1){192}}
\put(144,0){\line(0,1){192}}
\put(0,48){\line(1,0){192}}
\put(0,72){\line(1,0){192}}
\put(0,96){\line(1,0){192}}
\put(0,120){\line(1,0){192}}
\put(0,144){\line(1,0){192}}
}

\begin{document}
\begin{othelloboard}{1}
\othelloarrayfirstrow   {0}{0}{0}{0}{0}{0}{0}{0}
\othelloarraysecondrow  {0}{0}{2}{0}{0}{0}{0}{0}
\othelloarraythirdrow   {0}{1}{2}{2}{2}{0}{0}{0}
\othelloarrayfourthrow  {0}{1}{2}{1}{2}{1}{0}{0}
\othelloarrayfifthrow   {0}{0}{2}{2}{1}{1}{0}{0}
\othelloarraysixthrow   {0}{0}{2}{1}{1}{1}{0}{0}
\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
\othelloarrayeighthrow  {0}{0}{0}{0}{0}{0}{0}{0}
\end{othelloboard}
\end{document}

结果:

在此处输入图片描述


编辑:可以使用宽度和高度规则打印填充的正方形24pt。使用双 for 循环(例如使用包forloop),您可以绘制棋盘。要将内板与外部行和列分开(粗线在棋盘正方形中很难看到),您可以在内方块周围绘制一个灰色矩形。

梅威瑟:

\documentclass{article}
\usepackage{othelloboard}
\usepackage{forloop}
\usepackage{xcolor}

% redefinition to remove frame around board
\renewenvironment{othelloboard}[1]%
{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid \gridrefs}
{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(208,208)(-16,0) \usebox{\fmboard} \end{picture}}}

\renewenvironment{othelloboardnorefs}[1]%
{\renewcommand{\scalefactor}{#1} \begin{lrbox}{\fmboard}\begin{picture}(192,192)\resetalldisccolours \othellogrid}
{\end{picture} \end{lrbox} \scalebox{\scalefactor}{\begin{picture}(192,192)(0,0) \usebox{\fmboard} \end{picture}}}

% some variables for checkered board loops
\newcounter{xsquare}
\newcounter{ysquare}
\newcounter{shiftsquare}
\newcounter{skipsquare}

% redefinition of grid
\renewcommand{\othellogrid}{%
% outside lines, shorter to cut off corners
\begingroup % start of \linethickness scope
\linethickness{0.8mm}
\put(0,24){\line(0,1){144}}   % bottom left to top left
\put(192,24){\line(0,1){144}} % top right to bottom right
\put(24,0){\line(1,0){144}}   % bottom left to bottom right
\put(24,192){\line(1,0){144}} % top left to top right
% inside lines
\put(24,0){\line(0,1){192}}
\put(168,0){\line(0,1){192}}
\put(0,24){\line(1,0){192}}
\put(0,168){\line(1,0){192}}
\endgroup % end of \linethickness scope
\put(48,0){\line(0,1){192}}
\put(72,0){\line(0,1){192}}
\put(96,0){\line(0,1){192}}
\put(120,0){\line(0,1){192}}
\put(144,0){\line(0,1){192}}
\put(0,48){\line(1,0){192}}
\put(0,72){\line(1,0){192}}
\put(0,96){\line(1,0){192}}
\put(0,120){\line(1,0){192}}
\put(0,144){\line(1,0){192}}
%
% double for loop for checkered board
% loop rows
\forloop[24]{ysquare}{0}{\value{ysquare}<192}{%
% shift or shift back one square after every row
\ifnum\value{shiftsquare}=0\setcounter{shiftsquare}{24}\else\setcounter{shiftsquare}{0}\fi
% loop columns
\forloop[48]{xsquare}{\value{shiftsquare}}{\value{xsquare}<192}{%
% check for skipping corners
\setcounter{skipsquare}{0}
% bottom right corner
\ifnum\value{ysquare}=0\ifnum\value{xsquare}=168%
\setcounter{skipsquare}{1}\fi\fi
% top left corner
\ifnum\value{ysquare}=168\ifnum\value{xsquare}=0%
\setcounter{skipsquare}{1}\fi\fi
% draw black square if not one of the two corners
\ifnum\value{skipsquare}=0%
\put(\thexsquare,\theysquare){\rule{24pt}{24pt}}%
\fi
}% end loop columns
}% end loop rows
% gray frame around inner board
\begingroup
\color{gray}
\linethickness{1.2mm}
\put(24,24){\line(0,1){144}}
\put(168,24){\line(0,1){144}}
\put(24,24){\line(1,0){144}}
\put(24,168){\line(1,0){144}}
\endgroup
}

\begin{document}
\begin{othelloboard}{1}
\othelloarrayfirstrow   {0}{0}{0}{0}{0}{0}{0}{0}
\othelloarraysecondrow  {0}{0}{2}{0}{0}{0}{0}{0}
\othelloarraythirdrow   {0}{1}{2}{2}{2}{0}{0}{0}
\othelloarrayfourthrow  {0}{1}{2}{1}{2}{1}{0}{0}
\othelloarrayfifthrow   {0}{0}{2}{2}{1}{1}{0}{0}
\othelloarraysixthrow   {0}{0}{2}{1}{1}{1}{0}{0}
\othelloarrayseventhrow {0}{0}{0}{0}{0}{0}{0}{0}
\othelloarrayeighthrow  {0}{0}{0}{0}{0}{0}{0}{0}
\end{othelloboard}
\end{document}

结果:

在此处输入图片描述

如果您还想将棋子放在黑色方块上,那么您可以修改用于绘制棋子(\blackdisc\whitedisc)的代码,以使用纯黑色和白色以外的颜色。下面我使用了深灰色和灰白色,并在棋子周围画了两个圆圈。

\definecolor{offwhite}{RGB}{255,255,244}
\definecolor{dimgray}{RGB}{42,42,42}
\renewcommand{\blackdisc}{\linethickness{0.5mm}\color{dimgray}\circle*{19}\color{gray}\circle{19.4}\linethickness{0.2mm}\circle{15}}
\renewcommand{\whitedisc}{\linethickness{0.5mm}\color{offwhite}\circle*{19}\color{gray}\circle{19.4}\linethickness{0.2mm}\circle{15}}

在此处输入图片描述

相关内容