Nylon Code

 

 

Nylon Code

More Photos

Links to Related Sites

More about me

Main Page

 

 

//Daniel Sura
// Mas 110

int an;
int a;
int ch1;
int chose;


int rseed = 98;
int bb = 2987;
int mm = 987;

int RAND_MIN = 1;
int RAND_MAX = 3;

int Random() {
int bl = (rseed*bb+1);
rseed = (bl % mm);
return RAND_MIN + (rseed % (RAND_MAX+1));
}



///////////////////////////////////////////////////////////
void excite()
{
// Excited State


for (ch1 = 1; ch1 < 6; ch1++)
{
:5=0;
:6=0;
:7=0;

:0 =1;
:1=1;
:2=1;
:3=1;
:4=0;


for (a=0;a<400;a++)
{
seqPause(0);
}

:0 = 0;
:1=0;
:2=0;
:3=0;

for (int a2=0;a2<400;a2++)
{
seqPause(12);
}


}



}

///////////////////////////////////////////////////////////

void think()
{
// Thinking State

for (ch1=1;ch1<5;ch1++)
{
:0 = 1;

:1=1;
:2=1;
:3=0;
:4=0;
:5=0;
:6=0;
:7=0;



for (int c=0;c<800;c++)
{
seqPause(1);
}
:0=0;
:1=0;
:2=0;
:3=0;
:4=0;

for (int b=0;b<800;b++)
{
seqPause(2);
}

}

}

//////////////////////////////////////////////////////////
void feed()
{

// Hungry State




for (int d2=0;d2<2800;d2++)
{
seqPause(13);
}


:0 = 1;

:1=1;
:2=1;
:3=0;
:4=0;
:5=0;
:6=0;
:7=0;

:7=1;
:3=1;

for (int d=0;d<800;d++)
{
seqPause(3);
}

:7=0;
:3=0;


for (int e4=0;e4<2800;e4++)
{
seqPause(4);
}

:6=1;
:3=1;

for (int e5=0;e5<800;e5++)
{
seqPause(5);
}

:6=0;
:3=0;


for (int e6=0;e6<2800;e6++)
{
seqPause(6);
}

:5=1;
:3=1;

for (int e7=0;e7<800;e7++)
{
seqPause(7);
}

:5=0;
:3=0; 



for (int e8=0;e8<2800;e8++)
{
seqPause(8);
}



:4=1;
:3=1;

for (int e9=0;e9<800;e9++)
{
seqPause(9);
}

:4=0;
:3=0;

for (int t=1;t<4;t++)
{
:3=1;

for (int f1=0;f1<800;f1++)
{
seqPause(10);
}

:3=0;
}

for (int f2=0;f2<2800;f2++)
{
seqPause(11);
}





//////////////////////////////////////////////////////
//// CHecks to see if anyone is close or passing by
/////////////////////////////////////////////////////
void check()
{
an = #0;


// Excited State


if (an > 10)
{
if (an < 15 )


:5=0;
:6=0;
:7=0;

:0 =1;
:1=1;
:2=1;
:3=1;
:4=0;


for (int a=0;a<400;a++)
{
seqPause(0);
}

:0 = 0;
:1=0;
:2=0;
:3=0;

for (int a2=0;a2<400;a2++)
{
seqPause(12);
}




}


}

}

//////////////////////////////////////////////////
void drawex()
{
point (0,7);
line (1,6,1,8);
line (2,5,2,9);
line (3,4,3,10);
line (4,3,4,11);
line (5,3,5,11);
line (6,3,6,6);
line (6,8,6,11);
point (7,10);
point (7,9);
point (7,4);
point (7,5);
pause (80);
canvas();

}


/////////////////////////////////////////////////
void drawth()
{
line (8,4,8,9);
line (7,8,5,6);
line (5,6,3,8);
line (2,4,2,9);
pause (80);

}

////////////////////////////////////////////////
void drawhu()
{




line (0,5,0,9);
line (1,4,1,10);
line (2,3,2,11);
line (3,3,3,11);
line (4,3,4,6);
line (4,8,4,11);
point (5,10);
point (5,9);
point (5,4);
point (5,5);
point (4,7);
point (5,7);
point (6,7);
point (7,8);
point (8,9);

pause (80);

}


///////////////////////////////////////////////////
// Drawing before think

void bthink()
{
line (7,4,7,8);
line (7,8,3,4);
pause (200);
canvas();
line (3,6,7,6);
line (5,4,5,8);

pause (200);
canvas();

line (2,6,8,6);
pause (200);
canvas();

line (3,4,3,9);
line (6,4,6,9);
pause (200);
canvas();

}

///////////////////////////////////////////////////
// Drawing after think
///

void athink()

{
rect (2,5,7,4);
line (5,5,5,7);
pause (400);
canvas();
:3=1;
pause (100);
:3=0;


}


/////////////////////////////////////////////////////
/// Draw Happy
///////////////////////////////////////////////

void happy()

{
circle (5,7,4);
point (6,5);
point (6,9);
point (4,5);
point (4,9);
line (3,6,3,8);
:3=1;
pause (100);
:3=0;
canvas();


/////////////////////////////////////////////////
/// Main Calling Program
//////////////////////////////////////////////
{

chose = 1;
while (true)



if (@0 == 0)

canvas();
excite();
if (chose == 1)
happy();

chose = Random(); 

}


if (@1 == 0)

canvas();
bthink();
think();
canvas();
athink();
if (chose == 2) 
happy();
if (chose > 3)
happy();

chose = Random();



if (@2 == 0)
{
canvas();
drawhu();
feed();
canvas();
if (chose == 3)
happy();
chose = Random();
}


check();


if (chose == 1)
{

drawex();


if (chose == 2)
{
drawth();
}

if (chose == 3)
{

drawhu();
}

if (chose > 3)
{
drawth();
chose = Random();




}