Inputs
-
html
-
name of tag (h1/span/div/...)
Outputs
Neuron type
Best algorithm has been found - locked
Patterns
Pattern |
Input |
Output |
1. |
html: |
<body><h1 class="title">My page</h1></body> |
name of tag (h1/span/div/...): |
h1 |
|
html after tag: |
My page</h1></body> |
|
2. |
html: |
<body><div style=""><span></span>text</div></body> |
name of tag (h1/span/div/...): |
div |
|
html after tag: |
<span></span>text</div></body> |
|
3. |
html: |
<span>text</span><div>text2</div> |
name of tag (h1/span/div/...): |
span |
|
html after tag: |
text</span><div>text2</div> |
|
4. |
html: |
<div class="red">text1<br>text2</div> |
name of tag (h1/span/div/...): |
div |
|
html after tag: |
text1<br>text2</div> |
|
Applicable neurons
-
Get after substring
-
character >
-
Rectangle - perimeter
-
character ,
-
√¯(a² + b² + c²)
-
convert minutes and seconds into MM:SS
-
\\d
-
character {
-
Is X divisible by Y...
Algorithm
Test
Code made by AI:
/**
* Length of string:
*
* @param x1 String
* @return {Array}
*/
function neuron528(x1)
{
return[x1.toString().length];
}
/**
* Length of string:
*
* @param x1 String
* @return {Array}
*/
function neuron528(x1)
{
return[x1.toString().length];
}
/**
* 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)];
}
/**
* Substring (from position to end):
*
* @param x1 MyString
* @param x2 start position
* @return {Array}
*/
function neuron529(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron528(outputs[0]);
outputs[2] = arr[0];
arr = neuron525(outputs[0], outputs[1], outputs[2]);
outputs[3] = arr[0];
return[outputs[3]];
}
/**
* Position: Search position substring of string
*
* @param x1 MyString
* @param x2 FindMe
* @return {Array}
*/
function neuron523(x1, x2)
{
return [x1.toString().indexOf(x2.toString())];
}
/**
* Get after substring:
*
* @param x1 MyString
* @param x2 Substring
* @return {Array}
*/
function neuron531(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron528(outputs[1]);
outputs[2] = arr[0];
arr = neuron529(outputs[0], outputs[2]);
outputs[3] = arr[0];
arr = neuron523(outputs[0], outputs[1]);
outputs[4] = arr[0];
arr = neuron529(outputs[3], outputs[4]);
outputs[5] = arr[0];
return[outputs[5]];
}
/**
* 2:
*
* @return {Array}
*/
function neuron502()
{
return [2];
}
/**
* 6:
*
* @return {Array}
*/
function neuron506()
{
return [6];
}
/**
* Connect - two inputs:
*
* @param x1 Variable A
* @param x2 Variable B
* @return {Array}
*/
function neuron520(x1, x2)
{
return [x1.toString()+x2.toString()];
}
/**
* Ascii code into character:
*
* @param x1 ascii code
* @return {Array}
*/
function neuron585(x1)
{
return [String.fromCharCode(x1)];
}
/**
* character >:
*
* @return {Array}
*/
function neuron607()
{
var outputs = [];
arr = neuron502();
outputs[0] = arr[0];
arr = neuron506();
outputs[1] = arr[0];
arr = neuron520(outputs[1], outputs[0]);
outputs[2] = arr[0];
arr = neuron585(outputs[2]);
outputs[3] = arr[0];
return[outputs[3]];
}
/**
* Get html after tag:
*
* @param x1 html
* @param x2 name of tag (h1/span/div/...)
* @return {Array}
*/
function neuron629(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron531(outputs[0], outputs[1]);
outputs[2] = arr[0];
arr = neuron607();
outputs[3] = arr[0];
arr = neuron531(outputs[2], outputs[3]);
outputs[4] = arr[0];
return[outputs[4]];
}
Code made by AI: