Using the flat assembler (fasm), write a program that plays tic-tac-toe against the computer. Below is a sample game loop. It assumes the player is X and computer is O with the player making the first move.
gameLoop:
call printBoard
cinvoke printf, "Your move (1-9)? "
cinvoke scanf, "%d", Square
call placeX
call checkXWin
call checkForDraw
call computerMove
call checkOWin
jmp gameLoop
For the computerMove, you could simply place an O in the first available square, select a random square, or do these steps:
1. check if computer "O" can win
else
2. check if computer can block player "X" from winning
else
3. select a random square to move into
Example output
Welcome to x86 Assembly Tic-tac-toe!
You will be X's and the computer will be O's.
The squares are number 1 - 9 starting with the top left.
| |
---|---|---
| |
---|---|---
| |
Your move (1-9)? 5
| | O
---|---|---
| X |
---|---|---
| |
Your move (1-9)? 1
X | | O
---|---|---
| X |
---|---|---
| | O
Etc.
{"mode":"full","isActive":false}
Hello,
I have checked the description and can build Tic-Tac-Toe game as per the requirement in fasm assembly using FASM assembler.
I will make sure that it works as per requirements on FASM assembler.
Best Regards,
Hello ,
I have bachelor's degree in computer science and i have been programming in C/C++ for more than 6 years.
I have written various network applications some of which are down to the IP packet level,
and have written a linux based network packet analyzer, a CGI webserver and others.
And also written simple versions of network diagnostic tools ping and traceroute, and other bigger projects.
I have written assembly programs professionally in the past for intel and shellcode, and familiar with ARM assembly.
Let me know if you're interested.
hi, i have rich experienced of C/C++ so that i can give you the perfect result.
C/C++ is my top skill and i am majoring it for long years.
i have completed the several projects already so i have confident to complete your project 100%.
if you want to discuss about the project, please contact with me.
thank you.
Hello, I have 5 year experience of making games. I can make game on console as well. I will make for you that game on flat assembler (fasm) with cheap price. Please consider hire me.
Thanks,
Cong.