Question

Introduction Write a MIPS program to allow a user to play a simple variation of the game BINGO. Your program should display the following game board and the player wants to choose a location to mark BINGO A position can be marked by entering its column letter (eit B, I, N G, or CO and row number (either 1, 2, 3, 4, or 5). An X should mark the positions already marked. An underscore, e C 1 should represent unmarked positions BING O 4 X After the player chooses a position, the game board should be updated and displayed. If the player chooses a position that was previously marked, display an appropriate error message. If the player chooses an invalid position, display an appropriate error message. The program should continue running until a sentinel value of Q is entered to end the game. Once the player enters Q, display a message indicating whether or not the player won. A winning board contains either a horizontal, vertical, or diagonal line of 5 marked positions. You must check for horizontal and vertical winner configurations checking for diagonal winning boards is optional.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

main:
push rbp
mov rbp, rsp
push rbx
sub rsp, 152
mov edi, 0
call time
mov edi, eax
call srand
.L34:
mov edi, OFFSET FLAT:.LC0
call system
mov esi, OFFSET FLAT:.LC1
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov esi, OFFSET FLAT:std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)
mov rdi, rax
call std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))
mov DWORD PTR [rbp-20], 0
.L5:
cmp DWORD PTR [rbp-20], 4
jg .L2
mov DWORD PTR [rbp-24], 0
.L4:
cmp DWORD PTR [rbp-24], 4
jg .L3
call rand
mov ecx, eax
mov edx, 1374389535
mov eax, ecx
imul edx
sar edx, 5
mov eax, ecx
sar eax, 31
sub edx, eax
imul eax, edx, 100
sub ecx, eax
mov edx, ecx
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rcx, eax
mov rax, rcx
sal rax, 2
add rax, rcx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], edx
add DWORD PTR [rbp-24], 1
jmp .L4
.L3:
add DWORD PTR [rbp-20], 1
jmp .L5
.L2:
mov esi, OFFSET FLAT:.LC2
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov esi, OFFSET FLAT:std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)
mov rdi, rax
call std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))
mov esi, OFFSET FLAT:.LC3
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov DWORD PTR [rbp-20], 0
.L32:
cmp DWORD PTR [rbp-20], 4
jg .L6
mov DWORD PTR [rbp-24], 0
.L31:
cmp DWORD PTR [rbp-24], 4
jg .L7
cmp DWORD PTR [rbp-24], 0
jne .L8
call rand
mov ecx, eax
mov edx, -2004318071
mov eax, ecx
imul edx
lea eax, [rdx+rcx]
sar eax, 3
mov edx, eax
mov eax, ecx
sar eax, 31
sub edx, eax
mov eax, edx
mov edx, eax
sal edx, 4
sub edx, eax
mov eax, ecx
sub eax, edx
mov edx, DWORD PTR [rbp-24]
movsx rsi, edx
mov edx, DWORD PTR [rbp-20]
movsx rcx, edx
mov rdx, rcx
sal rdx, 2
add rdx, rcx
add rdx, rsi
mov DWORD PTR [rbp-144+rdx*4], eax
cmp DWORD PTR [rbp-20], 0
jne .L9
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
mov DWORD PTR [rbp-44], eax
jmp .L10
.L9:
cmp DWORD PTR [rbp-20], 1
jne .L11
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
mov DWORD PTR [rbp-28], eax
jmp .L10
.L11:
cmp DWORD PTR [rbp-20], 2
jne .L12
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
mov DWORD PTR [rbp-40], eax
jmp .L10
.L12:
cmp DWORD PTR [rbp-20], 3
jne .L13
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
mov DWORD PTR [rbp-36], eax
jmp .L10
.L13:
cmp DWORD PTR [rbp-20], 4
jne .L10
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
mov DWORD PTR [rbp-32], eax
jmp .L10
.L8:
cmp DWORD PTR [rbp-24], 1
jne .L14
call rand
mov ecx, eax
mov edx, -2004318071
mov eax, ecx
imul edx
lea eax, [rdx+rcx]
sar eax, 4
mov edx, eax
mov eax, ecx
sar eax, 31
sub edx, eax
imul eax, edx, 30
sub ecx, eax
mov edx, ecx
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rcx, eax
mov rax, rcx
sal rax, 2
add rax, rcx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], edx
.L17:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 15
jg .L15
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax+30]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
jmp .L16
.L15:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 30
jle .L16
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax-1]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
.L16:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 15
jg .L10
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 30
jle .L10
jmp .L17
.L14:
cmp DWORD PTR [rbp-24], 2
jne .L18
call rand
mov ecx, eax
mov edx, -2004318071
mov eax, ecx
imul edx
lea eax, [rdx+rcx]
sar eax, 3
mov edx, eax
mov eax, ecx
sar eax, 31
sub edx, eax
mov eax, edx
mov edx, eax
sal edx, 4
sub edx, eax
mov eax, ecx
sub eax, edx
mov edx, DWORD PTR [rbp-24]
movsx rsi, edx
mov edx, DWORD PTR [rbp-20]
movsx rcx, edx
mov rdx, rcx
sal rdx, 2
add rdx, rcx
add rdx, rsi
mov DWORD PTR [rbp-144+rdx*4], eax
.L21:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 30
jg .L19
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax+45]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
jmp .L20
.L19:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 45
jle .L20
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax-1]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
.L20:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 30
jg .L10
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 45
jle .L10
jmp .L21
.L18:
cmp DWORD PTR [rbp-24], 3
jne .L22
call rand
mov ecx, eax
mov edx, -2004318071
mov eax, ecx
imul edx
lea eax, [rdx+rcx]
sar eax, 3
mov edx, eax
mov eax, ecx
sar eax, 31
sub edx, eax
mov eax, edx
mov edx, eax
sal edx, 4
sub edx, eax
mov eax, ecx
sub eax, edx
mov edx, DWORD PTR [rbp-24]
movsx rsi, edx
mov edx, DWORD PTR [rbp-20]
movsx rcx, edx
mov rdx, rcx
sal rdx, 2
add rdx, rcx
add rdx, rsi
mov DWORD PTR [rbp-144+rdx*4], eax
.L25:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 45
jg .L23
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax+60]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
jmp .L24
.L23:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 60
jle .L24
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax-1]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
.L24:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 45
jg .L10
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 60
jle .L10
jmp .L25
.L22:
cmp DWORD PTR [rbp-24], 4
jne .L10
call rand
mov ecx, eax
mov edx, -2004318071
mov eax, ecx
imul edx
lea eax, [rdx+rcx]
sar eax, 3
mov edx, eax
mov eax, ecx
sar eax, 31
sub edx, eax
mov eax, edx
mov edx, eax
sal edx, 4
sub edx, eax
mov eax, ecx
sub eax, edx
mov edx, DWORD PTR [rbp-24]
movsx rsi, edx
mov edx, DWORD PTR [rbp-20]
movsx rcx, edx
mov rdx, rcx
sal rdx, 2
add rdx, rcx
add rdx, rsi
mov DWORD PTR [rbp-144+rdx*4], eax
.L28:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 60
jg .L26
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax+60]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
jmp .L27
.L26:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 90
jle .L27
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
lea ecx, [rax-1]
mov eax, DWORD PTR [rbp-24]
movsx rsi, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rsi
mov DWORD PTR [rbp-144+rax*4], ecx
.L27:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 60
jg .L10
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov eax, DWORD PTR [rbp-144+rax*4]
cmp eax, 75
jle .L10
jmp .L28
.L10:
cmp DWORD PTR [rbp-20], 2
jne .L29
cmp DWORD PTR [rbp-24], 2
jne .L29
mov esi, OFFSET FLAT:.LC4
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
jmp .L30
.L29:
mov eax, DWORD PTR [rbp-24]
movsx rcx, eax
mov eax, DWORD PTR [rbp-20]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rcx
mov ebx, DWORD PTR [rbp-144+rax*4]
mov esi, OFFSET FLAT:.LC5
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov esi, ebx
mov rdi, rax
call std::basic_ostream<char, std::char_traits<char> >::operator<<(int)
mov esi, OFFSET FLAT:.LC5
mov rdi, rax
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
.L30:
add DWORD PTR [rbp-24], 1
jmp .L31
.L7:
mov esi, OFFSET FLAT:.LC6
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
add DWORD PTR [rbp-20], 1
jmp .L32
.L6:
mov esi, OFFSET FLAT:.LC7
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
lea rax, [rbp-148]
mov rsi, rax
mov edi, OFFSET FLAT:std::cin
call std::basic_istream<char, std::char_traits<char> >::operator>>(int&)
mov eax, DWORD PTR [rbp-148]
test eax, eax
je .L33
jmp .L34
.L33:
mov eax, 0
add rsp, 152
pop rbx
pop rbp
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L38
cmp DWORD PTR [rbp-8], 65535
jne .L38
mov edi, OFFSET FLAT:std::__ioinit
call std::ios_base::Init::Init()
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:std::__ioinit
mov edi, OFFSET FLAT:std::ios_base::Init::~Init()
call __cxa_atexit
.L38:
nop
leave
ret
_GLOBAL__sub_I_main:
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret

