Question: Please help me out please asap ! Assembly language program Problem #2 () In this final problem, you will modify the 2-player version of your
Please help me out please asap !
Assembly language program
Problem #2 ()
In this final problem, you will modify the 2-player version of your game to have a primitive artificial intelligence. You must use the random number generator that you created in homework assignment #4 which uses the linear feedback shift register (LFSR). Given the pseudo-code of problem 2 from assignment #9, you must modify step (3.ii). This step asks the user to input four numbers for the tuple (r1,c1,r2,c2). This set of four numbers represents the current move. However if it is the computers turn, this step must generate the values of (r1,c1,r2,c2).
The functions getValidJumps() and getValidMoves() from assignment #8 generate the list of all possible moves from a current position. A random AI will take a list of the valid moves and jumps, then choose one of these possibilities at random. Since we know the number of valid jumps and the number of valid moves separately it is possible to generate a random jump or a random move as needed. Since the sizes of the arrays are 24x4, then you only need to generate a random number between 0 and 23.
a) Write a function to generate a random number between 0 and 32. This requires you to generate 5 random bits. Though biased, you may then use the div/rem instructions to reduce the number to a reasonable range (0..23). The LFSR should satisfy the taps given by the following polynomial from homework 4:
??20 +??19 +??16 +??14 +1
b) Modify step (3.ii) of the pseudo code in HW9 problem 3 so that if it is the computers turn, then your program should call getValidJumps() and getValidMoves() to get a list of valid options for the computer,then generate a random number from problem (3a) to choose a valid 4-tuple instead of taking user input.
Note that several parts of this problem are unspecified. Some issues that you will need to decide:
? How to initialize the start state of your LFSR? (required)
? Should the computer be forced to jump if the option is available? (optional)
? How to implement multiple jumps? (optional)
? Is it possible to improve the AI so that it is more intelligent than a random method? How to improve it? (optional)
? Which player goes first? (optional)
? Can the computer play itself? (optional)
? Other???
Extra credit will be awarded for programs that go above and beyond the basic, required functionality and you are encouraged to develop your program further. If you implement optional functionality for extra credit, be sure to describe what you did in a separate text file so that the grader may identify what you did.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
