Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Vanguard Chess. Game on 16x16 board, with 48 pieces per player. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Sat, Nov 18, 2023 02:59 PM UTC in reply to Fergus Duniho from 02:43 PM:

In showpiece.php, I am using this code:

$ua = getenv("HTTP_USER_AGENT");
$eink = preg_match("/(kindle|likebook|meebook|boox|onyx|pocketbook|inkpad)/i", $ua);

I know "kindle" and "likebook" work, and the others are just guesses based on brand and product names.

Nice, but that is server side in PHP. The client machine (from the TCP/IP request header) there apparently is stored in an environment variable before Apache invokes the PHP interpreter, so the PHP program can fetch it with getenv().

But the JavaScript is running client side, and does not have access to the server environment variables. If there was a JavaScript method for identifying the machine it runs on, that would be usable.