Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Parsing Chess Algebra Notation

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-16 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found