Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some ideas #49

Open
PGTBoos opened this issue Oct 14, 2022 · 8 comments
Open

Some ideas #49

PGTBoos opened this issue Oct 14, 2022 · 8 comments

Comments

@PGTBoos
Copy link

PGTBoos commented Oct 14, 2022

Was looking at the code i'm on a jupyter notebook though.
Could it be converted to it? ,
I've still not cracked the looking ahead for moves..

Though for your code.

  • Maybe an idea, what if all the potential moves was just selected from list(board.legal_moves) ?
  • Bishop/Knight values, how about adjusting it during the game a single bishop is less then a pair
    its not just comparing number off bishops vs knights, their value change slightly. (i'd even prefer 2 knights end games).
  • Not sure if you allready do this
    If you check several moves ahead, one doesnt need to recalculate if a specific move is indeed played, top results can be cashed
    and if so one can expand on previous results, which might even then get a bonus 1 level deeper.
  • Not sure if you take it in the calculation, diagonal pawn walls, might get a higher peace value.
@ClasherKasten
Copy link
Collaborator

Could it be converted to it? ,

No, I don't see a good, practical reason converting this project to a Jupyter notebook. Is there a good reason why you would like to have it converted to a Jupyter notebook?

Maybe an idea, what if all the potential moves was just selected from list(board.legal_moves)

I noticed that board has no attribute legal_moves. Could you please point to a file and line number where you can find that? Or is this an intentionally introduced new attribute? If so, please describe how it should look and behave.

Bishop/Knight values, how about adjusting it during the game a single bishop is less then a pair
its not just comparing number off bishops vs knights, their value change slightly. (i'd even prefer 2 knights end games).

This is a good idea, if you wanna do it and have time for it, you can open a PR.

Not sure if you allready do this
If you check several moves ahead, one doesnt need to recalculate if a specific move is indeed played, top results can be cashed
and if so one can expand on previous results, which might even then get a bonus 1 level deeper.

I didn't see this kind of behaviour anywhere in the code. It sounds like a good idea too, but I guess the problem will be that right now it wont change much, as you can read in the README.md under Technical stuff it's a very basic and slow AI. So my apprehension is that it needs to much time for often recalculations when the AI wrong predicts the best moves and with a too low lookahead cache the AI can recalculate things fast enough that we don't need it (As seen on the screenshots, 2 moves lookahead is ok to calculate but 3 and above is very time consuming and eventually for this it could make sense to use a cache. But if we choose a number higher than 3, players would wait too long for recalculations).

Not sure if you take it in the calculation, diagonal pawn walls, might get a higher peace value.

This is again a very interesting idea. if you wanna do it and have time for it, you can open a PR.

@PGTBoos
Copy link
Author

PGTBoos commented Oct 14, 2022 via email

@ClasherKasten
Copy link
Collaborator

What is a PR ?

PR means Pull Request.

For me it be nice on jupyter since all neural network lives there at my pc.

It might be better for you because you wanna integrate sonething, but would be a pain for me to maintain.
e.G.: Jupyter Notebooks can not be reviewed as .py files. It is much harder with Jupyter Notebooks. Also as far as I understood, Jupyter Notebooks don't really have the concept of "modules". Every piece of code essentially would have to be written twice: once for the normal python code, once for the Jupyter Notebook.

Also I think Jupyter would force people to use a workflow not everyone uses or wants to use.

Might attract other Devs too if published like that.

That's a good point, but unfortunately I don't think that it is worth the additional work for maintaining it.

If you want to have a Jupyter Notebook version of this project, please do it on your own, but I don't gonna do the extra maintaining work and also I don't wanna load extra work on the contributors when they have to write their code two times.

@PGTBoos
Copy link
Author

PGTBoos commented Oct 14, 2022

Ok fair point, 2 versions is indeed a lot of work to maintain.

@PGTBoos
Copy link
Author

PGTBoos commented Oct 14, 2022

Oh and about legal moves this is how I do it at my current chess jupyter notebook.

!pip install chess
import chess

board = chess.Board()
board.turn == chess.WHITE
print(str(board))
list(board.legal_moves)
move = list(board.legal_moves)[0] # take the first move (with no score calucalation at all)
print(move.uci())

@ClasherKasten
Copy link
Collaborator

ClasherKasten commented Oct 14, 2022

!pip install chess is wrong.
The package name is cl-chess, so the correct command would be !pip install cl-chess.

Sorry, but i forgot to mention that the PyPI package didn't get updated for quite a while. To use latest changes, I would recommend to install from source (through cloning the repository and pip install <path-to-cloned-repository>).

@ericborgos
Copy link

After some experimentation, I got it to work in Google Colab. Here's the code:
!git clone https://github.com/marcusbuffett/command-line-chess
%cd /content/command-line-chess
!pip install .
!chess

@ClasherKasten
Copy link
Collaborator

For only installing it, and not needing the code, cloning isn't required, because pip can install from git repositories. See documentation for this here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants