NCF参数化建筑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 12596|回复: 3
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
1m
发表于 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); } } }
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享
2m
发表于 2011-12-12 14:12:12 | 只看该作者
代码什么的看不懂
3m
发表于 2012-1-8 05:09:34 | 只看该作者
因为文件名称太短了,改个长的就可以了
4m
发表于 2012-1-13 14:42:50 | 只看该作者
我也遇到过。改文件名呗,小问题

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

GMT+8, 2024-5-2 10:51 , Processed in 0.309725 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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