Add a comment
Know the answer?
Add Answer to:
Introduction Write a MIPS program to allow a user to play a simple variation of the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Introduction: Write a MIPS program to allow a user to play a simple variation of the...

    Introduction: Write a MIPS program to allow a user to play a simple variation of the game BINGO. Your program should display the following game board and the player wants to choose a location to mark: BINGO A position can be marked by entering its column letter (either B I', 'N', 'G', or 'O') and row number (either 1, 2, 3, 4, or 5). An X' should mark the positions already marked. An underscore, i.e., should represent unmarked positions.

  • C only (not C++) Write a C program that simulates a game. There are two players...

    C only (not C++) Write a C program that simulates a game. There are two players (called Player1 and Player2). At the start of the game, each player chooses a number from 1 to 10 (cannot be the same). Then, the program will generate a random number from 1 to 10. The game ends when either Player1 or Player2 hits the number generated by the program. Display the winning message for the winner. Example output: Player 1: 6 Player 2:...

  • INTRODUCTION: Play sorry with two die, and one peg. Move your piece down the board first....

    INTRODUCTION: Play sorry with two die, and one peg. Move your piece down the board first. But rolling certain numbers will change the pace of the game. INCLUDE IN YOUR ASSIGNMENT: Annotation is a major part of any program. At the top of each of your C++ programs, you should have at least four lines of documentation: // Program name: tictactoe.cpp // Author: Twilight Sparkle // Date last updated: 5/26/2016 // Purpose: Play the game of Tic-Tac-Toe ASSIGNMENT: Sorry Game...

  • JAVA TIC TAC TOE - please help me correct my code Write a program that will...

    JAVA TIC TAC TOE - please help me correct my code Write a program that will allow two players to play a game of TIC TAC TOE. When the program starts, it will display a tic tac toe board as below |    1       |   2        |   3 |    4       |   5        |   6                 |    7      |   8        |   9 The program will assign X to Player 1, and O to Player    The program will ask Player 1, to...

  • IN JAVA. Write a program that lets the user play the game of Rock, Paper, Scissors...

    IN JAVA. Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. Don’t display the computer’s choice yet....

  • (Java) Write a program that lets the user play the game of Rock, Paper, Scissors against...

    (Java) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. Don’t display the computer’s choice yet. The...

  • write a program for python 3 write the functions that could be used in an implementation...

    write a program for python 3 write the functions that could be used in an implementation of the game tic-tac-toe. Below are the definitions of the different functions. The code to test each function is currently in the main() of the lab10.py file. • A function to build the board. This method should create a list of the numbers 1 – 9 and return that list. build_board () -> list • A void function to display the board. (see the...

  • It's writing a simple rock paper scissors game strictly following the instructions. INSTRUCTIONS: If the user...

    It's writing a simple rock paper scissors game strictly following the instructions. INSTRUCTIONS: If the user selects 'p': 1. First the program should call a function named getComputerChoice to get the computer's choice in the game. The getComputerChoice function should generate a random number between 1 and 3. If the random number is 1 the computer has chosen Rock, if the random number is 2 the user has chosen Paper, and if the random number is 3 the computer has...

  • In JAVA Chapter 5Assignment(Rock, Paper, Scissors)–20pointsYour goal is towrite a program that lets the user play...

    In JAVA Chapter 5Assignment(Rock, Paper, Scissors)–20pointsYour goal is towrite a program that lets the user play the game of Rock, Paper, Scissors against the computer.Your program should have the following: •Make the name of the project RockPaperScissors•Write a method that generates a random number in the range of 1 through 3. The randomly generated number will determine if the computer chooses rock, paper, or scissors. If the number is 1, then the computer has chosen rock. If the number is...

  • In traditional Tic Tac Toe game, two players take turns to mark grids with noughts and...

    In traditional Tic Tac Toe game, two players take turns to mark grids with noughts and crosses on the 3 x 3 game board. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row in the game board wins the game. Super Tic Tac Toe game also has a 3 x 3 game board with super grid. Each super grid itself is a traditional Tic Tac Toe board. Winning a game of Tic...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT