select .... order by .... asc (A, B, C)

Description

sort 3 values

Inputs

  • value 1
  • value 2
  • value 3

Outputs

  • value 1
  • value 2
  • value 3

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1.
value 1: 1
value 2: 2
value 3: 3
value 1: 1
value 2: 2
value 3: 3
2.
value 1: 5
value 2: 20
value 3: 7
value 1: 5
value 2: 7
value 3: 20
3.
value 1: c
value 2: a
value 3: d
value 1: a
value 2: c
value 3: d
4.
value 1: 9
value 2: 1
value 3: 3
value 1: 1
value 2: 3
value 3: 9
5.
value 1: 2
value 2: 2
value 3: 2
value 1: 2
value 2: 2
value 3: 2

Applicable neurons

  • a > b
  • IF a=b THEN c ELSE d
  • IF (1) THEN a ELSE b
  • max (from 2 values)
  • min (from 2 values)
  • character :
  • logical riddle 7+3
  • \\s
  • n*
  • word largest
  • Cut String At specific character
  • middle

Algorithm

Test

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

/**
 * a = b: IF a=b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron591(x1, x2)
{
return [(x1 == x2) ? 1 : 0];
}

/**
 * IF: IF a THEN b ELSE c;
 *
 * @param x1 condition (1/0)
 * @param x2 variable for 1
 * @param x3 variable for 0
 * @return {Array}
 */
function neuron579(x1, x2, x3)
{
return [(x1) ? x2 : x3];
}

/**
 * IF a=b THEN c ELSE d: 
 * 
 * @param x1 a
 * @param x2 b
 * @param x3 c
 * @param x4 d
 * @return {Array}
 */
function neuron724(x1, x2, x3, x4)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;
  outputs[3] = x4;

  arr = neuron591(outputs[1], outputs[0]);
  outputs[4] = arr[0];

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

  return[outputs[5]];
}


/**
 * IF (1) THEN a ELSE b: 
 * 
 * @param x1 1/0
 * @param x2 a
 * @param x3 b
 * @return {Array}
 */
function neuron826(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * a > b: IF a>b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron589(x1, x2)
{
return [(Number(x1) > Number(x2)) ? 1 : 0];
}

/**
 * a < b: IF a<b THEN 1 ELSE 0;
 * 
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron592(x1, x2)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;

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

  return[outputs[2]];
}


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

/**
 * a = b: IF a=b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron591(x1, x2)
{
return [(x1 == x2) ? 1 : 0];
}

/**
 * IF: IF a THEN b ELSE c;
 *
 * @param x1 condition (1/0)
 * @param x2 variable for 1
 * @param x3 variable for 0
 * @return {Array}
 */
function neuron579(x1, x2, x3)
{
return [(x1) ? x2 : x3];
}

/**
 * IF a=b THEN c ELSE d: 
 * 
 * @param x1 a
 * @param x2 b
 * @param x3 c
 * @param x4 d
 * @return {Array}
 */
function neuron724(x1, x2, x3, x4)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;
  outputs[3] = x4;

  arr = neuron591(outputs[1], outputs[0]);
  outputs[4] = arr[0];

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

  return[outputs[5]];
}


/**
 * IF (1) THEN a ELSE b: 
 * 
 * @param x1 1/0
 * @param x2 a
 * @param x3 b
 * @return {Array}
 */
function neuron826(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * max (from 2 values): 
 * 
 * @param x1 value 1
 * @param x2 value 2
 * @return {Array}
 */
function neuron842(x1, x2)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;

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

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

  return[outputs[3]];
}


/**
 * a > b: IF a>b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron589(x1, x2)
{
return [(Number(x1) > Number(x2)) ? 1 : 0];
}

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

/**
 * a = b: IF a=b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron591(x1, x2)
{
return [(x1 == x2) ? 1 : 0];
}

/**
 * IF: IF a THEN b ELSE c;
 *
 * @param x1 condition (1/0)
 * @param x2 variable for 1
 * @param x3 variable for 0
 * @return {Array}
 */
function neuron579(x1, x2, x3)
{
return [(x1) ? x2 : x3];
}

/**
 * IF a=b THEN c ELSE d: 
 * 
 * @param x1 a
 * @param x2 b
 * @param x3 c
 * @param x4 d
 * @return {Array}
 */
function neuron724(x1, x2, x3, x4)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;
  outputs[3] = x4;

  arr = neuron591(outputs[1], outputs[0]);
  outputs[4] = arr[0];

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

  return[outputs[5]];
}


/**
 * IF (1) THEN a ELSE b: 
 * 
 * @param x1 1/0
 * @param x2 a
 * @param x3 b
 * @return {Array}
 */
function neuron826(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * min (from 2 values): 
 * 
 * @param x1 value 1
 * @param x2 value 2
 * @return {Array}
 */
function neuron843(x1, x2)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;

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

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

  return[outputs[3]];
}


/**
 * select .... order by .... asc (A, B, C): sort 3 values
 * 
 * @param x1 value 1
 * @param x2 value 2
 * @param x3 value 3
 * @return {Array}
 */
function neuron875(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

  arr = neuron842(outputs[1], outputs[0]);
  outputs[4] = arr[0];

  arr = neuron843(outputs[4], outputs[2]);
  outputs[5] = arr[0];

  arr = neuron843(outputs[3], outputs[0]);
  outputs[6] = arr[0];

  arr = neuron842(outputs[4], outputs[2]);
  outputs[7] = arr[0];

  arr = neuron826(outputs[1], outputs[2], outputs[7]);
  outputs[8] = arr[0];

  arr = neuron826(outputs[4], outputs[7], outputs[3]);
  outputs[9] = arr[0];

  return[outputs[6], outputs[5], outputs[9]];
}


Code made by AI:

Create your family tree for free