Recent

Author Topic: Porting TChessBrd from Delphi  (Read 45358 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Porting TChessBrd from Delphi
« on: October 14, 2011, 07:06:17 pm »
I am porting TChessBrd component from Delphi. It was written on year 2000. It uses a TImageList to draw drag images, which fails completely in Lazarus. I was not able to understand what is going on with TImageList and simply canceled the corresponding code.

I have replaced the drag functionality and resources by Lazarus style ones and canceled the animation. Maybe someone could have a better idea.

Code attached.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Porting TChessBrd from Delphi
« Reply #1 on: October 14, 2011, 07:12:21 pm »
Sorry, no suggestions, but can I hope you're helping Felipe with his ChessFPC program?  :D
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #2 on: October 14, 2011, 07:18:10 pm »
Well, I have improved the notation, maybe he can use on his program. Animation is better there.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #3 on: October 14, 2011, 11:48:59 pm »
Demo attached.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Porting TChessBrd from Delphi
« Reply #4 on: October 14, 2011, 11:59:34 pm »
It's using deprecated .lrs resource file and hangs up on close. Has to be forced to stop by Lazarus. It's also not showing anything on form.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #5 on: October 15, 2011, 12:42:47 am »
Bitmap attached.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Porting TChessBrd from Delphi
« Reply #6 on: October 15, 2011, 09:48:46 am »
Sorry, no suggestions, but can I hope you're helping Felipe with his ChessFPC program?  :D

This seams to have no relation with fpchess. In fpchess there is a chess drawing component which supports animations.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #7 on: October 15, 2011, 10:32:54 am »
My notation obeys the rules of FIDE and supports multi-language.
« Last Edit: October 15, 2011, 10:46:40 am by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #8 on: October 19, 2011, 12:29:04 pm »
Fixed ChessBrd.pas attached.

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Porting TChessBrd from Delphi
« Reply #9 on: July 19, 2013, 04:15:58 pm »
Any ideas how to use chess engine, for example houdini with this?

I did also find critter engine http://sourceforge.net/projects/critterchess/ 

It's Delphi project, but works fine (just open dpr). Tested 1.1 & FPC2.71, Win32

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Porting TChessBrd from Delphi
« Reply #10 on: July 19, 2013, 04:53:26 pm »
It is necessary to adapt the code for an engine. I did not do it yet.

The board itself works very well.

If you are interested on working a bit on this, try to learn the engine protocols:

http://en.wikipedia.org/wiki/Chess_Engine_Communication_Protocol

Houdini 1.5 is freeware.

http://www.houdinichess.com/

I like to play against this chess board because it is the only I can win.
« Last Edit: July 19, 2013, 05:21:16 pm by typo »

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: Porting TChessBrd from Delphi
« Reply #11 on: July 19, 2013, 07:54:39 pm »
For a basic version it looks nice  8)
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Porting TChessBrd from Delphi
« Reply #12 on: July 20, 2013, 11:13:15 am »
If you are interested on working a bit on this, try to learn the engine protocols:
Was hoping for code example.

I started houdini with createprocess. But when I send commands, nothing happens. Commands do appear in console, but not work.

However, if I manually type commands to this console, then it works.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Porting TChessBrd from Delphi
« Reply #13 on: July 20, 2013, 11:17:49 am »
@Timewarp: likewise, it's useless to discuss code without posting it. Perhaps attaching your code could help: project menu/publish project, zip up the resulting directory with source files and attach it to a post or upload it somewhere...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Porting TChessBrd from Delphi
« Reply #14 on: July 20, 2013, 12:27:03 pm »
it's useless to discuss code without posting it.
I didn't post it, because my code is no use, it doesn't work.

But now attached what was my basic idea. You need "Houdini_15a_w32.exe" in same folder. (Link was posted previously)

Not sure this is even correct idea. I can find examples how to create an engine, but not a single GUI example.

 

TinyPortal © 2005-2018