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

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #15 on: November 01, 2012, 03:21:00 am »
Guys, You can get chess for the gbc.

A)It runs at 100% so speed is not a problem
B)Even if it didn't it does not matter as it is chess

The AI is depends on the ROM. Not worth the effort.
I don't agree with the A: the game is quite slow. I tried it and decided to remove it because it was getting me bored. I returned to thpenguin's chess instead.
And I don't agree with the B because it is annoying to wait for 5 minutes before the opponent makes a move.

So really, it would be worth the effort to start a chess project:
-In C, it would surely be faster than Chessmaster and graphics could be improved too
-In Lua, the game would be compatible with all OSes without the need for Ndless.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

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 #16 on: November 01, 2012, 03:42:43 am »
Augs, I already explained above why it was not satisfactory to use an emulated chess engine. I'm more knowledgeable about those matters than you are, and so is Hayleia (among others). Please stop proposing this kind of simplistic, and wrong, solutions (and thereby lower your total post ratings even further) ;)

I've silently looked at Toledo Nanochess, which is indecipherable (it was made for that purpose !), and therefore very hard to modify. If functions equivalent to getchar() and putchar() (or these functions, as defined by the C89 / C99 / C11 standards) are provided by NspireIO, a rough port might just be easy. Otherwise, well, better look at a different chess engine :D

EDIT: in fact, NspireIO does provide putchar() and getchar(): http://nspforge.unsads.com/p/nspireio/wiki/Documentation . Go ahead, those who use an up to date Ndless SDK ;)
« Last Edit: November 01, 2012, 05:47:54 am by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Chess for Ti-Nspire CX
« Reply #17 on: November 01, 2012, 03:59:42 am »
By the way, since the GB/GBC are old and weaker consoles than the TI-Nspire, developers have to abuse all sort of cheap shortcuts during programming. Although it is less likely to happen with chess, there are more chances to run into exploits or glitches due to the weird coding. Remember for example how in most old Mario games you could go through walls while jumping backwards due to them not checking for such collision detection in order to save every bit of speed possible. In most console games the randomizer is much cheaper too, so there is more risk for luck manipulation.

Besides, by making a brand new game using all the calc CPU power, you could have a much better Chess clone than the GB/GBA clones or even allow players to play the game at much lower MHz speed to save battery life.
« Last Edit: November 01, 2012, 04:00:05 am by DJ_O »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Chess for Ti-Nspire CX
« Reply #18 on: November 01, 2012, 08:12:43 am »
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
« Last Edit: November 01, 2012, 08:16:56 am by aeTIos »
I'm not a nerd but I pretend:

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #19 on: November 01, 2012, 08:29:43 am »
EDIT: in fact, NspireIO does provide putchar() and getchar(): http://nspforge.unsads.com/p/nspireio/wiki/Documentation . Go ahead, those who use an up to date Ndless SDK ;)
Yup, but it doesn't work with Nspire I/O :(

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #20 on: November 01, 2012, 09:00:06 am »
I made the same thing a few hours about (with Lionel's help), but I get something a little different (your >> are ÿ for me), and I can type (but only large amounts of characters!) and get some obscure answers from the program.



I sent a mail to the original author asking for a documentation.

Code:
Code: [Select]
char*l="ustvrtsuqqqqqqqqyyyyyyyy}{|~z|{}"
"   76Lsabcddcba .pknbrq  PKNBRQ ?A6J57IKJT576,+-48HLSU";
#include <os.h>
#define NIO_REPLACE_STDIO
#include <nspireio2.h>
#define F getchar()&z
#define v X(0,0,0,21,
#define Z while(
#define _ ;if(
#define P return--G,y^=8,

int _isatty(int file) {
   (void)file; // avoid warning
   return 1;
}

B,i,y,u,b,I[411],*G=I,x=10,z=15,M=1e4;X(w,c,h,e,S,s){int t,o,L,E,d,O=e,N=-M*M,K
=78-h<<x,p,*g,n,*m,A,q,r,C,J,a=y?-x:x;y^=8;G++;d=w||s&&s>=h&&v 0,0)>M;do{_ o=I[
p=O]){q=o&z^y _ q<7){A=q--&2?8:4;C=o-9&z?q["& .$  "]:42;do{r=I[p+=C[l]-64]_!w|p
==w){g=q|p+a-S?0:I+S _!r&(q|A<3||g)||(r+1&z^y)>9&&q|A>2){_ m=!(r-2&7))P G[1]=O,
K;J=n=o&z;E=I[p-a]&z;t=q|E-7?n:(n+=2,6^y);Z n<=t){L=r?l[r&7]*9-189-h-q:0 _ s)L
+=(1-q?l[p/x+5]-l[O/x+5]+l[p%x+6]*-~!q-l[O%x+6]+o/16*8:!!m*9)+(q?0:!(I[p-1]^n)+
!(I[p+1]^n)+l[n&7]*9-386+!!g*99+(A<2))+!(E^y^9)_ s>h||1<s&s==h&&L>z|d){p[I]=n,O
[I]=m?*g=*m,*m=0:g?*g=0:0;L-=X(s>h|d?0:p,L-N,h+1,G[1],J=q|A>1?0:p,s)_!(h||s-1|B
-O|i-n|p-b|L<-M))P y^=8,u=J;J=q-1|A<7||m||!s|d|r|o<z||v 0,0)>M;O[I]=o;p[I]=r;m?
*m=*g,*g=0:g?*g=9^y:0;}_ L>N){*G=O _ s>1){_ h&&c-L<0)P L _!h)i=n,B=O,b=p;}N=L;}
n+=J||(g=I+p,m=p<O?g-3:g+2,*m<z|m[O-p]||I[p+=p-O]);}}}}Z!r&q>2||(p=O,q|A>2|o>z&
!r&&++C*--A));}}}Z++O>98?O=20:e-O);P N+M*M&&N>-K+1924|d?N:0;}

