Re: Fortran 90 Chess



In article <g1ji6u$hat$1@xxxxxxxx>, John <gh14tq5@xxxxxxxxx> wrote:

SELECT CASE (INPUT)
CASE ('P', 'PAWN')
C = 100
CASE ('N', 'KT', 'KNIGHT', 'HORSE')
C = 270
CASE ('B', 'BISHOP')
C = 500
CASE ('Q', 'QUEEN')
C = 900
CASE DEFAULT
CYCLE
END SELECT

Also, I think the case ('P','PAWN') should be case ('R', 'ROOK').

John correctly pointed out that that SELECT CASE needs fixing but
IMHO his fix gives wrong C values for 'R' and 'B'. I suggest

SELECT CASE (INPUT)
CASE ('N', 'KT', 'KNIGHT', 'HORSE')
C = 270
CASE ('B', 'BISHOP')
C = 300
CASE ('R', 'ROOK')
C = 500
CASE ('Q', 'QUEEN')
C = 900
CASE DEFAULT
CYCLE
END SELECT

-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 6780 fax (+64)(4)463 5045
.



Relevant Pages