Betta Fish
1000
0
0
100
weight>120
bloated
80>weight
starving
120>weight
normal
weight>150
fatdead
weight>80
normal
60>weight
thindead
(wagtime++)>5
normal
(wagtime++)>5
normal
feedfish
weight=weight+10;elapsed=0;
playfish
wagtime=0; prewagcurrent=curstate;
if (Math.random()>Math.min(elapsed/interval,19)/20)
{curstate="bubbles";}
else {curstate="flare";}
elapsed=elapsed+interval;
weight=weight-1;