找回密码
 注册
搜索
查看: 21044|回复: 3

[在线求助] 小白问题请教!prefix string too short

[复制链接]
发表于 2011-12-12 00:10:23 | 显示全部楼层 |阅读模式
什么情况?……查不出错啊………… Bubble[] bubbles; void setup() { size(800,600); smooth(); // Load text file as an array of Strings String [] data = loadStrings("data.txt"); // The size of the array of Bubble objects is determined by the total number of lines in the text file. bubbles = new Bubble[data.length]; for (int i = 0; i < bubbles.length; i ++ ) { // Each line is split into an array of floating point numbers. float[] values = float(split(data[i], "," )); // The values in the array are passed into the Bubble class constructor. bubbles[i] = new Bubble(values[0],values[1]); } } void draw() { background(255); translate(width/2,height/2); // Display and move all bubbles for (int i = 0; i < bubbles.length; i ++ ) { bubbles[i].display(); // bubbles[i].drift(); if(i0){ stroke(0); strokeWeight(2); line(bubbles[i-1].r,bubbles[i-1].g,bubbles[i].r,bubbles[i].g); } } }
发表于 2011-12-12 14:12:12 | 显示全部楼层
代码什么的看不懂
回复

使用道具 举报

发表于 2012-1-8 05:09:34 | 显示全部楼层
因为文件名称太短了,改个长的就可以了
回复

使用道具 举报

发表于 2012-1-13 14:42:50 | 显示全部楼层
我也遇到过。改文件名呗,小问题
回复

使用道具 举报

NCFZ微信公众号

手机版|小黑屋|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 ) 辽公网安备21021102000973号

GMT+8, 2026-11-23 19:33 , Processed in 0.038235 second(s), 19 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

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