before decimal point

Inputs

  • number with decimal point

Outputs

  • number before decimal point

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1.
number with decimal point: 12
number before decimal point: 12
2.
number with decimal point: 3.4
number before decimal point: 3
3.
number with decimal point: 0.12312312313
number before decimal point: 0

Applicable neurons

  • character .
  • Connect - two inputs
  • Get before substring
  • Radians into degrees
  • NOT
  • character t
  • character ≥
  • after decimal point

Algorithm

Test

Code made by AI:
/**
 * character .: 
 *
 * @return {Array}
 */
function neuron510()
{
return['.'];
}

/**
 * Connect - two inputs: 
 *
 * @param x1 Variable A
 * @param x2 Variable B
 * @return {Array}
 */
function neuron520(x1, x2)
{
return [x1.toString()+x2.toString()];
}

/**
 * Position: Search position substring of string
 *
 * @param x1 MyString
 * @param x2 FindMe
 * @return {Array}
 */
function neuron523(x1, x2)
{
return [x1.toString().indexOf(x2.toString())];
}

/**
 * 0: 
 *
 * @return {Array}
 */
function neuron500()
{
return [0];
}

/**
 * Substring (startPosition, endPosition): Get substring from string - from position - to pos
 *
 * @param x1 MyString
 * @param x2 start position
 * @param x3 end position
 * @return {Array}
 */
function neuron525(x1, x2, x3)
{
return[x1.toString().substring(x2, x3)];
}

/**
 * Get before substring: 
 * 
 * @param x1 MyString
 * @param x2 Substring
 * @return {Array}
 */
function neuron532(x1, x2)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;

  arr = neuron523(outputs[0], outputs[1]);
  outputs[2] = arr[0];

  arr = neuron500();
  outputs[3] = arr[0];

  arr = neuron525(outputs[0], outputs[2], outputs[3]);
  outputs[4] = arr[0];

  return[outputs[4]];
}


/**
 * before decimal point: 
 * 
 * @param x1 number with decimal point
 * @return {Array}
 */
function neuron742(x1)
{
  var outputs = [];
  outputs[0] = x1;

  arr = neuron510();
  outputs[1] = arr[0];

  arr = neuron520(outputs[0], outputs[1]);
  outputs[2] = arr[0];

  arr = neuron532(outputs[2], outputs[1]);
  outputs[3] = arr[0];

  return[outputs[3]];
}


Code made by AI:

Rodokmen - poznejte své předky | TOPlist U.I., Umělá inteligence