Robert Holder
ScreenHunter_50 Aug. 21 09.54
github.com/FeetWetCoding/FeetWetCoding/blob/master/exerci...
/ copyright (c) 2011 Robert Holder, Janice Dugger.
// See HELP.html included in this distribution.
#include
void Switch1::runExercise()
{
int x = 0, y = 0, size = 30;
int horizontalstep = 50, verticalstep = 50;
bool iscircle = true;
Color color = BLUE;
//fwcRectangle(0, 0, 400, 400, BLACK, 1, true);
for ( x = 0; x < 400; x += horizontalstep )
{
for (y = 0; y < 400; y += verticalstep )
{
if ( random(1) == 1 )
{
iscircle = true;
}
else
{
iscircle = false;
}
switch ( random(3) ){
case 1:
color = BLUE;
break;
case 2:
color = RED;
}
if ( random(2) )
{
fwcCircle(x, y, size/2, color, 5 );
}
else
{
fwcRectangle(x, y, size, size, color, 5 );
}
}
}
}
ScreenHunter_50 Aug. 21 09.54
github.com/FeetWetCoding/FeetWetCoding/blob/master/exerci...
/ copyright (c) 2011 Robert Holder, Janice Dugger.
// See HELP.html included in this distribution.
#include
void Switch1::runExercise()
{
int x = 0, y = 0, size = 30;
int horizontalstep = 50, verticalstep = 50;
bool iscircle = true;
Color color = BLUE;
//fwcRectangle(0, 0, 400, 400, BLACK, 1, true);
for ( x = 0; x < 400; x += horizontalstep )
{
for (y = 0; y < 400; y += verticalstep )
{
if ( random(1) == 1 )
{
iscircle = true;
}
else
{
iscircle = false;
}
switch ( random(3) ){
case 1:
color = BLUE;
break;
case 2:
color = RED;
}
if ( random(2) )
{
fwcCircle(x, y, size/2, color, 5 );
}
else
{
fwcRectangle(x, y, size, size, color, 5 );
}
}
}
}