mositech / CS2015

All course materials for MOSI Home School Computer Science will be stored here
2 stars 1 forks source link

Jess Code #29

Open Jeswing opened 8 years ago

Jeswing commented 8 years ago
Walker w;

void setup(){
  size(400,400);
  w= new Walker();
  background(255);
}

void draw(){
  w.display();
  w.walk();
}

Tab 2

class Walker{
int x;
int y;

Walker(){
  x= width/2;
  y= height/2;
}

void display(){
  stroke(0);
  ellipse(x,y,100,100);
  fill(300,100,100);
}

void walk(){
  int random= int(random(6));
  if(random==0){
  x++;
  }

  if(random==1){
   x--;
  }
  if(random==2){
   y++;

  }
  if(random==3){
   y--;
  }
  if(random==4){
    x++;
}
if(random==5){
  y--;
}
}
}
The-Space-Core commented 8 years ago

Hello world

The-Space-Core commented 8 years ago

Hello Mercury, Venus, Earth, Mars, Asteroid field, Jupiter, Saturn, Uranus, Neptune, Not Pluto, And the SUN,