🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10176

Help! Struggling with TeX.

#10176
From: Piet Tutelaers
Date: Sun, 09 Jun 1991 18:18
36 lines
1505 bytes
I am struggling with the following TeX-problem: `\king' is the internal
code for the character denoting a `White king' and `\next' a character
possible being that king, the Black king (lower case value of
`\king') or another character. How does one compare the value of \king
with that of \next? I do see two approaches:

1) convert the value of \king into a \char
   \chardef\king=`K
   \let\next=k

   \def\ucking{\char\king}
   \def\lcking{\char\lccode\king}

   \if\next\ucking\message{White king}\else
   \if\next\lcking\message{Black king}\else
      \message{another piece or square}
   \fi\fi
   \bye

2) convert \next into internal value via \chardef
   \chardef\king=`K
   \let\next=k
   
   \chardef\square=`\next
   \ifnum\square=\king\message{White king}\else
   \ifnum\square=\lccode\king\message{Black king}\else
      \message{another piece or square}
   \fi\fi
   \bye

Both solutions fail. The first because the \if-tests fail, the second
because the `\next is not allowed for a \chardef (Improper apphabetic
constant). I hope somebody can show me a REAL solution.

--Piet 
Technical Details
Message-ID: <641@rc6.urc.tue.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!tuegate.tue.nl!rc6.urc.tue.nl!rw9.urc.tue.nl!rcpt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!tuegate.tue.nl!rc6.urc.tue.nl!rw9.urc.tue.nl!rcpt
From: rcpt@rw9.urc.tue.nl (Piet Tutelaers)
Newsgroups: comp.text.tex
Subject: Help! Struggling with TeX.
Message-ID: <641@rc6.urc.tue.nl>
Date: 9 Jun 91 18:18:37 GMT
Sender: news@rc6.urc.tue.nl
Reply-To: rcpt@urc.tue.nl
Lines: 36