Skip to main content

Checkers bot using min max alghoritm

Project description

GitHub: Usage Example

from checkers import Field,Bot
game = Field(turn = 'white') #could be white and black
bot = Bot() #init bot
print(game)

.b.b.b.b b.b.b.b. .b.b.b.b ........ ........ w.w.w.w. .w.w.w.w w.w.w.w.

print(game.turn)

white

print(game.posible_moves)

[[[5, 0], [4, 1]], [[5, 2], [4, 1]], [[5, 2], [4, 3]], [[5, 4], [4, 3]], [[5, 4], [4, 5]], [[5, 6], [4, 5]], [[5, 6], [4, 7]]]

print(game.move(game.posible_moves[0])) #make move returns False, draw, white or black  (who wins)

False

print(game)

.b.b.b.b b.b.b.b. .b.b.b.b ........ .w...... ..w.w.w. .w.w.w.w w.w.w.w.

print(game.check_winer()) #returns False, draw, white or black  (who wins)

False

print(bot.move(game,depth = 3)) #depth - int

False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkers_bot-0.1.3.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file checkers_bot-0.1.3.tar.gz.

File metadata

  • Download URL: checkers_bot-0.1.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.5

File hashes

Hashes for checkers_bot-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ac5afaf79d6fd40fa95219653b73f9cbb8ffc58a352dab9e590aaa36ecc717f9
MD5 c14c7ef0ebe477ca33d3b1f690747ad9
BLAKE2b-256 e290a315dd7245da99546be661094e681a65fbb05d487642dcf755f2dedcefb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page