GWHBOB 发表于 2010-8-16 17:54:06

【SncakI】贪吃蛇G1M不卡版


======SNACKI======
"SPEED 1 To 10"?→S
'=====INIT==========
ClrText
148→Dim List 1
Fill(0,List 1)
{21,7}→Dim Mat A
Fill(0,MatA)
2→X
1→Y
2→L
1→P
1*8+1→List 1
RanInt#(2,20)→M
RanInt#(2,6)→N
27→R
27→Z
If S≤10
  Then Int (80/S)→S
  Else 1→S
IfEnd
Locate 1,1,"○"
Locate 2,1,"●"
Locate M,N,"¥"
'=====MAIN LOOP=====
While 1
  '=====DELAY&KEY=====
  For 1→I To S
    Getkey→T
    T=64=>28→T
    T=62=>37→T
    T=73=>38→T
    T=53=>27→T
    (T=28) And (Z≠37)=>T→R
    (T=37) And (Z≠28)=>T→R
    (T=38) And (Z≠27)=>T→R
    (T=27) And (Z≠38)=>T→R
  Next
  R→Z
  '=====MOVE==========
  MOD(P,148)+1→P
  Locate X,Y,"○"
  1→MatA
  8X+Y→List 1
  Z=28=>Y-1→Y
  Z=37=>Y+1→Y
  Z=38=>X-1→X
  Z=27=>X+1→X
  '=====EAT===========
  If X=M And Y=N
  Then
    RanInt#(2,20)→M
    RanInt#(2,6)→N
    L+1→L
    0→List 1
  IfEnd
  List 1→T
  T≠0=>0→Mat A
  '=====DIE===========
  X>21=>Goto 0
  X<1=>Goto 0
  Y>7=>Goto 0
  Y<1=>Goto 0
  Mat A=1=>Goto 0
  '=====DISPLAY=======
  T≠0=>Locate Int (T/8),MOD(T-1,8)+1," "
  Locate X,Y,"●"
  Locate M,N,"¥"
WhileEnd
'=====END===========
Lbl 0
{3838}→List 1
Locate 7,4,"GAME OVER"
Locate 8,5,"score:"
Locate 15,5,L-1

GWHBOB 发表于 2010-8-16 18:05:09

等我打会儿游戏再去分班烤再去军训后给代码详解。

hcz 发表于 2010-8-16 18:12:29

LZ注意下站内信

NASA 发表于 2010-10-10 12:27:05

就不能发个源文件吗?累死我了

NASA 发表于 2010-10-10 12:36:10

到第52行就error了

GWHBOB 发表于 2010-10-10 12:57:55

5# NASA
看这里:http://www.cncalc.org/thread-4573-1-2.html
大概你代码输错了吧……不要以为它帮你自动换行了就不用输回车

Zms 发表于 2010-10-11 19:46:39

食物是RMB。。。

NASA 发表于 2010-10-17 11:11:16

6# GWHBOB 我输回车了
页: [1]
查看完整版本: 【SncakI】贪吃蛇G1M不卡版