更新 从回复我的用户链接到C#解决方案项目: https://github.com/TedDawkin/C64_AI_Movement
更新
我找到了 - 如果有人感兴趣,只需使用C64论坛中线程的链接:http://www.lemon64.com/forum/viewtopic.php?p=712902#712902我在那里讨论了这个主题(和我一起)。有趣的是它到底有多简单。没那么好笑,我花了两个多星期。
我稍后会将BASIC发布到C#代码并“回答”我自己的问题。
如果有人关心并且不想去论坛链接,这里是它如何在C64基础上工作。
30110 IF KS(S)=0 THEN GOSUB 30400 : GOTO30105
30400 POKE 211,20: POKE214,18: SYS CS: PRINT"SPIELER"F
30405 Y=INT(KP(S,F)/40)
SYS CR, KP(S,F)-40*Y, Y
X=PEEK(UA)-1
Y=PEEK(UA+1)-40
30410 IF PEEK(UA+2)=1 OR PEEK (UA+3)=1 GOTO 30420
30415 IFINT(RND(1)*2)=0ORGW(KS(S),F)<4GOTO30450
30420 IFX=0THENX=Y:GOTO30215
30421 IFY<>0GOTO30450
30425 GOTO30215
30450 IFX<>0ANDRI(F)<>(1+2*(X=1))THENP=X:GOSUB30490:IFP=0THENRETURN
30451 IFY<>0ANDRI(F)<>(40+80*(Y=1))THENP=Y:GOSUB30490:IFP=0THENRETURN
30455 IFX<>0ANDRI(F)<>(1+2*(X=1))GOTO30460
30456 IFRI(F)<>-1THENP=1:GOSUB30490:IFP=0THENRETURN
30457 IFRI(F)<>1THENP=-1:GOSUB30490:IFP=0THENRETURN
30458 GOTO30465
30460 IFY<>0ANDRI(F)<>(40+80*(Y=1))GOTO30465
30461 IFRI(F)<>-40THENP=40:GOSUB30490:IFP=0THENRETURN
30462 IFRI(F)<>40THENP=-40:GOSUB30490:IFP=0THENRETURN
30465 RETURN
30490 Q=KP(S,F)+P:IFQ<0ORQ>520OR(PEEK(BR+Q)<>32ANDPEEK(BR+Q
<>96)THENRETURN
30491 POKEBR+KP(S,F),32:KP(S,F)=Q:POKEBR+KP(S,F),193:POKEFR+KP(S,F),6
30492 RI(F)=P:P=0:RETURN
一些提示:
X = moved right (1), left (-1), up (-40) or down(40)
P = Position. There is no Y because the next/prev line is
40 characters away. (C64 Screen = 40 Columns and 25 Rows)
S = switches between 0 and 2 to determine if its human or ai turn
KP(S,F) = Offset-Position in Video-Memory-Adress
BR = Start-Adress of Video-Memory
32 = 0x20 = Space to clear old position
193 = Ascii-Character used as pawn for player and ai
6 = Mark field as AI (Human position is marked with 0x0b)
F = Playernumber
RI(F) = dont know yet
原始问题:
正在制作翻拍并试图了解C64-Code我正在努力进行AI运动。工作一周以上,我无法重现100%相同的行为。
答案 0 :(得分:0)
回答我的问题:是的,艾未未可以使用RND随机行动,我完全忽略了这一点。
有关深入讨论,请转到Forum-Thread
如果您想调试/逆向工程某些东西,那么其他绊脚石可能会有所帮助。
Point(x,y)
或array[x,y]
,而是一个整数0-999代表C64-Screen的25行和40列JSR
中丢失