New Year's resolution: a chess engine written in BASH script

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: New Year's resolution: a chess engine written in BASH sc

Post by Fguy64 »

benstoker wrote:It's stoopid, I know. But, it's been done in Javascript. I would like to see an obviously very basic script that searches 3 or 4 ply, with simple piece value eval. A minimax and no alpha-beta, etc.

Anybody out there who could help?

The world is crying out for a BASH chess engine.
If you really wanna be a hero, have your engine load in a Microsoft Excel spreadsheet.
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: New Year's resolution: a chess engine written in BASH sc

Post by Edmund »

Fguy64 wrote:
benstoker wrote:It's stoopid, I know. But, it's been done in Javascript. I would like to see an obviously very basic script that searches 3 or 4 ply, with simple piece value eval. A minimax and no alpha-beta, etc.

Anybody out there who could help?

The world is crying out for a BASH chess engine.
If you really wanna be a hero, have your engine load in a Microsoft Excel spreadsheet.
I already did this once .. a GUI + Engine in VBA :)
but quite buggy.
Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: New Year's resolution: a chess engine written in BASH sc

Post by Fguy64 »

Edmund wrote:
Fguy64 wrote:
benstoker wrote:It's stoopid, I know. But, it's been done in Javascript. I would like to see an obviously very basic script that searches 3 or 4 ply, with simple piece value eval. A minimax and no alpha-beta, etc.

Anybody out there who could help?

The world is crying out for a BASH chess engine.
If you really wanna be a hero, have your engine load in a Microsoft Excel spreadsheet.
I already did this once .. a GUI + Engine in VBA :)
but quite buggy.
what? VBA? You should have tried with srictly cell formulas. you wuss, you took the easy way out.

:lol:
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: New Year's resolution: a chess engine written in BASH sc

Post by Edmund »

Fguy64 wrote:
Edmund wrote:
Fguy64 wrote:
benstoker wrote:It's stoopid, I know. But, it's been done in Javascript. I would like to see an obviously very basic script that searches 3 or 4 ply, with simple piece value eval. A minimax and no alpha-beta, etc.

Anybody out there who could help?

The world is crying out for a BASH chess engine.
If you really wanna be a hero, have your engine load in a Microsoft Excel spreadsheet.
I already did this once .. a GUI + Engine in VBA :)
but quite buggy.
what? VBA? You should have tried with srictly cell formulas. you wuss, you took the easy way out.

:lol:
Cell formulas?? ok thats indeed a challenge :)
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: New Year's resolution: a chess engine written in BASH sc

Post by Tord Romstad »

Don wrote:I think a relatively strong engine could be written in perl or one of the high level languages such as python, ruby, tcl, lua, etc. Probably a better one could be done in lua because it's impressively fast for an interpreted language.
How about Common Lisp? Higher level than all of the above, and also at least an order of magnitude faster.

I know that I could write a Common Lisp chess engine no more than 100 Elo points weaker than Stockfish. This is a conservative estimate; 100 Elo points are what we would expect from a slowdown by a factor of 3, and getting within 33% of C speed with Common Lisp isn't all that hard. I've often been tempted to write a Common Lisp chess program, but there is always so much else competing about my time ...
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: New Year's resolution: a chess engine written in BASH sc

Post by Don »

Tord Romstad wrote:
Don wrote:I think a relatively strong engine could be written in perl or one of the high level languages such as python, ruby, tcl, lua, etc. Probably a better one could be done in lua because it's impressively fast for an interpreted language.
How about Common Lisp? Higher level than all of the above, and also at least an order of magnitude faster.

I know that I could write a Common Lisp chess engine no more than 100 Elo points weaker than Stockfish. This is a conservative estimate; 100 Elo points are what we would expect from a slowdown by a factor of 3, and getting within 33% of C speed with Common Lisp isn't all that hard. I've often been tempted to write a Common Lisp chess program, but there is always so much else competing about my time ...
When I was young and naive (I'm still naive) I tried to write a chess program in TRS-80 interpreted basic. My machine had 4k of RAM and it was a slow z80 processor. I discovered that I couldn't do it in such a high level language with such a low amount of memory. It's possible that this could be done with incredibly clever code, but I had just learned basic from the manual that came with the computer and was not very experienced. Of course I realize that with 4k of ram it's easily possible to write a chess program in assembly language.
User avatar
mhull
Posts: 13447
Joined: Wed Mar 08, 2006 9:02 pm
Location: Dallas, Texas
Full name: Matthew Hull

Re: New Year's resolution: a chess engine written in BASH sc

Post by mhull »

Tord Romstad wrote:
Don wrote:I think a relatively strong engine could be written in perl or one of the high level languages such as python, ruby, tcl, lua, etc. Probably a better one could be done in lua because it's impressively fast for an interpreted language.
How about Common Lisp? Higher level than all of the above, and also at least an order of magnitude faster.

I know that I could write a Common Lisp chess engine no more than 100 Elo points weaker than Stockfish. This is a conservative estimate; 100 Elo points are what we would expect from a slowdown by a factor of 3, and getting within 33% of C speed with Common Lisp isn't all that hard. I've often been tempted to write a Common Lisp chess program, but there is always so much else competing about my time ...
Speaking of LISP, whatever happened to Steven Edwards and Symbolic?
Matthew Hull
User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 3:54 am
Location: San Jose, California

Re: New Year's resolution: a chess engine written in BASH sc

Post by Bill Rogers »

Don
I have a 4k chess program written for the TRS-80. I am not sure if it is a one-ply or a two -ply program but it works just fine. I did not write it but have been collecting chess programs for years now. It is written in Basic.
I even wrote one that is 8k long, still only one ply.

For the rest of you what is BASH? I heard of a chess program written in Lisp years ago, it was not fast but did play a good game at that time.
Bill
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: New Year's resolution: a chess engine written in BASH sc

Post by Don »

Bill Rogers wrote:Don
I have a 4k chess program written for the TRS-80. I am not sure if it is a one-ply or a two -ply program but it works just fine. I did not write it but have been collecting chess programs for years now. It is written in Basic.
I even wrote one that is 8k long, still only one ply.

For the rest of you what is BASH? I heard of a chess program written in Lisp years ago, it was not fast but did play a good game at that time.
Bill
Bill,

I know that a chess program can be written in much less than 4k, but the issue is whether one can be written in interpreted basic of many years ago.

When I say 4k I don't mean source code size either. It's running on a computer which has only 4k and so the program and the data must fit in this 4k. The basic interpreter itself is assumed to be in ROM.

So do you have a TRS-80 chess program written in basic that runs on a machine with only 4k of RAM? I would like to see that program - can you send it to me?

Don
MattieShoes
Posts: 718
Joined: Fri Mar 20, 2009 8:59 pm

Re: New Year's resolution: a chess engine written in BASH sc

Post by MattieShoes »

Bill Rogers wrote: For the rest of you what is BASH?
http://en.wikipedia.org/wiki/Bash
http://en.wikipedia.org/wiki/Comparison ... and_shells

If you are at a DOS prompt, it's running command.com
If you're at a unix prompt, it's *probably* running bash.