home *** CD-ROM | disk | FTP | other *** search
/ Ultimate Game Collection / XULTI.ISO / 396 / random.rpp < prev    next >
Text File  |  1996-12-08  |  1KB  |  174 lines

  1. { Random by Keebler }
  2.  
  3. var x: number;
  4. var y: number;
  5. var direction: number;
  6. var count: number;
  7.  
  8. x:=100 ;
  9. y:=100 ;
  10. count:=15;
  11.  
  12.  
  13. println(" SPACE to Clear Screen ");
  14. println("      ESC to Exit      ");
  15. delay(3000);
  16.  
  17.  
  18.  
  19.  
  20. $Main
  21.    count:=count+0.02;
  22.  
  23.   if (count>252)
  24.      count:=15;
  25.    endif; 
  26.  
  27.    {setcolor(rand(0,255));}
  28.    setcolor(count); 
  29.  
  30.    plot(x,y);
  31.    plot(x,199-y);
  32.    plot(319-x,y);
  33.    plot(319-x,199-y);
  34.  
  35.  
  36.    direction:=rand(1,4);
  37.  
  38.    if((direction=1)and(y>0))
  39.     y:=y-1;
  40.    endif;
  41.  
  42.    if((direction=2)and(x<159))
  43.     x:=x+1;
  44.    endif;
  45.  
  46.    if((direction=3)and(y<99))
  47.     y:=y+1;
  48.    endif;
  49.  
  50.    if((direction=4)and(x>0))
  51.     x:=x-1;
  52.    endif;
  53.  
  54.    if(kbcode(1))
  55.     goto $End
  56.    endif;
  57.  
  58.    if(kbcode(57))
  59.     cls(0);
  60.    endif;
  61.  
  62. goto $Main
  63.  
  64.  
  65. $End
  66. setcolor(1);
  67. end;
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.