主题:简单问题
爱丽斯LING
[专家分:560] 发布于 2007-04-05 17:39:00
请编程解决古老的模拟星空问题,使屏幕出现许许多多的小黑点(黑点的大小必须一致),黑点由计算机随机产生.
回复列表 (共19个回复)
沙发
fiveyes [专家分:310] 发布于 2007-04-06 15:43:00
星空不是黑色天空里的许多小白点吗?
循环一定的次数(星星的数量),每次都取一个随机的X坐标与一个随机的Y坐标,并且在那个位置画一个点,这样就可以了吧?
板凳
hhhchy [专家分:300] 发布于 2007-04-06 16:49:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y), z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
3 楼
蓝莎菲莹 [专家分:370] 发布于 2007-04-08 16:38:00
CLS
DO
RANDOMIZE TIMER
SCREEN 7
COLOR 5
FOR I = 1 TO 1000
X = INT(RND * 302)
Y = INT(RND * 200)
Z = INT(RND * 15)
PSET (X, Y), Z
FOR J = 1 TO 10000
NEXT J
NEXT I
LOOP WHILE INKEY$ = ""
END
4 楼
Lovely哆啦 [专家分:1360] 发布于 2007-04-08 16:50:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y),z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
5 楼
小精灵LS [专家分:580] 发布于 2007-04-08 16:52:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y), z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
6 楼
Lovely哆啦 [专家分:1360] 发布于 2007-04-08 16:55:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y), z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
7 楼
游戏之王 [专家分:540] 发布于 2007-04-08 16:57:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y), z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
8 楼
chyx [专家分:450] 发布于 2007-04-08 17:23:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y),z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
9 楼
我的电脑 [专家分:990] 发布于 2007-08-13 10:24:00
CLS
DO
RANDOMIZE TIMER
SCREEN 7
COLOR 5
FOR I = 1 TO 1000
X = INT(RND * 302)
Y = INT(RND * 200)
Z = INT(RND * 15)
PSET (X, Y), Z
FOR J = 1 TO 10000
NEXT J
NEXT I
LOOP WHILE INKEY$ = ""
END
10 楼
QB小猪 [专家分:1200] 发布于 2007-08-13 11:13:00
CLS
SCREEN 13
RANDOMIZE TIMER
DO
x = INT(RND * 320) + 1: y = INT(RND * 200) + 1
z = INT(RND * 256)
PSET (x, y),z
FOR i = 1 TO 10000: NEXT i
LOOP WHILE INKEY$ = ""
END
我来回复