Skip to content
Forum Archive

WTF is wrong with this SCC

7 posts

djcoolman#

WTF is wrong with this SCC


init:
n=500;rnd=5;
on beat:
c=bnot(c);rnd=rand(6);rnd=if(equal(rnd,0),2,rnd);rnd=if(equal(rnd,1),2,rnd);
per frame:
t=t-0.05;t1=t1+0.05;n=sqrt(h*h+w*w)
per point:
y=(getspec(y,1,cos(if(c,t,t1)))+cos(if(c,t,t1)))+v*rnd)/((if(c,t,t1)))+cos(i-t);
x=(getspec(x,1,cos(if(c,t,t1)))+(cos(if(c,t,t1)))+v*rnd)/((if(c,t,t1)))+sin(v));
UnConeD#
Little trick

A good way to check if the error is a syntax error (e.g. a missing bracket) or a logical error (wrong formula/calculation), is just to add "x=i*2-1;y=0" to the end. If you made a syntax error, this will have no effect, but if you made a logical error, then the code will still get executed and draw a horizontal line.
UnConeD#
Bracket errors are nasty because they can be very hard to spot. To quickly see if you made one, just go over each statement and keep an internal counter. When you see a '(', add one, when you see a ')', remove one. If you end up positive, you'got one '(' too many or not enough ')'. For negatives, it's the other way around of course.
uNDefineD#
UC: Damn, I thought I had made that up. LOL

EDIT: I just picked up an extra ) at the end of the x line.