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

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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 tried to send you a private Email but it came back to me. I would be more than happy to send you the 4k chess program but I need a valid Email address.
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 tried to send you a private Email but it came back to me. I would be more than happy to send you the 4k chess program but I need a valid Email address.
Bill
dailey.don@gmail.com

or

drd@mit.edu
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 tried to send you a private Email but it came back to me. I would be more than happy to send you the 4k chess program but I need a valid Email address.
Bill
I just downloaded virtualT, and emulator for the model 100 and other similar models. It brings back memories ...

Don
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

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

Post by metax »

Anyone beat 8 moves? :D

1.e4 a5 2.d4 e6 3.Bb5 Ke7 4.e5 g6 5.Nf3 d5 6.Bg5+ f6 7.exf6+ Kf7 8.Ne5# 1-0
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

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

Post by UncombedCoconut »

metax wrote:Anyone beat 8 moves? :D

1.e4 a5 2.d4 e6 3.Bb5 Ke7 4.e5 g6 5.Nf3 d5 6.Bg5+ f6 7.exf6+ Kf7 8.Ne5# 1-0
If you're talking about my engine, let it have white and you'll mate it sooner. In fact during the engine v engine matches I used to look for bugs, it played into a few fool's mates! (It overlooks mate in 1 because it thinks in terms of king captures rather than check.)

8 moves is still pretty good though!
Karatorian

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

Post by Karatorian »

smcracraft wrote:Perl and Python would be interesting choices... at the end of your
exercise (whatever language), you will know that language better...
When I first started to learn about chess programming, I wrote about half a chess (variant) engine in Python. It had move generation and a basic (terminal) user interface, but no search.

Also, my current project, a shogi engine, uses a bunch of precomputed tables for stuff like king and general moves that are generated from python code.

I've actually been thinking about writing a full fledged engine in Python. However, it wouldn't neccessarily be a chess engine per say. Rather the idea is to create a generic engine of sorts that can be used to impliment chess variants. Most chess variants have no engine at all, or just a Zillions of Games implementation, which is sad.

If you wrote a chess engine in perl, I don't think just plain old perl would be enough. I think you'd have to use obfuscated perl. Of course, if you did, you could probably be a solid contender in the obfuscated perl contest.

If you where to port mini-max to a shell, wouldn't csh be the logical choice?

If working from scratch, remeber, there's pretty much no such thing a pure shell (in practice). Properly implemented, you'd handle the hard bits with sed and awk, which would make the shell code seem tame by comparison.
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 »

Karatorian wrote:
smcracraft wrote:Perl and Python would be interesting choices... at the end of your
exercise (whatever language), you will know that language better...
When I first started to learn about chess programming, I wrote about half a chess (variant) engine in Python. It had move generation and a basic (terminal) user interface, but no search.

Also, my current project, a shogi engine, uses a bunch of precomputed tables for stuff like king and general moves that are generated from python code.

I've actually been thinking about writing a full fledged engine in Python. However, it wouldn't neccessarily be a chess engine per say. Rather the idea is to create a generic engine of sorts that can be used to impliment chess variants. Most chess variants have no engine at all, or just a Zillions of Games implementation, which is sad.

If you wrote a chess engine in perl, I don't think just plain old perl would be enough. I think you'd have to use obfuscated perl. Of course, if you did, you could probably be a solid contender in the obfuscated perl contest.

If you where to port mini-max to a shell, wouldn't csh be the logical choice?

If working from scratch, remeber, there's pretty much no such thing a pure shell (in practice). Properly implemented, you'd handle the hard bits with sed and awk, which would make the shell code seem tame by comparison.
Perl code can be just as readable as C if a programmer chooses to make it that way. It's just that most people don't write perl that way because it's usually a once-off or short enough they just want to make it work and forget about it.
Aaron Becker
Posts: 292
Joined: Tue Jul 07, 2009 4:56 am

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

Post by Aaron Becker »

Karatorian wrote: If you where to port mini-max to a shell, wouldn't csh be the logical choice?
Probably, or maybe zsh. But if you're porting a chess engine to shell script, you've clearly abandoned logic :)