Primitivism

Spanish lottery la primitiva (6 из 49 + 1 of 10)

Below is a demonstration of programming tools, supported in LCRYP:

 
/* Global Variables. */
int ga;
double gx;
char gc;

int OnTick()
{
  /* Local variables. * /
  int a, index;
  double x,and;
  char c;

  /* Assignment as an operation. * /
  ga = a = 3;
  gx = x = y = 5;
  gc = c = '0';

  index = 0;
  prt(index,"a = [");
  /* Цикл while. */
  while(a>=0) {
    prt_a(index,a);
    a = a - 1;
  }
  prt_a(index,"]");

  index = 1;
  Print_AZ(index); // Using the function.

  index = 2;
  gc = 'A';
  prt(index,"");
  /* Цикл do-while. */
  do {
     prt_a(index,gc);
     gc = gc + 1;
  } while(gc !='F');

  /* Demonstration of recursion. */
  index = 2;
  prt(index,"");
  x = 3;
  y = 2;
  gx = factr(index,math(x,and)); // Using function arguments.
  prt_a(index," factr=");
  prt_a(index,gx);

  return 0;
}

/* Displaying the English alphabet. */
int Print_AZ(int index)
{
  char ch;
  prt(index,"");  // The beginning of the output of the line with the index index on the chart.
  /* цикл for */
  for (ch = 'A'; ch<= 'Z'; ch = ch + 1) {
    prt_a(index,ch); // Continue displaying the line with the index index to the chart.
  }
  return 0;
}

/* Returns the factorial of the number i. */
int factr(int index, int i)
{
  prt_a(index,i);
  if(i<2) {
    return 1;
  }
  else {
     return  i * factr(index,i-1);
  }
}

int math(int a, int b)
{
  return a+b;
}

/* Function not enabled. */
int OnInit()
{
  return;
}

/* Function not enabled. */
int OnBar()
{
  return;
}

Rate article