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
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

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

Post by hgm »

benstoker wrote:
hgm wrote:Well, it can't be that difficult to translate micro-Max 1.6 into a bash script? Only bout 100 lines...
But can you do C pointers in BASH? Too advanced for BASH, non?
Micro-Max des not really use pointers. I think the one place it does (collecting the input line) could just as easily be re-written using indexing.
Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 10:01 pm
Location: Irvine, CA, USA

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

Post by Dirt »

bob wrote:
benstoker wrote: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.
This is not a hard project, but it is a painful one. And it would be slow beyond belief, since bash is a true interpreter and it would continually pass over the script, parsing and executing as it searches. Slow is not strong enough to describe this. :)
Great! Maybe I'd actually be able to beat it.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

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

Post by Greg Strong »

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.
BASH? Too easy. What the world needs is an engine written in Logo 8-)
smcracraft
Posts: 737
Joined: Wed Mar 08, 2006 8:08 pm
Location: Orange County California
Full name: Stuart Cracraft

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

Post by smcracraft »

Perl and Python would be interesting choices... at the end of your
exercise (whatever language), you will know that language better...

and that's a plus.

Then try converting it to other languages to increase breadth.
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 »

Greg Strong 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.
BASH? Too easy. What the world needs is an engine written in Logo 8-)
Is there actually a way to interact with this green spot on the screen once the program has started?
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

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

Post by Greg Strong »

Edmund wrote:
Greg Strong 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.
BASH? Too easy. What the world needs is an engine written in Logo 8-)
Is there actually a way to interact with this green spot on the screen once the program has started?
Haha... you caught me! A chess program in Logo is probably not possible, as I don't recall any way to interact with the turtle (although there might be. I haven't programmed in logo since I was like 10 :D)
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 »

I wrote one in perl. I think nps was in 200 or 300. I eventually abandoned it because with the long capture sequences and whatnot, even a 1 ply search could take an absurd amount of time.
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 »

Greg Strong wrote:
Edmund wrote:
Greg Strong 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.
BASH? Too easy. What the world needs is an engine written in Logo 8-)
Is there actually a way to interact with this green spot on the screen once the program has started?
Haha... you caught me! A chess program in Logo is probably not possible, as I don't recall any way to interact with the turtle (although there might be. I haven't programmed in logo since I was like 10 :D)
When I wrote that I have just tried a very basic web application, able to let the turtle walk forwards, right, left and so on.

Then I found a more advanced interpreter. FMSLogo has the following features:
FMSLogo includes support for

* "Standard" Logo parsing
* Turtle Graphics
* Exception handling
* TCP/IP networking
* Text in all available system fonts
* 1024 independent turtles
* Bitmapped turtles
* MIDI devices
* Direct I/O for controlling external hardware (must be admin)
* Serial and parallel port communications
* Saving and loading images in BMP format
* Calling into native DLLs
* Creating windows dialog boxes
* Event driven programming (mouse, keyboard, timer)
* Controlling multimedia devices (WAV sound files, CD-ROM control, etc.)
* 3D Perspective drawing (wire-frame and solids)
* Creating animated GIFs
This one could easily be used to program a chess engine. Also the GUI would be pretty fun; with the feature "1024 independent turtles" you could create 32 turtles then in combination with "Bitmapped turtles" put some bmp of chess pieces on them and let them run over a chess board. And finally with "Event driven programming" you could easily interact with the user.

regards,
Edmund
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

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

Post by Greg Strong »

Too cool :)
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

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

Post by Dann Corbit »

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.
They can enjoy playing chess with this engine on a ship constructed entirely from stones and mortar.

I saw on Mythbusters that a balloon can be constructed from lead foil, along with a concrete glider. So a bash chess program is not alone in its oddness.

Yes, you can produce this engine. The burning question is, "Why?"

P.S.
I guess you can use Hillary's defense.