Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
P is for Practical
 
PerlMonks  

Re: Parsing Chess Algebra Notation

by podian (Scribe)
on May 04, 2004 at 15:56 UTC ( [id://350517]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Parsing Chess Algebra Notation

actully e4 or f4 always means Pe4 (Pawn to e4) or Pf4.

so one idea is to fully expand it first and then parse it.

Of course, you need to handle things like

e2e4 and Rad4 and so on.

I am also certain that if the first letter is not upper case then it is a pawn move(i.e. all the other moves must give the name of the piece that is moving)

so you could change e2e4 to Pe2e4 or Pe2Pe4

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://350517]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.