主题:趣味图形(细胞)
图形演示程序,用最短的代码达到比较好的显示效果。
希望让Qbasic爱好者知道。QB画出来的东西其实也不是很难看。
RANDOMIZE TIMER '随机种子,为了让程序每次运行的结果都不相同。
SCREEN 12 '设置为12号图形模式
DIM count AS INTEGER
DIM Red AS INTEGER, green AS INTEGER, Blue AS INTEGER
length = 15
FOR count = 1 TO 15
Red = 63 - (count - 1) * (64 / length)
'green = 63 - (count - 1) * (64 / length)
'Blue = 63 - (count - 1) * (64 / length)
PALETTE count, Red + green * 256 + Blue * 65536 '调色板,这玩意是书上没有的东西。
NEXT
FOR j = 1 TO 200
x = INT(RND * 640)
y = INT(RND * 480)
FOR i = 15 TO 0 STEP -1
CIRCLE (x, y), i, i, , , 1 '很简单的画圆命令
NEXT
NEXT
希望让Qbasic爱好者知道。QB画出来的东西其实也不是很难看。
RANDOMIZE TIMER '随机种子,为了让程序每次运行的结果都不相同。
SCREEN 12 '设置为12号图形模式
DIM count AS INTEGER
DIM Red AS INTEGER, green AS INTEGER, Blue AS INTEGER
length = 15
FOR count = 1 TO 15
Red = 63 - (count - 1) * (64 / length)
'green = 63 - (count - 1) * (64 / length)
'Blue = 63 - (count - 1) * (64 / length)
PALETTE count, Red + green * 256 + Blue * 65536 '调色板,这玩意是书上没有的东西。
NEXT
FOR j = 1 TO 200
x = INT(RND * 640)
y = INT(RND * 480)
FOR i = 15 TO 0 STEP -1
CIRCLE (x, y), i, i, , , 1 '很简单的画圆命令
NEXT
NEXT