Contains string any digit?

Inputs

  • string

Outputs

  • 1/0

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1.
string: abc1
1/0: 1
2.
string: abc
1/0: 0
3.
string: 98763
1/0: 1
4.
string: a b c, d
1/0: 0
5.
string: number 5
1/0: 1

Applicable neurons

  • RegExp.test
  • [x]
  • 0-9
  • [^x]
  • \\D
  • \\d
  • empty string
  • Destroyed building (calculation, windows, walls)
  • name into start tag
  • Rounding to whole thousands of something
  • logical riddle 7+3
  • character |
  • [^x]
  • \\D
  • word and

Algorithm

Test

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

/**
 * character -: 
 *
 * @return {Array}
 */
function neuron511()
{
return['-'];
}

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

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

/**
 * Connect - three inputs: Connect stringA + stringB + stringC
 * 
 * @param x1 string A
 * @param x2 string B
 * @param x3 string C
 * @return {Array}
 */
function neuron564(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * 0-9: 
 * 
 * @return {Array}
 */
function neuron770()
{
  var outputs = [];

  arr = neuron509();
  outputs[0] = arr[0];

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

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

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

  return[outputs[3]];
}


/**
 * 1: 
 *
 * @return {Array}
 */
function neuron501()
{
return [1];
}

/**
 * 9: 
 *
 * @return {Array}
 */
function neuron509()
{
return [9];
}

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

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

/**
 * Connect - three inputs: Connect stringA + stringB + stringC
 * 
 * @param x1 string A
 * @param x2 string B
 * @param x3 string C
 * @return {Array}
 */
function neuron564(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * Ascii code into character: 
 *
 * @param x1 ascii code
 * @return {Array}
 */
function neuron585(x1)
{
return [String.fromCharCode(x1)];
}

/**
 * 3 digits of ascii code into character: connect 3 digits to one ascii number and change it to character
 * 
 * @param x1 1. digit
 * @param x2 2. digit
 * @param x3 3. digit
 * @return {Array}
 */
function neuron638(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

  arr = neuron585(outputs[3]);
  outputs[4] = arr[0];

  return[outputs[4]];
}


/**
 * character [: 
 * 
 * @return {Array}
 */
function neuron693()
{
  var outputs = [];

  arr = neuron501();
  outputs[0] = arr[0];

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

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

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

  return[outputs[3]];
}


/**
 * 3: 
 *
 * @return {Array}
 */
function neuron503()
{
return [3];
}

/**
 * 9: 
 *
 * @return {Array}
 */
function neuron509()
{
return [9];
}

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

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

/**
 * Connect - three inputs: Connect stringA + stringB + stringC
 * 
 * @param x1 string A
 * @param x2 string B
 * @param x3 string C
 * @return {Array}
 */
function neuron564(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * Ascii code into character: 
 *
 * @param x1 ascii code
 * @return {Array}
 */
function neuron585(x1)
{
return [String.fromCharCode(x1)];
}

/**
 * 3 digits of ascii code into character: connect 3 digits to one ascii number and change it to character
 * 
 * @param x1 1. digit
 * @param x2 2. digit
 * @param x3 3. digit
 * @return {Array}
 */
function neuron638(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

  arr = neuron585(outputs[3]);
  outputs[4] = arr[0];

  return[outputs[4]];
}


/**
 * character ]: 
 * 
 * @return {Array}
 */
function neuron694()
{
  var outputs = [];

  arr = neuron503();
  outputs[0] = arr[0];

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

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

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

  return[outputs[3]];
}


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

/**
 * Connect - three inputs: Connect stringA + stringB + stringC
 * 
 * @param x1 string A
 * @param x2 string B
 * @param x3 string C
 * @return {Array}
 */
function neuron564(x1, x2, x3)
{
  var outputs = [];
  outputs[0] = x1;
  outputs[1] = x2;
  outputs[2] = x3;

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

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

  return[outputs[4]];
}


/**
 * [x]: Find ´x´ character between the brackets
 * 
 * @param x1 x
 * @return {Array}
 */
function neuron766(x1)
{
  var outputs = [];
  outputs[0] = x1;

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

  arr = neuron694();
  outputs[2] = arr[0];

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

  return[outputs[3]];
}


/**
 * empty string: 
 *
 * @return {Array}
 */
function neuron755()
{
return ['']
}

/**
 * empty string: 
 * 
 * @return {Array}
 */
function neuron787()
{
  var outputs = [];

  arr = neuron755();
  outputs[0] = arr[0];

  return[outputs[0]];
}


/**
 * RegExp.test: Tests for a match in a string of the regular expression. Returns 1/0.
 *
 * @param x1 pattern
 * @param x2 flags
 * @param x3 string
 * @return {Array}
 */
function neuron751(x1, x2, x3)
{
var pattern = x1; var flags = x2; var string = x3; var r = new RegExp(pattern, flags); return (r.test(string)) ? [1] : [0];
}

/**
 * Contains string any digit?: 
 * 
 * @param x1 string
 * @return {Array}
 */
function neuron786(x1)
{
  var outputs = [];
  outputs[0] = x1;

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

  arr = neuron766(outputs[1]);
  outputs[2] = arr[0];

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

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

  return[outputs[4]];
}


Code made by AI:

Create your family tree for free