# On the heels of the Chess thread: How actually do AIs change their "skill level"

**URL:** <https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501>\
**Category:** The Game Room\
**Created:** [September 1, 2009, 3:55pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501 "2009-09-01T15:55:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rumor\_Watkins](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Rumor\_Watkins](https://boards.straightdope.com/u/Rumor_Watkins)\
**Post date:** [September 1, 2009, 3:55pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/1 "2009-09-01T15:55:46Z")

</div>

So you’ve got a program that can handily defeat all but the best players of chess.

Ok, so how are the AIs tweaked so that when you play it on “novice” level, you can actually win. I’ve always wondered myself, and this applies to all computer programs…

Does the AI cheat by giving you more favorable / it less favorable rolls (not relevant in chess, of course)

Is the AI crippled in some way (like the program can be made to be faulty to some degree)

Is there some program at the end that says “ok, now you know what the winning answer is. you will do that 50% of the time, and 50% of the time you will make a random move”

basically, how does AI change itself when you select a difficulty level?

---

<div class="post-metadata">

**Author:** ![Captain\_Amazing](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@Captain\_Amazing](https://boards.straightdope.com/u/Captain_Amazing)\
**Post date:** [September 1, 2009, 4:09pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/2 "2009-09-01T16:09:31Z")

</div>

One common way in chess games is to change the amount of time the computer has to figure out the move, or limiting how many moves ahead the computer can simulate.

I remember when I was growing up, and this was back in the mid 80s, I had a handheld chess game that would fall for the scholars mate exactly half the time.

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [September 1, 2009, 4:20pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/3 "2009-09-01T16:20:03Z")

</div>

Here’s a good article on how this is done. As **Captain Amazing** says, it sometimes involves cutting down on the number of calculations (e.g. how many moves ahead the AI is thinking). Another technique is to purposely create situations the player can exploit to gain an advantage.

[http://software.intel.com/en-us/articles/intelligent-mistakes-how-to-incorporate-stupidity-into-your-ai-code/](http://software.intel.com/en-us/articles/intelligent-mistakes-how-to-incorporate-stupidity-into-your-ai-code/)

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [September 1, 2009, 4:20pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/4 "2009-09-01T16:20:12Z")

</div>

Ditto what **Captain Amazing** said. The early chess devices (I still have my Boris Diplomat) had a setting that limited either the time or the number of moves ahead it would look.

I don’t think the Diplomat would _ever_ fall for a Fool’s Mate. It usually ended up beating me.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 1, 2009, 4:43pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/5 "2009-09-01T16:43:07Z")

</div>

I’ve never used the Scholar’s Mate against a chess computer (but I did once fall for it myself as a human), but I did once beat a computer on move 6 with a fool’s mate plus irrelevant adornments (some moves on the other side of the board that didn’t change the basic structure of the mate). It was set on a difficulty setting where it occasionally made deliberate mistakes.

---

<div class="post-metadata">

**Author:** ![Colibri](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/colibri/32/1841_2.png) [@Colibri](https://boards.straightdope.com/u/Colibri)\
**Post date:** [September 1, 2009, 5:00pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/6 "2009-09-01T17:00:08Z")

</div>

Moving to The Game Room from GQ.

Colibri  
General Questions Moderator

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [September 1, 2009, 9:57pm UTC](https://boards.straightdope.com/t/on-the-heels-of-the-chess-thread-how-actually-do-ais-change-their-skill-level/508501/7 "2009-09-01T21:57:05Z")

</div>

That’s **Colibri** for the mate in 6 moves…

Nothing more to really add though. Having programmed some games, the basic technique is to limit the number of options considered by the AI. Either through time or count restrictions.

Some of them will throw in randomized moves at the lowest level.
