设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6153|回复: 1

[交流] 求助

[复制链接]
发表于 2008-5-25 18:48:57 | 显示全部楼层 |阅读模式
用NETLOGO 模仿MINESWEEPER 做了个游戏,6 e% b# p6 ?8 D8 N" S. v

9 S/ B5 K3 `4 W8 l( h) J几乎是抄过去的, 可运行的时候总是死机, 运行原程序没有问题,说明不是我的电脑有问题.* W5 l( f1 V3 [) a1 Q4 H3 H

4 l6 n- o' b, s$ I, M主要问题出在, 用鼠标点下的时候, 如果下面没有MINE 的时候, 无法的出GLABEL的数值,
; W1 Y' `3 E- U* J& A3 E/ `  g/ ]; `4 b! }. @+ N
【见三楼,呵呵】& z9 C* x# |& P' F4 l+ j0 e" Y
' i3 i- A2 O, h6 o! b
[ 本帖最后由 chuchj 于 2008-5-28 17:31 编辑 ]
 楼主| 发表于 2008-5-28 11:44:37 | 显示全部楼层
好的,谢谢了
( y! c# s' D3 O/ ~
. w: y0 @  v2 u( E; |/ H/ `问题找到了,
' F/ i1 N9 l. `9 d! ~! G' s8 Y' o2 @. u6 T
2 a4 N6 y; j' z
在 To clear 中遗失了一句 - Y" \6 _* ?7 v6 Z. X- \

( T8 a$ x5 o- T    [ ask neighbors with [any? grass-squares-here]
1 f; g& w. M& C
- ]/ G9 \6 s( J! e
9 {$ f, k6 A$ o; x. j* [& Z5 B, k! J
/ P: ^" g' m2 u9 N7 [# V4 O
to clear
5 {2 V& Y+ B- h2 T+ \8 }
* v. `5 F  y$ f& s" S5 ^ask grass-squares-here [die]
8 [& K( z# W  e2 w  l. s" ?( ?2 O  t
ask markers-here [die]  s) o/ m+ \' f5 e
" Z( M" B4 w! r' @1 _
let total count neighbors with [any? mines-here]' l/ j- f( ^1 U7 ?, L, d; W# L
& u- S1 M7 P, i4 I8 ~
ifelse total > 0
7 P8 g* I3 U0 @5 b6 v7 ?
  c2 `/ f4 j' N' _[set plabel total]4 G4 i3 {% ]: G0 H; M5 l
0 ~/ Z( U( j" i! i
[ ask neighbors with [any? grass-squares-here]
( q3 s/ S6 e3 a5 T- C1 g; Z! r0 R9 P8 P4 g
/ J2 K: I, a8 H/ Y. L! ~: D
[clear]
- k/ m1 E) c' g# a1 r) \2 L
  v8 J  M" R# }$ D4 B0 dend
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-5-2 00:41 , Processed in 0.016958 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表