微机LC-3_3.6*6棋盘四子棋_计算机系统与概论实验四
2017-09-20 13:58:43 0 举报
微机LC-3 6*6棋盘四子棋小游戏流程图
作者其他创作
大纲/内容
mem[SaveTurn]0?
R4=-1;mem[SaveTurn]=0;
YES
NO
WhoWin
R4-R5=0?
R1--;
R5-mem[R3];R4-mem[SaveLastCHESS];
R1-6;R3++;R2--;
R3-R70?
R1=0?
R1-36;R7-CHESS;
R20?
R4=0?
R2++;
R3-=5;R7-mem[CHESSEND];
R3+=7;R7-mem[CHESSEND];
PUT\
R3-R2;
START
mem[R7]-0R7++;R1--;
Draw
R3-'1';R4-'6';
R2=0?
R3-mem[SaveLtPosition];R2-mem[TempColumn];R2-=6;R1-3;
R2-CHESS;R5-(-R2);
PUT\"-\";
ORIG. x3000;CHESS .BLKW 35;CHESSEND .BLKW 1;
R1-R4=0?
GET c;
R1-c;
R1++;
JudgeResult
R4++
mem[MCHESS]-(-CHESS);mem[MCHESSEND]-(-CHESSEND);
R2--;
mem[SaveLastChess]-R4;
PtP2WIN
R3-mem[SaveLtPosition];R2-mem[TempColumn];
END
R1-R40?
R5--;
R3-mem[SaveLtPosition];R2-mem[TempColumn];R1-3;
PrintChess
R3++;R2++;
R3-mem[SaveLtPosition];R1-3;
PUT\"\\";
mem[R3]-R4;mem[SaveLastPosition]-R3;
PUT\" \";
PUT\"Invalid move. Try again.\" ;
R4-mem[R3];
R3--;R2--;
INPUT
mem[SaveTurn]=0?
R3+=6;R7-mem[MCHESSEND];
R4=1;mem[SaveTurn]=1;
PUT\"O\";
R1-R30?
R5=0?
R1-mem[IfGameOver];R1++;R3-mem[SaveLastPosition];R4-mem[R3];
R3-=6;
R3+R70?
R40?
R1-CHESS;R3+=30;
R3+=5;R7-mem[CHESSEND];
R2++;R2=R2-R5;mem[TempColum]-R2;
R3-mem[SaveLtPosition];R2-mem[TempColumn];R2-=6;
PtP1WIN
PUTS\"Tie Game.\"
R6-36;mem[SaveTurn]-0;mem[IfGameOver]-0;
R3-CHESS;R1-6;R2-6;
R3-R10?
R60?
R4-'1';
R6--;
PUTS\"Player 1 Wins.\"
R3-=7;R7-mem[CHESSEND];
R50?
R6--;mem[IfGameOver]-R6;
PUT\"X\";
mem[IfGameOVer]-R1;
R5-mem[IfGameOver];
R4-mem[R3]
R3++;
R10?
PUTS\"Player 2 Wins.\"
0 条评论
下一页