Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

5-2 Final Project Milestone Three Proposed Changes Southern New Hampshire University IT 450

Rating
-
Sold
1
Pages
4
Grade
A+
Uploaded on
31-03-2023
Written in
2022/2023

Final Project Milestone Three: Proposed Changes In order to understand the AI in the Checkers game, we must look at how the AI is handled when the computer makes its turn. The game uses several functions that handle what move should be done given the exact situation where the game is at the time (more on this later). The game uses the “movesAvailable” (see figure 1) function to generate what moves are possible at the time and stores them in an array called “moves”. The list of moves made is simply called “move” and is used as the basis for this array. During this process, which is called every computer turn, the game calls another function called “moveIsValid” (see figure 2) to handle whether the available move chosen is able to be made based on the rules of the game. In order to effectively “pick” an available move, a function called “removeBadMoves” (see figure 3) is implemented which appends the “moves” array with results of a “badMoves” array which is populated with moves made throughout the game. The game determines what a “bad” move is based on certain conditions, such as “did I gain a piece in the second turn after I lost a piece in the last turn?” and other parameters such as this and constantly updates the “moves” array with these decisions. This process also narrows down the available moves that the computer has to choose between, and the move that is chosen is handled by some for loops (see figure 4 and 5) that prioritize moves based on certain conditions. In practice however, the AI as it is right now is very simplified as having a high tendency to preserve itself rather than sacrificing pieces to potentially gain an advantage down the line. The “hasMorePieces” function (see figure 6) han

Show more Read less
Institution
Course

Content preview

Glenn Savarese 7/29/2021

IT-450 Final Project Milestone Three: Proposed Changes

In order to understand the AI in the Checkers game, we must look at how the AI is

handled when the computer makes its turn. The game uses several functions that handle what

move should be done given the exact situation where the game is at the time (more on this later).

The game uses the “movesAvailable” (see figure 1) function to generate what moves are

possible at the time and stores them in an array called “moves”. The list of moves made is simply

called “move” and is used as the basis for this array. During this process, which is called every

computer turn, the game calls another function called “moveIsValid” (see figure 2) to handle

whether the available move chosen is able to be made based on the rules of the game.

In order to effectively “pick” an available move, a function called “removeBadMoves”

(see figure 3) is implemented which appends the “moves” array with results of a “badMoves”

array which is populated with moves made throughout the game. The game determines what a

“bad” move is based on certain conditions, such as “did I gain a piece in the second turn after I

lost a piece in the last turn?” and other parameters such as this and constantly updates the

“moves” array with these decisions. This process also narrows down the available moves that

the computer has to choose between, and the move that is chosen is handled by some for loops

(see figure 4 and 5) that prioritize moves based on certain conditions.

In practice however, the AI as it is right now is very simplified as having a high tendency

to preserve itself rather than sacrificing pieces to potentially gain an advantage down the line.

The “hasMorePieces” function (see figure 6) handles this priority and is used in one of the main

for loops.



This study source was downloaded by 100000850872992 from CourseHero.com on 03-30-2023 17:37:12 GMT -05:00


https://www.coursehero.com/file/102373364/5-2-Final-Project-Milestone-Three-Proposed-Changesdocx/

Written for

Course

Document information

Uploaded on
March 31, 2023
Number of pages
4
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$9.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ExamsConnoisseur Self
Follow You need to be logged in order to follow users or courses
Sold
587
Member since
3 year
Number of followers
344
Documents
1492
Last sold
2 weeks ago

4.2

68 reviews

5
40
4
11
3
13
2
1
1
3

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions