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/20 00:43:15

MixJuice GET URL : kidspod.club/mj/347

059

  • No registered tag exist.

SOURCE CODE

var sy;
var key;
var nx;
var flag;
var score;
sy = 22;
nx = 0;
flag = 0;
score = 0;

while(1){
 key = inkey();
 if(key == 32){
  sy = sy - 5;
 }
 if(sy < 22){
  sy = sy + 1;
 }
 if(flag == 0){
  if(nx < 30){
    nx = nx + 1;
  }
  else{
   nx = nx - 1;
   flag = 1;
  }
 }
 else{
  if(nx > 0){
   nx = nx - 1;
  }
  else{
   nx = nx + 1;
   flag = 0;
  }
 }
 score = score + 1;
 cls();
 lc(15, sy);
 log("@");
 lc(nx, 22);
 log("_");
 lc(0, 0);
 log("SCORE:");
 log(score);
 sleep(100);
}

COMMENT