https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.7/p5.js
http://github.com/shiffman/PBox2D
第0章 引言 (已看)
第1章 向量 (已看)
第2章 力 (已看)
第3章 震荡 (已看)
第4章 粒子系统 (已看)
第5章 物理函数库 (已看)
第6章 自治智能体 (已看)
第7章 细胞自动机 (已看)
第8章 分形 (已看)
第9章 代码的进化 (已看)
第10章 神经网络 (已看)
第0章 引言
0.1 随机游走
0.2 随机游走类
Walker w; void setup() { size(640,360); w = new Walker(); background(255); } void draw() { w.step(); w.display(); } class Walker { int x; int y; Walker() { x = width / 2; y = height / 2; } void display() { stroke(0); point(x,y); } void step() { int choice = int(random(4)); if(choice == 0) { x++; } else if(choice == 1) { x--; } else if(choice == 2) { y++; } else { y--; } } }