main()
{
nio_use_stdio();
Z++B<121)*G
++=B/x%x<2|B%x<2?7:B/x&4?0:*l++&31;Z B=19){Z B++<99)putchar(B%x?l[B[I]|16]:x)_
x-(B=F)){i=I[B+=(x-F)*x]&z;b=F;b+=(x-F)*x;Z x-(*G=F))i=*G^8^y;}else v u,5);v u,
1);}
nio_free_stdio();
}


« Last Edit: November 01, 2012, 09:00:34 am by excale »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Chess for Ti-Nspire CX
« Reply #21 on: November 01, 2012, 09:10:31 am »
Maybe put this in another topic (or is this related?)
I'm not a nerd but I pretend:

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 #22 on: November 01, 2012, 09:20:27 am »
Toledo Nanochess is a chess engine, and Nspire I/O might just have enabled to port it to the Nspire.
But the code is derived from a winning entry at IOCCC: it has many warnings, it's extremely hard to understand and therefore to modify. It's not necessarily Nspire I/O's fault if it does not work as is on the Nspire.
« Last Edit: November 01, 2012, 09:20:55 am by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Chess for Ti-Nspire CX
« Reply #23 on: November 01, 2012, 09:39:06 am »
Do you mean warnings as in errors or warnings as in copyright lawsuit threats if re-used as is?

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #24 on: November 01, 2012, 09:47:48 am »
Do you mean warnings as in errors or warnings as in copyright lawsuit threats if re-used as is?
Errors ;)

It looks like my getchar() implementation is not ANSI C compliant (mine is non-blocking, the ANSI C one waits for Enter being pressed, that's why you get large amounts of characters), but modifying Nspire I/O doesn't solve the problems... (-> my screenshot)

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #25 on: November 01, 2012, 12:17:33 pm »
Well OK then. I am fine with just the emulator but obviously you are not. So I am not going to stop you. Whatever floats your boat.

Quote
Care to give us the exact name (not a download)  of the ROM/game in question?

Isn't that against the rules of the forum?

Quote
Also Augs what if someone wanted to make a better Chess game? By the way it is against Omnimaga rules to discourage someone from working on a project under such circumstances.

Sorry.
« Last Edit: November 01, 2012, 12:38:31 pm by Augs »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #26 on: November 01, 2012, 01:25:40 pm »
DJ_O was asking you for the name of the chess rom, not a download. So no, that is not against forum rules. :)

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #27 on: November 01, 2012, 02:11:19 pm »
Well I found one called chess master.

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #28 on: November 01, 2012, 05:08:42 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: http://www.thomasdupuis.com/portfolio/en/2010/03/23/chess-game-project-1st-year-prepa/ . Do you think it can help? Go ahead and do it! Cheers.'Ik zal wachten' ;)

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Chess for Ti-Nspire CX
« Reply #29 on: November 01, 2012, 07:13:33 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: http://www.thomasdupuis.com/portfolio/en/2010/03/23/chess-game-project-1st-year-prepa/ . Do you think it can help? Go ahead and do it! Cheers.'Ik zal wachten' ;)

The website says "There's no AI" ;)