Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2017/09/27 17:44:01

MixJuice GET URL : kidspod.club/mj/374

072

  • No registered tag exist.

SOURCE CODE

var my;
var ex;
var ey;
var ef;
var key;
my = 23;
ex = -1;
while(1){
  cls();
  key = inkey();
  if (key == 32){
    my = my - 1;
  }
  else{
    my = my + 1;
  }
  if(my > 23){
    my = 23;
  }
  if (my < 0){
    my = 0;
  }
  lc(15, my);
  log(chr(0xF1));
 
  if((ex == -1) + (ex == 24)){
    ey = rnd(24);
    ef = rnd(2);
    if(ef == 0){
      ex = 0;
    }
    else{
      ex = 23;
    }
  }
 
  if(ef == 0){
    ex = ex + 1;
  }
  else{
    ex = ex - 1;
  }
 
  lc(ex, ey);
  log(chr(0xEA));
 
  if((ex == 15) * (my == ey)){
    lc(15, my);
    log(chr(0xF5));
  }
 
  sleep(200);
}

COMMENT