SteveBarnegren / SwiftChess

Chess engine and AI written in Swift
MIT License
145 stars 35 forks source link

Levels #6

Closed rasIOS closed 6 years ago

rasIOS commented 6 years ago

Hi, How can we change Game levels? Like easy, Medium, Hard. Please tell us.

Thanks lot.

SteveBarnegren commented 6 years ago

Hi @rasIOS

When creating an AIPlayer you can pass in an AIConfiguration struct. Pass in the difficulty when creating the AIConfiguration, you can use .easy, .medium or .hard.

For instance, you can create a hard difficulty AI player like this:

let configuration = AIConfiguration(difficulty: .hard)
let player = AIPlayer(color: .black, configuration: configuration)
rasIOS commented 6 years ago

It's work thanks :)