Author Topic: Optimization and adding AI  (Read 14939 times)

0 Members and 2 Guests are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Optimization and adding AI
« on: October 30, 2012, 03:26:41 pm »
I am making a chess program in AXE, and I need help with optimization, adding Promotion, and adding AI.

The file:
http://www.ticalc.org/archives/files/fileinfo/449/44910.html

thanks if you can help. I need to optimize first.

Edit: ticalc link no longer valid... will give new ticalc link when updated.
Edit: attatched v1.2 to this post
Edit: Updated screenshot:

Edit: I moved this project to a different location: http://ourl.ca/17408
« Last Edit: November 07, 2012, 11:54:54 am by pimathbrainiac »
I am Bach.

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Optimization and adding AI
« Reply #1 on: November 01, 2012, 03:56:39 pm »
Code: [Select]
[3844828282443800]->Pic1P9
[3244828282443800]->Pic1P10
[3244828282443800]->Pic1P11
[3244828282443800]->Pic1P12
[3244828282443800]->Pic1P13
[3244828282443800]->Pic1P14
[3244828282443800]->Pic1P15
[3244828282443800]->Pic1P16
[387CFEFEFE7C3800]->Pic2P
[387CFEFEFE7C3800]->Pic2P10
[387CFEFEFE7C3800]->Pic2P11
[387CFEFEFE7C3800]->Pic2P12
[387CFEFEFE7C3800]->Pic2P13
[387CFEFEFE7C3800]->Pic2P14
[387CFEFEFE7C3800]->Pic2P15
[387CFEFEFE7C3800]->Pic2P16
[3068A4A484483000]->Pic1B
[1058DCDCFC783000]->Pic2B
[609088482848F800]->Pic1N
[60F0F87838787800]->Pic2N
[D6D67C2828287C00]->Pic1R
[D6D67C3838387C00]->Pic2R
[9254382828287C00]->Pic1Q
[9254383838387C00]->Pic2Q
[3828EE82EE283800]->Pic1K
[3838FEFEFE383800]->Pic2K
[FFFFFFFFFFFFFFFF]->Pic3

I think this are the sprites for the pieces.
You could call them by a command like
Code: [Select]
PtnOn(X,Y,Pic1P9+I*8
where I is the number of the sprite you want to draw.


...and adding AI.

I once made a chess AI on my PC but I doubt it will be possible with Axe on calculators
The calcs are to slow and they haven't enougth memory
Sorry for my bad English, I'm German.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Optimization and adding AI
« Reply #2 on: November 01, 2012, 08:51:16 pm »
Code: [Select]
PtnOn(X,Y,I*8+Pic1P9)Optimized, and bugfixed at the same time ;D
Remember that placing constants at the end of expressions is optimal, and also remember Axe order of operations is straight-up left to right (unless there are parens)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Optimization and adding AI
« Reply #3 on: November 02, 2012, 12:48:11 pm »
I once made a chess AI on my PC but I doubt it will be possible with Axe on calculators
The calcs are to slow and they haven't enougth memory
It's <a href=http://ourl.ca/9904>already been done</a> in ASM with grayscale graphics. I don't see why it couldn't be done in Axe. :)

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Optimization and adding AI
« Reply #4 on: November 04, 2012, 01:36:22 pm »
I meant the AI the program that plays against you.
If that really exist you must show me  *.*

When I did it with Delphi 5 last year my CPU (in PC) needed 30 sekunds to decide which move to do altough it only "thinks" 5 moves depht.


Optimized, and bugfixed at the same time ;D
Remember that placing constants at the end of expressions is optimal, and also remember Axe order of operations is straight-up left to right (unless there are parens)
Yes I forgot...
« Last Edit: November 04, 2012, 01:37:35 pm by bored_student »
Sorry for my bad English, I'm German.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Optimization and adding AI
« Reply #5 on: November 04, 2012, 02:04:12 pm »
I meant the AI the program that plays against you.
If that really exist you must show me  *.*
I believe he linked to it in his post.
http://ourl.ca/9904
/e

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Optimization and adding AI
« Reply #6 on: November 04, 2012, 02:20:08 pm »
Yeah he really made it. So I have been wrong ::)
I will test the AI as soon as possible cause I once tried it on my one on a TI 83 Plus but I gave up after a while <_<

respect to thepenguin77  ;D
Sorry for my bad English, I'm German.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Optimization and adding AI
« Reply #7 on: November 04, 2012, 11:33:42 pm »
I once made a chess AI on my PC but I doubt it will be possible with Axe on calculators
The calcs are to slow and they haven't enougth memory
It's <a href=http://ourl.ca/9904>already been done</a> in ASM with grayscale graphics. I don't see why it couldn't be done in Axe. :)

Woah now. If we're going to link him, at least get him the most recent version.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Optimization and adding AI
« Reply #8 on: November 05, 2012, 03:36:41 pm »
I have new *optimized* code, but it needs a bugfix... you can only move one pawn of each color, and nothing else.

I deleted all the piece selection
And replaced it with this (just pawns so far):
Code: [Select]
If (getKey(54))
For(X,9,16)
If ((({Lƒ+17}+1)=({L+X})) and ({Lƒ+18}={L‚+X}))
{L+X}üZ
{L‚+X}üÁ
sub(B)
Zü{L+X}
Áü{L‚+X}
End
If ((({Lƒ+17}+1)=({L„+X})) and ({Lƒ+18}={L…+X}))
{L„+X}üZ
{L…+X}üÁ
sub(A)
Zü{L„+X}
Áü{L…+X}
End
End
End
I am Bach.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Optimization and adding AI
« Reply #9 on: November 05, 2012, 05:29:55 pm »
Just fixed the bug... sorry for the concern
I am Bach.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Optimization and adding AI
« Reply #10 on: November 05, 2012, 08:33:48 pm »
@Bored_student: I did mean the AI in thepenguin's version. :)
@Thepenguin: Sorry, our search function isn't the best, and that's all I could find. Thanks for the updated link.
@pimathbrainiac: You should post a screen shot of your work soon. :)
« Last Edit: November 05, 2012, 08:35:46 pm by Art_of_camelot »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Optimization and adding AI
« Reply #11 on: November 06, 2012, 11:23:50 am »
Not only is our search function not the best, it also likes to eat all the cpu on the vps x.x
/e

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Optimization and adding AI
« Reply #12 on: November 06, 2012, 11:37:26 am »
I have a screenshot on the ticalc page...
I am Bach.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Optimization and adding AI
« Reply #13 on: November 06, 2012, 11:41:31 am »
@pimathbrainiac: People don't always look on other sites for screenshots. Please be polite with your responses.
/e

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Optimization and adding AI
« Reply #14 on: November 06, 2012, 11:42:40 am »
sorry... I didn't think it came off as rude... sorry
I am Bach.