Skip to main content
Code Review

Return to Answer

Small correction
Source Link

Very nice game. Good effort! A few suggestions to make it better.

The instruction to give x and y is a little confusing i tried entering 3, 6 then 3 and 6 ... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

try:
 print('give x and y')
 x = int(input("x:"))
 y = int(input("y:"))

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. Chess Board

r n b q k b n r 0 
p p p p p p p p 1 
P . . . . . . . 2 
. . . . . . . . 3 
. . . . . . . . 4 
. . . . . . . . 5 
. P P P P P P P 6 
R N B Q K B N R 7 
0 1 2 3 4 5 6 7 8 

So that the white Rook on the KingThe Queen side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

At the start of the game, the left-most white pawn is sitting all the way across the board

 r n b q k b n r 0 
 p p p p p p p p 1 
>P . . . . . . . 2 
 . . . . . . . . 3 
 . . . . . . . . 4 
 . . . . . . . . 5 
 . P P P P P P P 6 
 R N B Q K B N R 7 
 0 1 2 3 4 5 6 7 8 

You could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. This is the Wikipedia link. You can get them into python using chr()

for i in range(12):
 chr(9812+i)

output:

'♔'
'♕'
'♖'
'♗'
'♘'
'♙'
'♚'
'♛'
'♜'
'♝'
'♞'
'♟'

Very nice game. Good effort! A few suggestions to make it better.

The instruction to give x and y is a little confusing i tried entering 3, 6 then 3 and 6 ... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

try:
 print('give x and y')
 x = int(input("x:"))
 y = int(input("y:"))

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. Chess Board

r n b q k b n r 0 
p p p p p p p p 1 
P . . . . . . . 2 
. . . . . . . . 3 
. . . . . . . . 4 
. . . . . . . . 5 
. P P P P P P P 6 
R N B Q K B N R 7 
0 1 2 3 4 5 6 7 8 

So that the white Rook on the King side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

At the start of the game, the left-most white pawn is sitting all the way across the board

 r n b q k b n r 0 
 p p p p p p p p 1 
>P . . . . . . . 2 
 . . . . . . . . 3 
 . . . . . . . . 4 
 . . . . . . . . 5 
 . P P P P P P P 6 
 R N B Q K B N R 7 
 0 1 2 3 4 5 6 7 8 

You could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. This is the Wikipedia link. You can get them into python using chr()

for i in range(12):
 chr(9812+i)

output:

'♔'
'♕'
'♖'
'♗'
'♘'
'♙'
'♚'
'♛'
'♜'
'♝'
'♞'
'♟'

Very nice game. Good effort! A few suggestions to make it better.

The instruction to give x and y is a little confusing i tried entering 3, 6 then 3 and 6 ... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

try:
 print('give x and y')
 x = int(input("x:"))
 y = int(input("y:"))

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. Chess Board

r n b q k b n r 0 
p p p p p p p p 1 
P . . . . . . . 2 
. . . . . . . . 3 
. . . . . . . . 4 
. . . . . . . . 5 
. P P P P P P P 6 
R N B Q K B N R 7 
0 1 2 3 4 5 6 7 8 

So that the white Rook on The Queen side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

At the start of the game, the left-most white pawn is sitting all the way across the board

 r n b q k b n r 0 
 p p p p p p p p 1 
>P . . . . . . . 2 
 . . . . . . . . 3 
 . . . . . . . . 4 
 . . . . . . . . 5 
 . P P P P P P P 6 
 R N B Q K B N R 7 
 0 1 2 3 4 5 6 7 8 

You could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. This is the Wikipedia link. You can get them into python using chr()

for i in range(12):
 chr(9812+i)

output:

'♔'
'♕'
'♖'
'♗'
'♘'
'♙'
'♚'
'♛'
'♜'
'♝'
'♞'
'♟'

The instruction to give xx and yy is a little confusing i tried entering 3,63, 6 then "3 and 6" 3 and 6... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

Not really a "code problem""code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. http://media.wiley.com/Lux/43/201843.image0.jpg Chess Board

So that the white Rook on the King side is at coordinates (1,1)(1,1) and the other white rook at coordinates (1,8)(1,8)

The system accepts negative values for xx and yy, as well as the number 88... all of these generate an error (since the grid currently starts counting at 00)

atAt the start of the game, the left-most white pawn is sitting all the way across the board

youYou could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. This is the https://en.wikipedia.org/wiki/Chess_symbols_in_UnicodeWikipedia link you. You can get them into python using chr()

The instruction to give x and y is a little confusing i tried entering 3,6 then "3 and 6" ... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. http://media.wiley.com/Lux/43/201843.image0.jpg

So that the white Rook on the King side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

at the start of the game, the left-most white pawn is sitting all the way across the board

you could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode you can get them into python using chr()

The instruction to give x and y is a little confusing i tried entering 3, 6 then 3 and 6... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. Chess Board

So that the white Rook on the King side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

At the start of the game, the left-most white pawn is sitting all the way across the board

You could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. This is the Wikipedia link . You can get them into python using chr()

Source Link

Very nice game. Good effort! A few suggestions to make it better.

The instruction to give x and y is a little confusing i tried entering 3,6 then "3 and 6" ... it took me a while to figure out that I needed to enter one and then the other. making this small change could make it easier:

try:
 print('give x and y')
 x = int(input("x:"))
 y = int(input("y:"))

Not really a "code problem" per se, but rather a chess problem. The numbering on the board should start from the bottom left corner and move out. And it should count from 1, not from 0. http://media.wiley.com/Lux/43/201843.image0.jpg

r n b q k b n r 0 
p p p p p p p p 1 
P . . . . . . . 2 
. . . . . . . . 3 
. . . . . . . . 4 
. . . . . . . . 5 
. P P P P P P P 6 
R N B Q K B N R 7 
0 1 2 3 4 5 6 7 8 

So that the white Rook on the King side is at coordinates (1,1) and the other white rook at coordinates (1,8)

The system accepts negative values for x and y, as well as the number 8... all of these generate an error (since the grid currently starts counting at 0)

at the start of the game, the left-most white pawn is sitting all the way across the board

 r n b q k b n r 0 
 p p p p p p p p 1 
>P . . . . . . . 2 
 . . . . . . . . 3 
 . . . . . . . . 4 
 . . . . . . . . 5 
 . P P P P P P P 6 
 R N B Q K B N R 7 
 0 1 2 3 4 5 6 7 8 

you could use unicode chess pieces, this would allow you to free the alphabet and use the traditional Letter-Number chess coordinates. https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode you can get them into python using chr()

for i in range(12):
 chr(9812+i)

output:

'♔'
'♕'
'♖'
'♗'
'♘'
'♙'
'♚'
'♛'
'♜'
'♝'
'♞'
'♟'
lang-py

AltStyle によって変換されたページ (->オリジナル) /