Author Topic: Chess for Ti-Nspire CX  (Read 22006 times)

0 Members and 1 Guest are viewing this topic.

Offline renatose

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 209
  • Rating: +4/-0
  • watch out the power balls
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #30 on: November 01, 2012, 07:35:01 pm »
I am looking into creating a chess game for ndless. There are plenty of tutorials around on the web, so I think I can do this ;D
I've just spotted the source code for a simple chess game written in C/SDL, here: . Do you think it can help? Go ahead and do it! Cheers.'Ik zal wachten' ;)

The website says "There's no AI" ;)
It could be integrated with gnuchess to have an AI...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: Chess for Ti-Nspire CX
« Reply #31 on: November 01, 2012, 09:33:40 pm »
With juju and co trying to bring internets to the Nspire CX, maybe at one point if someone starts a Chess clone there could be online play? O.O It might be complicated if the project is being worked on by a newer coder, though.
Dream of Omnimaga

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Chess for Ti-Nspire CX
« Reply #32 on: November 02, 2012, 03:40:48 am »
With the Linux port, a male mini-A <-> female A cable, possibly a powered USB hub, and a cheap USB network adapter, I'm positive it's possible to just port an existing chess program with online playing capability ;)
GNU Chess is one of the programs that buildroot directly supports (even if it weren't, it's easy to use the toolchain built by buildroot), and according to its manual ( ) it can be networked to the Internet through an auxiliary program.

On a platform, when a usable port of Linux becomes available, it radically changes the landscape. Billions of lines of portable open source code suddenly become available for reuse. Many programs work out of the box, while others need some effort (e.g. to cope with a low resolution screen, if possible). In normal markets (those which are not completely biased by stupid testing regulators, into closed platforms made of years-old technologies sold to the consumer at extremely high price tags), the value in providing open-minded systems is tremendous.
ARM completely owns the mobile space, clearly largely thanks to Linux. iP* are the main exception to that rule, but as far as smartphones are concerned, they now represent a minority of new purchases, and the lackluster new iP* will probably worsen the trend for Apple.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline wurm

  • LV0 Newcomer (Next: 5)
  • Posts: 1
  • Rating: +0/-0
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #33 on: December 29, 2023, 03:41:06 pm »
Hello everybody,
Seeing as this topic has not been discussed since 2012 (!!!) I have rather limited hopes of receiving any feedback on this, yet I would still like to share what I have to say.
About a quarter year ago, I had a cold which kept me out of school for a week and left me quite bored. Out of this boredom I decided to learn how to code and write a little chess engine for my calculator, as to make my maths classes a little more interesting. Little did I know this would haunt me for such a long time. So here are my insights into chess on a calculator.

First Version was written in Python (as the TI-Nspire CX II-T natively supports that) and took ~2 Weeks to complete. Speed: Absolutely unplayable at around 20 Nodes per second searched. (10000 nps on my pc) -> Python (ON A CALCULATOR) is definitely not the way to go for speed. Especially considering the TI python interpreters unhinged slowness. I assume the same applies for TI-Basic, have not tried that tho.
For the second version I discovered the wonderous world of ndless and learned c++. After some experimenting with movegeneration techniques this seemed much more promising, beeing able to generate and evaluate ~20 kN/s on the calculator. Factoring in that this is with a very amateurishly written program which does around 8 MN/s on my pc that is quite alright.
As this was a major point of discussion here, I'd like to quickly get into the relevance of performance in chess programs. Due to the huge number of possible positions, brute-forcing your way to a checkmate is very computationally demanding and CPU is not in fact "not really the problem"! Given good enough search optimization one can get away with quite low speeds, but a certain baseline is absolutely necessary. The 200nps of the cited TI-Chess engine are not really in that range, with the limited ressources it's operating with it's an incredibly impressive piece of code nontheless!!
After letting my half finished program rott for a while, I took up working on it again lately and managed to massively improve it. Inspired by Daniel Infuehr's "Gigantua" Movegenerator, the program is now capable of generating ~1.8GN/s (yes that is 1.8 Billion nodes per second) on my PC. This is without evaluation mind you. This figure shrinks to a respectable 2MN/s on the calculator. This is very probably due to the calculator not having the PEXT instruction, which plays a key part in generating the sliding piece moves. This could be fixed in the future through the use of Magic Bitboards (
In a very quick and dirty fashion I then added a search algorithm to the movegenerator, leaving a lot of performance behind. With ~4MN/s (on pc) the engine ZeroLogic 1 manages 1900 - 2000 elo, which is enough to beat most chess players. More importantly, it is still able to search circa 20kN/s on the calculator, enabling a depth of 5 ply in a second, which when tested on my pc was still above 1500elo performance. The playing experience needs some serious improvements, due to the only mode of communication with the engine being the uci protocol and it only being able to search for depth and not for time. This is all in the works tho.

So to summarize: A well performing chess engine on a calculator is very well possible, and will hopefully help through a lot of maths classes. You can find my very poorly commented project here :
Please excuse my bad English, have a great new year and bless your heart if you happen to stumble upon this comment in an almost 12 year old topic.
With kind regards, Christian :)